diff options
Diffstat (limited to 'makefu')
69 files changed, 1546 insertions, 1403 deletions
diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index d0ba1a3c6..f65c6672b 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -82,8 +82,12 @@ in { # ci # <stockholm/makefu/2configs/exim-retiolum.nix> <stockholm/makefu/2configs/git/cgit-retiolum.nix> + + ###### Shack ##### # <stockholm/makefu/2configs/shack/events-publisher> - <stockholm/makefu/2configs/shack/gitlab-runner> + # <stockholm/makefu/2configs/shack/gitlab-runner> + + <stockholm/makefu/2configs/remote-build/slave.nix> <stockholm/makefu/2configs/remote-build/aarch64-community.nix> <stockholm/makefu/2configs/taskd.nix> diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index dd89b4057..a9e307ddf 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -47,6 +47,7 @@ in { # <stockholm/makefu/2configs/legacy_only.nix> <stockholm/makefu/2configs/share/omo.nix> + <stockholm/makefu/2configs/share/gum-client.nix> <stockholm/makefu/2configs/dcpp/airdcpp.nix> { krebs.airdcpp.dcpp.shares = let d = path: "/media/cryptX/${path}"; @@ -91,7 +92,6 @@ in { <stockholm/makefu/2configs/bluetooth-mpd.nix> <stockholm/makefu/2configs/ham> - <stockholm/makefu/2configs/ham/zigbee2mqtt> { makefu.ps3netsrv = { enable = true; diff --git a/makefu/1systems/sdev/config.nix b/makefu/1systems/sdev/config.nix index e3c59e181..d02c30342 100644 --- a/makefu/1systems/sdev/config.nix +++ b/makefu/1systems/sdev/config.nix @@ -37,10 +37,11 @@ passwdqc-utils gnupg populate - (pkgs.writeScriptBin "tor-browser" '' - #! /bin/sh - TOR_SKIP_LAUNCH=1 ${torbrowser}/bin/tor-browser - '') + # 20.09: torbrowser is broken + #(pkgs.writeScriptBin "tor-browser" '' + # #! /bin/sh + # TOR_SKIP_LAUNCH=1 ${torbrowser}/bin/tor-browser + #'') ]; networking.firewall.allowedTCPPorts = [ diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix index 77c9ddc81..4abc7d345 100644 --- a/makefu/2configs/bgt/download.binaergewitter.de.nix +++ b/makefu/2configs/bgt/download.binaergewitter.de.nix @@ -17,12 +17,14 @@ in { PasswordAuthentication no ''; }; + users.users.auphonic = { uid = genid "auphonic"; group = "nginx"; useDefaultShell = true; openssh.authorizedKeys.keys = [ ident config.krebs.users.makefu.pubkey ]; }; + services.logrotate = { enable = true; config = '' @@ -36,6 +38,12 @@ in { } ''; }; + + # 20.09 unharden nginx to write logs + systemd.services.nginx.serviceConfig.ReadWritePaths = [ + "/var/spool/nginx/logs/" + ]; + services.nginx = { appendHttpConfig = '' types { @@ -55,15 +63,4 @@ in { ''; }; }; - environment.etc."netdata/python.d/web_log.conf".text = '' - nginx_log3: - name: 'nginx' - path: '/var/spool/nginx/logs/access.log' - nginx_log4: - name: 'bgt' - path: '${bgtaccess}' - ''; - - users.users.netdata.extraGroups = [ "nginx" ]; - } diff --git a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix index b9aa710c3..f4c10adc8 100644 --- a/makefu/2configs/bureautomation/automation/bureau-shutdown.nix +++ b/makefu/2configs/bureautomation/automation/bureau-shutdown.nix @@ -1,84 +1,87 @@ -[ - { alias = "Turn on Fernseher on group home"; - trigger = { - platform = "state"; - entity_id = "group.team"; - from = "not_home"; - to = "home"; - for.seconds = 30; - }; - action = [ - { - service = "homeassistant.turn_on"; - entity_id = [ - "switch.fernseher" - "switch.feuer" - ]; - } - { - service = "media_player.kodi_call_method"; - data = { - entity_id = "media_player.kodi"; - method = "Player.Open"; - item.partymode = "music"; - }; - } - { - service = "notify.telegrambot"; - data = { - title = "Bureau Startup"; - message = "Das Büro wurde eröffnet"; - }; - } - ]; - } - { alias = "Turn off Fernseher after last in group left"; - trigger = [ - { # trigger when movement was detected at the time +{ + services.home-assistant.config.automation = + [ + { alias = "Turn on Fernseher on group home"; + trigger = { platform = "state"; entity_id = "group.team"; - from = "home"; - to = "not_home"; - } - { # trigger at 18:00 no matter what - # to avoid 'everybody left before 18:00:00' - platform = "time"; - at = "18:00:00"; - } - ]; - action = [ - { - service = "homeassistant.turn_off"; - entity_id = [ - "switch.fernseher" - "switch.feuer" - "light.status_felix" - "light.status_daniel" - ]; - } - { - service = "notify.telegrambot"; - data_template = { - title = "Bureau Shutdown"; - message = "All devices are turned off due to {{ trigger.platform }}"; - }; - } - ]; - condition = - { condition = "and"; - conditions = [ + from = "not_home"; + to = "home"; + for.seconds = 30; + }; + action = [ + { + service = "homeassistant.turn_on"; + entity_id = [ + "switch.fernseher" + "switch.feuer" + ]; + } { - condition = "time"; - before = "06:30:00"; #only turn off between 6:30 and 18:00 - after = "18:00:00"; - # weekday = [ "mon" "tue" "wed" "thu" "fri" ]; + service = "media_player.kodi_call_method"; + data = { + entity_id = "media_player.kodi"; + method = "Player.Open"; + item.partymode = "music"; + }; } - { # if anybody is still there - condition = "state"; + { + service = "notify.telegrambot"; + data = { + title = "Bureau Startup"; + message = "Das Büro wurde eröffnet"; + }; + } + ]; + } + { alias = "Turn off Fernseher after last in group left"; + trigger = [ + { # trigger when movement was detected at the time + platform = "state"; entity_id = "group.team"; - state = "not_home"; + from = "home"; + to = "not_home"; + } + { # trigger at 18:00 no matter what + # to avoid 'everybody left before 18:00:00' + platform = "time"; + at = "18:00:00"; } ]; - }; - } -] + action = [ + { + service = "homeassistant.turn_off"; + entity_id = [ + "switch.fernseher" + "switch.feuer" + "light.status_felix" + "light.status_daniel" + ]; + } + { + service = "notify.telegrambot"; + data_template = { + title = "Bureau Shutdown"; + message = "All devices are turned off due to {{ trigger.platform }}"; + }; + } + ]; + condition = + { condition = "and"; + conditions = [ + { + condition = "time"; + before = "06:30:00"; #only turn off between 6:30 and 18:00 + after = "18:00:00"; + # weekday = [ "mon" "tue" "wed" "thu" "fri" ]; + } + { # if anybody is still there + condition = "state"; + entity_id = "group.team"; + state = "not_home"; + } + ]; + }; + } + ]; +} diff --git a/makefu/2configs/bureautomation/automation/hass-restart.nix b/makefu/2configs/bureautomation/automation/hass-restart.nix index be16f6966..3b3ce0599 100644 --- a/makefu/2configs/bureautomation/automation/hass-restart.nix +++ b/makefu/2configs/bureautomation/automation/hass-restart.nix @@ -1,31 +1,34 @@ -[ - { alias = "State on HA start-up"; - trigger = { - platform = "homeassistant"; - event = "start"; - }; - action = [ - # Startup State - { service = "mqtt.publish"; - data = { - topic = "/bam/sonoffs/cmnd/state"; - payload = ""; - }; - } - # Firmware Version - { service = "mqtt.publish"; - data = { - topic = "/bam/sonoffs/cmnd/status"; - payload = "2"; - }; - } - # Will trigger restart of all devices! - #{ service = "mqtt.publish"; - # data = { - # topic = "sonoffs/cmnd/SetOption59"; # configure sending state on power change - # payload = "1"; - # }; - #} - ]; - } -] +{ + services.home-assistant.config.automation = + [ + { alias = "State on HA start-up"; + trigger = { + platform = "homeassistant"; + event = "start"; + }; + action = [ + # Startup State + { service = "mqtt.publish"; + data = { + topic = "/bam/sonoffs/cmnd/state"; + payload = ""; + }; + } + # Firmware Version + { service = "mqtt.publish"; + data = { + topic = "/bam/sonoffs/cmnd/status"; + payload = "2"; + }; + } + # Will trigger restart of all devices! + #{ service = "mqtt.publish"; + # data = { + # topic = "sonoffs/cmnd/SetOption59"; # configure sending state on power change + # payload = "1"; + # }; + #} + ]; + } + ]; +} diff --git a/makefu/2configs/bureautomation/automation/nachtlicht.nix b/makefu/2configs/bureautomation/automation/nachtlicht.nix index ec6fa20c7..ade89418d 100644 --- a/makefu/2configs/bureautomation/automation/nachtlicht.nix +++ b/makefu/2configs/bureautomation/automation/nachtlicht.nix @@ -1,35 +1,38 @@ -[ - # TODO: trigger if it is before dusk and somebody arives but nachtlichter are - # off from last day - # TODO: do not have nachtlicht turned on at night - { - alias = "Turn on Nachtlicht at dusk"; # when it gets dim - trigger = - { platform = "numeric_state"; - entity_id = "sun.sun"; - value_template = "{{ state.attributes.elevation }}"; - below = 10; +{ + services.home-assistant.config.automation = + [ + # TODO: trigger if it is before dusk and somebody arives but nachtlichter are + # off from last day + # TODO: do not have nachtlicht turned on at night + { + alias = "Turn on Nachtlicht at dusk"; # when it gets dim + trigger = + { platform = "numeric_state"; + entity_id = "sun.sun"; + value_template = "{{ state.attributes.elevation }}"; + below = 10; - }; - action = - { service = "homeassistant.turn_on"; - entity_id = [ "group.nachtlicht" ]; - }; - } - { - alias = "Turn off Nachtlicht at dawn"; - trigger = - { platform = "sun"; - event = "sunrise"; - offset = "01:30:00"; # on dawn - }; - # TODO: when somebody is still in the buero - # condition = - #{ - #}; - action = - { service = "homeassistant.turn_off"; - entity_id = [ "group.nachtlicht" ]; - }; - } -] + }; + action = + { service = "homeassistant.turn_on"; + entity_id = [ "group.nachtlicht" ]; + }; + } + { + alias = "Turn off Nachtlicht at dawn"; + trigger = + { platform = "sun"; + event = "sunrise"; + offset = "01:30:00"; # on dawn + }; + # TODO: when somebody is still in the buero + # condition = + #{ + #}; + action = + { service = "homeassistant.turn_off"; + entity_id = [ "group.nachtlicht" ]; + }; + } + ]; +} diff --git a/makefu/2configs/bureautomation/automation/schlechteluft.nix b/makefu/2configs/bureautomation/automation/schlechteluft.nix index 370334743..ea1d44515 100644 --- a/makefu/2configs/bureautomation/automation/schlechteluft.nix +++ b/makefu/2configs/bureautomation/automation/schlechteluft.nix @@ -1,71 +1,75 @@ let long_threshold = 30; -in [ - { - alias = "Bad Air Alarm 60 seconds"; - trigger = - { platform = "numeric_state"; - entity_id = "sensor.air_quality"; - above = 1523; - for.seconds = 60; - }; - condition = { - condition = "and"; - conditions = [ - { condition = "state"; - entity_id = "group.team"; - state = "home"; - } - { condition = "time"; - after = "06:00:00"; - before = "20:00:00"; +in +{ + services.home-assistant.config.automation = + [ + { + alias = "Bad Air Alarm 60 seconds"; + trigger = + { platform = "numeric_state"; + entity_id = "sensor.air_quality"; + above = 1523; + for.seconds = 60; + }; + condition = { + condition = "and"; + conditions = [ + { condition = "state"; + entity_id = "group.team"; + state = "home"; + } + { condition = "time"; + after = "06:00:00"; + before = "20:00:00"; + } + ]; + }; + + action = [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.schlechteluft" + ]; } ]; - }; - - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.schlechteluft" + } + { + alias = "Bad Air Alarm ${toString long_threshold} Minutes"; + trigger = + { platform = "numeric_state"; + entity_id = "sensor.air_quality"; + above = 1523; + for.minutes = long_threshold; + }; + condition = { + condition = "and"; + conditions = [ + { condition = "state"; + entity_id = "group.team"; + state = "home"; + } + { condition = "time"; + after = "06:00:00"; + before = "20:00:00"; + } |