From 023d911e31018131e829289ccb9963d96b38403b Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 11 May 2021 21:50:03 +0200 Subject: ham/light_buttons: add state machine --- .../2configs/home/ham/automation/light_buttons.nix | 83 ++++++++++++++++++---- 1 file changed, 68 insertions(+), 15 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix index 32d134ec..89caf1a4 100644 --- a/makefu/2configs/home/ham/automation/light_buttons.nix +++ b/makefu/2configs/home/ham/automation/light_buttons.nix @@ -1,22 +1,77 @@ -# light.wohnzimmerbeleuchtung -# light.wohnzimmer_deko -# light.arbeitszimmerbeleuchtung -# light.arbeitszimmer_deko -# light.schlafzimmerbeleuchtung let - toggle = light: btn: + btn_state = light: btn: halfbright: + let + maxbright = 255; + transition = 0.2; # seconds + in + # this function implements a simple state machine based on the state and brightness of the light (light must support brightness { - alias = "Toggle Light ${light} via ${btn}"; + alias = "Cycle through states of ${light} via button ${btn}"; trigger = { platform = "state"; entity_id = "sensor.${btn}_click"; to = "single"; }; action = { - service = "light.toggle"; - data.entity_id = light; - data.transition = 0; + choose = [ + { + # state 0: off to half + conditions = { + condition = "template"; + value_template = ''{{ states("${light}") == "off" }}''; + }; + sequence = [ + { + service = "light.turn_on"; + data = { + entity_id = light; + brightness = halfbright; + }; + } + ]; + } + { + # state 1: half to full + conditions = { + condition = "template"; + value_template = ''{{ states('${light}') == 'on' and ( ${toString (halfbright - 1)} <= state_attr("${light}","brightness") <= ${toString (halfbright + 1)})}}''; + }; + sequence = [ + { + service = "light.turn_on"; + data = { + entity_id = light; + brightness = maxbright; + }; + } + ]; + } + { + # state 2: full to off + conditions = { + condition = "template"; + # TODO: it seems like the devices respond with brightness-1 , maybe off-by-one somewhere? + value_template = ''{{ states("${light}") == "on" and state_attr("${light}","brightness") >= ${toString (maxbright - 1)}}}''; + }; + sequence = [ + { + service = "light.turn_off"; + data = { + entity_id = light; + }; + } + ]; + } + ]; + # default: on to off + # this works because state 0 checks for "state == off" + default = [{ + service = "light.turn_off"; + data = { + entity_id = light; + }; + }]; }; }; turn_off_all = btn: @@ -34,11 +89,9 @@ let }; in { services.home-assistant.config.automation = [ - (toggle "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1") - (toggle "light.schlafzimmerbeleuchtung" "schlafzimmer_btn2") - (toggle "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3") - (turn_off_all "arbeitszimmer_btn1") + # (btn_state "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1") + (btn_state "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128) + # (btn_state "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3") (turn_off_all "schlafzimmer_btn2") - (turn_off_all "wohnzimmer_btn3") ]; } -- cgit v1.2.3 From ceaf0a09a2bba72f8db89da6c11e246201165fd3 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:08:41 +0200 Subject: ma bgt/etherpad: bump to latest version --- makefu/2configs/bgt/etherpad.euer.krebsco.de.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix index 48b947c5..cf5b22ba 100644 --- a/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix +++ b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix @@ -30,8 +30,12 @@ in { proxy_read_timeout 1799s; ''; }; - docker-containers."etherpad-lite" = { - image = "makefoo/bgt-etherpad:2020-05-02.6"; + state = [ "/var/lib/docker/volumes/etherpad_data/_data/" ]; + virtualisation.oci-containers.containers."etherpad-lite" = { + image = "makefoo/bgt-etherpad:2021-04-16.3"; # --build-arg ETHERPAD_PLUGINS="ep_markdown" + # ep_codepad does not work anymore + + #image = "etherpad/etherpad:1.8.13"; ports = [ "127.0.0.1:${toString port}:9001" ]; volumes = [ "/var/src/secrets/etherpad/apikey:/opt/etherpad-lite/APIKEY.txt" @@ -46,7 +50,10 @@ in { #DB_PASS=mypassword environment = { # ADMIN_PASSWORD = "auf jeden fall nicht das echte admin passwort"; + # LOGLEVEL = "DEBUG"; + SUPPRESS_ERRORS_IN_PAD_TEXT = "true"; + TRUST_PROXY = "true"; TITLE = "Binärgewitter Etherpad"; SKIN_NAME = "no-skin"; DEFAULT_PAD_TEXT = builtins.replaceStrings ["\n"] ["\\n"] (builtins.readFile ./template.md); -- cgit v1.2.3 From db56b51ab4d1cecc0e7e664e51b89f04d360680a Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:10:57 +0200 Subject: ma social-to-irc: restart brockman --- makefu/2configs/bgt/social-to-irc.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/bgt/social-to-irc.nix b/makefu/2configs/bgt/social-to-irc.nix index dc975c35..ac4c6cad 100644 --- a/makefu/2configs/bgt/social-to-irc.nix +++ b/makefu/2configs/bgt/social-to-irc.nix @@ -1,10 +1,16 @@ { - # systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG"; + systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG"; + systemd.services.restart-brockman = { + after = [ "brockman.service" ]; + wantedBy = [ "multi-user.target" ]; + startAt = "daily"; + script = "${pkgs.systemd}/bin/systemctl try-restart brockman.service"; + }; krebs.brockman = { enable = true; config = { channel = "#binaergewitter"; - notifyErrors = false; + notifyErrors = false; irc = { host = "irc.freenode.net"; port = 6667; -- cgit v1.2.3 From 4d08eada4ede46463abfc74b7a03881c26d34b00 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:12:03 +0200 Subject: ma bgt/template: add note about three dashes --- makefu/2configs/bgt/template.md | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/bgt/template.md b/makefu/2configs/bgt/template.md index d30cb49e..af5de069 100644 --- a/makefu/2configs/bgt/template.md +++ b/makefu/2configs/bgt/template.md @@ -21,6 +21,7 @@ ## Vorschläge ### Backlog von Picks und Lesefoo aus der letzten Woche +die Nachfolgenden 3 Striche sind sehr wichtig, bitte nicht löschen --- ## Blast from the Past -- cgit v1.2.3 From 7f515fd150eb7672f272ee61f581ae7e0ff76e86 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:12:25 +0200 Subject: ma bureautomation: disable pykodi --- makefu/2configs/bureautomation/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index aa13b62b..669754ca 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -59,7 +59,7 @@ in { extraPackages = p: [ # TODO: put somewhere else (p.callPackage {}) - (p.callPackage {}) + # (p.callPackage {}) p.APScheduler ]; }; autoExtraComponents = true; @@ -147,7 +147,7 @@ in { frontend = { }; http = { # TODO: https://github.com/home-assistant/home-assistant/issues/16149 - base_url = "http://192.168.8.11:8123"; + # base_url = "http://192.168.8.11:8123"; }; conversation = {}; history = {}; -- cgit v1.2.3 From 485807c22d20db9684612333cfda0b1fa63cf45a Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:13:13 +0200 Subject: ma home/ham: add signal-rest, update automations --- .../2configs/home/ham/automation/fenster_auf.nix | 63 ++++++++-- makefu/2configs/home/ham/automation/giesskanne.nix | 4 +- .../home/ham/automation/lichter_dimmen.nix | 135 +++++++++++++++++++++ .../ham/automation/pflanzen_giessen_erinnerung.nix | 39 ++++++ makefu/2configs/home/ham/calendar/nextcloud.nix | 30 +++++ makefu/2configs/home/ham/default.nix | 21 ++-- makefu/2configs/home/ham/multi/kurzzeitwecker.nix | 11 +- makefu/2configs/home/ham/signal-rest/default.nix | 20 +-- makefu/2configs/home/ham/signal-rest/hass.nix | 20 +++ makefu/2configs/home/ham/signal-rest/pkg.nix | 25 ++++ makefu/2configs/home/ham/signal-rest/service.nix | 18 +++ makefu/2configs/home/zigbee2mqtt/default.nix | 1 - 12 files changed, 344 insertions(+), 43 deletions(-) create mode 100644 makefu/2configs/home/ham/automation/lichter_dimmen.nix create mode 100644 makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix create mode 100644 makefu/2configs/home/ham/signal-rest/hass.nix create mode 100644 makefu/2configs/home/ham/signal-rest/pkg.nix create mode 100644 makefu/2configs/home/ham/signal-rest/service.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/home/ham/automation/fenster_auf.nix b/makefu/2configs/home/ham/automation/fenster_auf.nix index ccebd5b0..871f248b 100644 --- a/makefu/2configs/home/ham/automation/fenster_auf.nix +++ b/makefu/2configs/home/ham/automation/fenster_auf.nix @@ -1,3 +1,8 @@ +{ lib, ... }: +#uses: +# notify.signal +# binary_sensor.badezimmer_fenster_contact +# binary_sensor.dusche_fenster_contact let min = 20; fenster_offen = name: entity: @@ -13,21 +18,57 @@ let action = [ { - service = "notify.firetv_wohnzimmer"; + service = "notify.signal_home"; data = { - title = "${name} seit ${toString min} Minuten offen"; - message = "Bitte einmal checken ob das ok ist :)"; - data = { - interrupt = 1; - duration = 300; - }; + message= "${name} seit ${toString min} Minuten offen\nBitte einmal checken ob das ok ist :)"; }; } + { + service = "input_boolean.turn_on"; + target.entity_id = "input_boolean.${lib.toLower name}_lang_offen"; + } + ]; + }; + fenster_geschlossen_lang = name: entity: + { alias = "${name} wieder geschlossen"; + trigger = [ + { + platform = "state"; + entity_id = entity; + to = "off"; + } + ]; + condition = [ + { condition = "state"; + entity_id = "input_boolean.${lib.toLower name}_lang_offen"; + state = "on"; + } + ]; + action = + [ + { + service = "notify.signal_home"; + data = { + message= "${name} ist wieder geschlossen, Danke!"; + }; + } + { + service = "input_boolean.turn_off"; + target.entity_id = "input_boolean.${lib.toLower name}_lang_offen"; + } ]; }; in { - services.home-assistant.config.automation = [ - (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact") - (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact") - ]; + services.home-assistant.config = { + input_boolean = { + badezimmerfinester_lang_offen.name = "Badezimmer lange offen"; + duschfenster_lang_offen.name = "Duschfenster lange offen"; + }; + automation = [ + (fenster_geschlossen_lang "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact") + (fenster_geschlossen_lang "Duschfenster" "binary_sensor.badezimmer_fenster_contact") + (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact") + (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact") + ]; + }; } diff --git a/makefu/2configs/home/ham/automation/giesskanne.nix b/makefu/2configs/home/ham/automation/giesskanne.nix index 4b0fb61d..b11fd9d5 100644 --- a/makefu/2configs/home/ham/automation/giesskanne.nix +++ b/makefu/2configs/home/ham/automation/giesskanne.nix @@ -5,9 +5,9 @@ let name = "chilicam"; camera = "camera.espcam_02"; light = "light.espcam_02_light"; - seconds = 60; # default shutoff to protect the LED from burning out + seconds = 90; # default shutoff to protect the LED from burning out }; - seconds = 60; + seconds = 70; # time for giesskanne pump = "switch.arbeitszimmer_giesskanne_relay"; # sensor = "sensor.statistics_for_sensor_crafting_brotbox_soil_moisture"; in diff --git a/makefu/2configs/home/ham/automation/lichter_dimmen.nix b/makefu/2configs/home/ham/automation/lichter_dimmen.nix new file mode 100644 index 00000000..4303cdfa --- /dev/null +++ b/makefu/2configs/home/ham/automation/lichter_dimmen.nix @@ -0,0 +1,135 @@ +# This module maps the RF433 Remote Control to zigbee and wifi lights +let + rf_turn_off = code: light: + { + alias = "Turn off ${light} via rf code ${code}"; + trigger = { + platform = "event"; + event_type = "esphome.rf_code_received"; + event_data.code = code; + }; + action = { + service = "light.turn_off"; + data.entity_id = light; + }; + }; + rf_turn_on = code: light: + { + alias = "Turn on ${light} via rf code ${code}"; + trigger = { + platform = "event"; + event_type = "esphome.rf_code_received"; + event_data.code = code; + }; + action = { + service = "light.turn_on"; + data.entity_id = light; + }; + }; + rf_state = code: light: halfbright: + let + maxbright = 255; + transition = 0.2; # seconds + in + # this function implements a simple state machine based on the state and brightness of the light (light must support brightness + { + alias = "Cycle through states of ${light} via rf code ${code}"; + trigger = { + platform = "event"; + event_type = "esphome.rf_code_received"; + event_data.code = code; + }; + action = { + choose = [ + { + # state 0: off to half + conditions = { + condition = "template"; + value_template = ''{{ states("${light}") == "off" }}''; + }; + sequence = [ + { + service = "light.turn_on"; + data = { + entity_id = light; + brightness = halfbright; + }; + } + ]; + } + { + # state 1: half to full + conditions = { + condition = "template"; + value_template = ''{{ states('${light}') == 'on' and ( ${toString (halfbright - 1)} <= state_attr("${light}","brightness") <= ${toString (halfbright + 1)})}}''; + }; + sequence = [ + { + service = "light.turn_on"; + data = { + entity_id = light; + brightness = maxbright; + }; + } + ]; + } + { + # state 2: full to off + conditions = { + condition = "template"; + # TODO: it seems like the devices respond with brightness-1 , maybe off-by-one somewhere? + value_template = ''{{ states("${light}") == "on" and state_attr("${light}","brightness") >= ${toString (maxbright - 1)}}}''; + }; + sequence = [ + { + service = "light.turn_off"; + data = { + entity_id = light; + }; + } + ]; + } + ]; + # default: on to off + # this works because state 0 checks for "state == off" + default = [{ + service = "light.turn_off"; + data = { + entity_id = light; + }; + }]; + }; + } +; + rf_toggle = code: light: + { + alias = "Toggle ${light} via rf code ${code}"; + trigger = { + platform = "event"; + event_type = "esphome.rf_code_received"; + event_data.code = code; + }; + action = { + service = "light.toggle"; + data.entity_id = light; + }; + }; +in +{ + services.home-assistant.config.automation = [ + (rf_toggle "400551" "light.wohnzimmer_fernseher_led_strip") # A + (rf_state "401151" "light.wohnzimmer_stehlampe_osram" 128) # B + (rf_state "401451" "light.wohnzimmer_komode_osram" 128) # C + (rf_state "401511" "light.wohnzimmer_schrank_osram" 128) # D + + # OFF Lane + (rf_turn_off "400554" "all") # A + (rf_toggle "401154" "light.wohnzimmer_fenster_lichterkette_licht") # B + (rf_toggle "401454" "light.wohnzimmer_fernsehwand_led") # C + # (rf_toggle "401514" "") # D + ]; + # "400554" # A OFF + # "401154" # B OFF + # "401454" # C OFF + # "401514" # D OFF +} diff --git a/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix b/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix new file mode 100644 index 00000000..3aaa57bd --- /dev/null +++ b/makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix @@ -0,0 +1,39 @@ +let + notify_felix = message: { + service = "notify.signal_felix"; + data.message = message; + }; + notify_home = message: { + service = "notify.signal_home"; + data.message = message; + }; +in +{ + services.home-assistant.config.automation = + [ + { + alias = "Pflanzen Giessen Erinnerung Daily"; + trigger = { + platform = "time"; + at = "12:15:00"; + }; + action = [ + (notify_felix "Es ist Mittagszeit und du kannst ruhig einmal alle Blumen im Zimmer giessen") + ]; + } + { + alias = "Pflanzen Giessen Erinnerung Weekly"; + trigger = { + platform = "time"; + at = "12:15:00"; + }; + condition = { + condition = "time"; + weekday = [ "sat" ]; + }; + action = [ + (notify_home "Es ist Wochenende und die Pflanzen würden sich über ein bisschen Wasser freuen.") + ]; + } + ]; +} diff --git a/makefu/2configs/home/ham/calendar/nextcloud.nix b/makefu/2configs/home/ham/calendar/nextcloud.nix index 80e51b34..6035904c 100644 --- a/makefu/2configs/home/ham/calendar/nextcloud.nix +++ b/makefu/2configs/home/ham/calendar/nextcloud.nix @@ -8,6 +8,36 @@ in platform = "caldav"; inherit (cred) username password; url = "https://o.euer.krebsco.de/remote.php/dav"; + # make calendars "all-day" before uploading: + # sed -i -e 's/^\(DTSTART;.*\)T......\r$/\1\r/' -e # 's/^\(DTEND;.*\)T......\r$/\1\r/' abfall.ical + custom_calendars = [ + { + name = "Gelbersack"; + calendar = "Abfall"; + search = "Gelber Sack.*"; + } + { + name = "Biomuell"; + calendar = "Abfall"; + search = "Bio.*"; + } + { + name = "Restmuell"; + calendar = "Abfall"; + search = "Rest.*"; + } + { + name = "Papiermuell"; + calendar = "Abfall"; + search = "Altpapier.*"; + } + { + name = "Kehrwoche"; + calendar = "Kehrwoche"; + search = ".*"; + } + ]; } + ]; } diff --git a/makefu/2configs/home/ham/default.nix b/makefu/2configs/home/ham/default.nix index ee3b6242..11894906 100644 --- a/makefu/2configs/home/ham/default.nix +++ b/makefu/2configs/home/ham/default.nix @@ -33,7 +33,8 @@ in { ./automation/firetv_restart.nix ./automation/light_buttons.nix ./automation/wohnzimmer_rf_fernbedienung.nix - ./automation/giesskanne.nix + #./automation/giesskanne.nix + ./automation/pflanzen_giessen_erinnerung.nix #./automation/urlaub.nix ./automation/moodlight.nix @@ -48,7 +49,9 @@ in { })).override { extraPackages = p: [ (p.callPackage ./deps/dwdwfsapi.nix {}) - (p.callPackage ./deps/pykodi.nix {}) ]; + (p.callPackage ./signal-rest/pkg.nix {}) + #(p.callPackage ./deps/pykodi.nix {}) + ]; }; config = { @@ -103,11 +106,11 @@ in { # (builtins.readFile )) #]; notify = [ - { - platform = "kodi"; - name = "Kodi Wohnzimmer"; - host = firetv_stick; - } + #{ + # platform = "kodi"; + # name = "Kodi Wohnzimmer"; + # host = firetv_stick; + #} { platform = "nfandroidtv"; name = "FireTV Wohnzimmer"; @@ -166,8 +169,10 @@ in { }; #binary_sensor = # flurlicht.binary_sensor; + sensor = [ - { platform = "speedtest"; + { platform = "speedtestdotnet"; + scan_interval.hours = 6; monitored_conditions = [ "ping" "download" "upload" ]; } # https://www.home-assistant.io/cookbook/automation_for_rainy_days/ diff --git a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix b/makefu/2configs/home/ham/multi/kurzzeitwecker.nix index bd81465c..a0748e20 100644 --- a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix +++ b/makefu/2configs/home/ham/multi/kurzzeitwecker.nix @@ -5,9 +5,10 @@ # Needs: # sensor.zigbee_btn1_click -# notify.telegrambot +# notify.signal_home let button = "sensor.zigbee_btn2_click"; + notify = "notify.signal_home"; in { services.home-assistant.config = { @@ -56,7 +57,7 @@ in data.duration = "00:05:00"; } { - service = "notify.telegrambot"; + service = notify; data.message = "Timer gestartet {{state_attr('timer.kurzzeitwecker', 'remaining') }}, verbleibend "; } ]; @@ -79,7 +80,7 @@ in entity_id = "script.add_5_minutes_to_kurzzeitwecker"; } { - service = "notify.telegrambot"; + service = notify; data.message = ''Timer um 5 minuten verlängert, {{ state_attr('timer.kurzzeitwecker', 'remaining') | truncate(9,True," ") }} verbleibend ''; } ]; @@ -111,7 +112,7 @@ in entity_id = "timer.kurzzeitwecker"; } { - service = "notify.telegrambot"; + service = notify; data.message = "Timer gestoppt, abgebrochen"; } ]; @@ -125,7 +126,7 @@ in }; action = [ { - service = "notify.telegrambot"; + service = notify; data.message = "Timer beendet"; } ]; diff --git a/makefu/2configs/home/ham/signal-rest/default.nix b/makefu/2configs/home/ham/signal-rest/default.nix index 250a3596..4eac41ba 100644 --- a/makefu/2configs/home/ham/signal-rest/default.nix +++ b/makefu/2configs/home/ham/signal-rest/default.nix @@ -1,18 +1,6 @@ - -let - port = 8631; - image = "bbernhard/signal-cli-rest-api:latest"; - config = "/var/lib/signal-cli-config"; -in { - systemd.tmpfiles.rules = [ - "d ${config} docker docker - -" +{ + imports = [ + ./service.nix + ./hass.nix ]; - state = [ config ]; - virtualisation.oci-containers.containers.signal-rest = { - image = image; - ports = [ "127.0.0.1:${toString port}:8080" ]; - volumes = [ - "${config}:/home/.local/share/signal-cli" - ]; - }; } diff --git a/makefu/2configs/home/ham/signal-rest/hass.nix b/makefu/2configs/home/ham/signal-rest/hass.nix new file mode 100644 index 00000000..284be332 --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/hass.nix @@ -0,0 +1,20 @@ +let + inherit (import ) number home felix; +in { + services.home-assistant.config.notify = [ + { + name = "signal_home"; + platform = "signal_messenger"; + url = "http://127.0.0.1:8631"; + inherit number ; + recipients = [ home ]; + } + { + name = "signal_felix"; + platform = "signal_messenger"; + url = "http://127.0.0.1:8631"; + inherit number; + recipients = [ felix ]; + } + ]; +} diff --git a/makefu/2configs/home/ham/signal-rest/pkg.nix b/makefu/2configs/home/ham/signal-rest/pkg.nix new file mode 100644 index 00000000..165d642a --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/pkg.nix @@ -0,0 +1,25 @@ +{ lib +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "pysignalclirestapi"; + version = "0.3.14"; + + # disabled = ; # requires python version >=2.7 + + src = fetchPypi { + inherit pname version; + sha256 = "6f3626b594a53c4161dfc67ea7a3b23d62c8fe8cb404a909496118aeefa79cd0"; + }; + + doCheck = false; + + meta = with lib; { + description = "Small python library for the Signal Cli REST API"; + homepage = https://github.com/bbernhard/pysignalclirestapi; + #license = licenses.; + # maintainers = [ maintainers. ]; + }; +} diff --git a/makefu/2configs/home/ham/signal-rest/service.nix b/makefu/2configs/home/ham/signal-rest/service.nix new file mode 100644 index 00000000..250a3596 --- /dev/null +++ b/makefu/2configs/home/ham/signal-rest/service.nix @@ -0,0 +1,18 @@ + +let + port = 8631; + image = "bbernhard/signal-cli-rest-api:latest"; + config = "/var/lib/signal-cli-config"; +in { + systemd.tmpfiles.rules = [ + "d ${config} docker docker - -" + ]; + state = [ config ]; + virtualisation.oci-containers.containers.signal-rest = { + image = image; + ports = [ "127.0.0.1:${toString port}:8080" ]; + volumes = [ + "${config}:/home/.local/share/signal-cli" + ]; + }; +} diff --git a/makefu/2configs/home/zigbee2mqtt/default.nix b/makefu/2configs/home/zigbee2mqtt/default.nix index 873699e3..95ee5683 100644 --- a/makefu/2configs/home/zigbee2mqtt/default.nix +++ b/makefu/2configs/home/zigbee2mqtt/default.nix @@ -40,7 +40,6 @@ in log_output = [ "console" ]; last_seen = "ISO_8601"; elapsed = true; - reporting = true; # TODO test if it is better with groups pan_id = 6755; inherit (sec.zigbee) network_key; }; -- cgit v1.2.3 From 41e87ff78857eb209b9598ee9aee8c6fa73a1af0 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:17:09 +0200 Subject: ma printer: update --- makefu/2configs/printer.nix | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index 89b5e057..72b9dadd 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -21,20 +21,26 @@ in { hardware.sane = { enable = true; extraBackends = [ ]; - netConf = - # drucker.lan SCX-3205W - '' - 192.168.111.16'' - # uhrenkind.shack magicolor 1690mf - + '' - 10.42.20.30''; + extraConfig.xerox_mfp = '' + usb 0x04e8 0x3441 + ''; + #netConf = + # # drucker.lan SCX-3205W + # '' + # 192.168.111.16'' + # # uhrenkind.shack magicolor 1690mf + #+ '' + # 10.42.20.30''; - # $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150 + ## $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150 - # requires 'sane-extra', scan via: - extraConfig."magicolor" = '' - net 10.42.20.30 0x2098 - ''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf + ## requires 'sane-extra', scan via: + #extraConfig."magicolor" = '' + # net 10.42.20.30 0x2098 + #''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf }; state = [ "/var/lib/cups" ]; + services.udev.extraRules = '' + ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3441", ENV{libsane_matched}="yes" + ''; } -- cgit v1.2.3 From a8fb43be6af717901d8423e0801f6a52fa264e79 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:17:28 +0200 Subject: ma ircbot: restart brockman --- makefu/2configs/systemdultras/ircbot.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/systemdultras/ircbot.nix b/makefu/2configs/systemdultras/ircbot.nix index 47709de1..006cafec 100644 --- a/makefu/2configs/systemdultras/ircbot.nix +++ b/makefu/2configs/systemdultras/ircbot.nix @@ -1,5 +1,11 @@ -{ +{ pkgs, ... }: { systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG"; + systemd.services.restart-brockman = { + after = [ "brockman.service" ]; + wantedBy = [ "multi-user.target" ]; + startAt = "daily"; + script = "${pkgs.systemd}/bin/systemctl try-restart brockman.service"; + }; krebs.brockman = { enable = true; config = { -- cgit v1.2.3 From c0cc625a9f005352b8bb4857af09989865ed6ffd Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 13:17:43 +0200 Subject: ma tools/extra-gui: add vscode --- makefu/2configs/tools/extra-gui.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/tools/extra-gui.nix b/makefu/2configs/tools/extra-gui.nix index aae00b97..5a29eea8 100644 --- a/makefu/2configs/tools/extra-gui.nix +++ b/makefu/2configs/tools/extra-gui.nix @@ -17,5 +17,6 @@ gitAndTools.gitFull signal-desktop # rambox + vscode ]; } -- cgit v1.2.3 From 5bf33d683cbf6f43599ae97aa1c56b1fd0d7d3f3 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 15 May 2021 14:03:43 +0200 Subject: ma gum: disable social-to-irc, fix import for omo --- makefu/2configs/bgt/social-to-irc.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/bgt/social-to-irc.nix b/makefu/2configs/bgt/social-to-irc.nix index ac4c6cad..8e81f9b5 100644 --- a/makefu/2configs/bgt/social-to-irc.nix +++ b/makefu/2configs/bgt/social-to-irc.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { systemd.services.brockman.environment."BROCKMAN_LOG_LEVEL" = "DEBUG"; systemd.services.restart-brockman = { -- cgit v1.2.3