From 1e4658d0aef7b0cb5f889d3b66e35853730a942a Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 19:32:27 +0100 Subject: switch to 20.09 --- krebs/nixpkgs.json | 6 +++--- krebs/update-nixpkgs.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 161a099e5..1f60931c6 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "7c2a362b58a1c2ba72d24aa3869da3b1a91d39e1", - "date": "2020-10-20T09:32:31+02:00", - "sha256": "0gl4xndyahasa9dv5mi3x9w8s457wl2xh9lcldizcn1irjvkrzs4", + "rev": "95d26c9a9f2a102e25cf318a648de44537f42e09", + "date": "2020-10-24T10:37:53+02:00", + "sha256": "0ymhj252dq7z2ajdjsdz99h106ylm4vsmz5v3xiwsylcs4bz2nl8", "fetchSubmodules": false } diff --git a/krebs/update-nixpkgs.sh b/krebs/update-nixpkgs.sh index b0ffb6adc..9a0ea7ed4 100755 --- a/krebs/update-nixpkgs.sh +++ b/krebs/update-nixpkgs.sh @@ -3,7 +3,7 @@ dir=$(dirname $0) oldrev=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/') nix-shell -p nix-prefetch-git --run 'nix-prefetch-git \ --url https://github.com/NixOS/nixpkgs \ - --rev refs/heads/nixos-20.03' \ + --rev refs/heads/nixos-20.09' \ > $dir/nixpkgs.json newrev=$(cat $dir/nixpkgs.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/') git commit $dir/nixpkgs.json -m "nixpkgs: $oldrev -> $newrev" -- cgit v1.3.1 From 26342f9bbbfab2ded2c03f11346094fa8d6971d1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 19:40:50 +0100 Subject: l morpheus.r: use new luks devices config --- lass/1systems/morpheus/physical.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lass/1systems/morpheus/physical.nix b/lass/1systems/morpheus/physical.nix index 3fb03cda4..6e59a2273 100644 --- a/lass/1systems/morpheus/physical.nix +++ b/lass/1systems/morpheus/physical.nix @@ -34,10 +34,7 @@ }; boot.initrd.luks = { cryptoModules = [ "aes" "sha512" "sha1" "xts" ]; - devices = [{ - name = "luksroot"; - device = "/dev/nvme0n1p3"; - }]; + devices.luksroot.device = "/dev/nvme0n1p3"; }; services.udev.extraRules = '' -- cgit v1.3.1 From de124026ab74fa9a3611e7fd6cdf54ad2273b79a Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 19:47:38 +0100 Subject: remove deprecated dcso vpn --- lass/2configs/dcso-vpn.nix | 44 ---------------------- lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem | 0 lass/2configs/tests/dummy-secrets/dcsovpn/cert.key | 0 lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem | 0 .../2configs/tests/dummy-secrets/dcsovpn/login.txt | 0 5 files changed, 44 deletions(-) delete mode 100644 lass/2configs/dcso-vpn.nix delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/cert.key delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/login.txt diff --git a/lass/2configs/dcso-vpn.nix b/lass/2configs/dcso-vpn.nix deleted file mode 100644 index 0a5623bf0..000000000 --- a/lass/2configs/dcso-vpn.nix +++ /dev/null @@ -1,44 +0,0 @@ -with import ; -{ ... }: - -{ - - users.extraUsers = { - dcsovpn = rec { - name = "dcsovpn"; - uid = genid "dcsovpn"; - description = "user for running dcso openvpn"; - home = "/home/${name}"; - }; - }; - - users.extraGroups.dcsovpn.gid = genid "dcsovpn"; - - services.openvpn.servers = { - dcso = { - config = '' - client - dev tun - tun-mtu 1356 - mssfix - proto udp - float - remote 217.111.55.41 1194 - nobind - user dcsovpn - group dcsovpn - persist-key - persist-tun - ca ${toString } - cert ${toString } - key ${toString } - verb 3 - mute 20 - auth-user-pass ${toString } - route-method exe - route-delay 2 - ''; - updateResolvConf = true; - }; - }; -} diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem b/lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/cert.key b/lass/2configs/tests/dummy-secrets/dcsovpn/cert.key deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem b/lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/login.txt b/lass/2configs/tests/dummy-secrets/dcsovpn/login.txt deleted file mode 100644 index e69de29bb..000000000 -- cgit v1.3.1 From 80d1d762d91c2bbebc495a4c1633d0026b278272 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 19:50:50 +0100 Subject: nixpkgs: 95d26c9 -> 13d0c31 --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 1f60931c6..72f85ab3a 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "95d26c9a9f2a102e25cf318a648de44537f42e09", - "date": "2020-10-24T10:37:53+02:00", - "sha256": "0ymhj252dq7z2ajdjsdz99h106ylm4vsmz5v3xiwsylcs4bz2nl8", + "rev": "13d0c311e3ae923a00f734b43fd1d35b47d8943a", + "date": "2020-10-27T08:58:28+01:00", + "sha256": "0izp5y55whbdaf26w3zy2xvkjvlll39lib1ifvb61ps9gmvlqn39", "fetchSubmodules": false } -- cgit v1.3.1 From cb24733b91e40d82b8fb5b39ff08be1b0f68c512 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 19:59:35 +0100 Subject: l uriel.r: use new luks devices config --- lass/1systems/uriel/physical.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/1systems/uriel/physical.nix b/lass/1systems/uriel/physical.nix index 2d21f00d5..82a088643 100644 --- a/lass/1systems/uriel/physical.nix +++ b/lass/1systems/uriel/physical.nix @@ -15,7 +15,7 @@ loader.systemd-boot.enable = true; loader.timeout = 5; - initrd.luks.devices = [ { name = "luksroot"; device = "/dev/sda2"; } ]; + initrd.luks.devices.luksroot.device = "/dev/sda2"; initrd.luks.cryptoModules = [ "aes" "sha512" "sha1" "xts" ]; initrd.availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ]; #kernelModules = [ "kvm-intel" "msr" ]; -- cgit v1.3.1 From 2871761a933c3c63faff0cf13fd10e679ce87093 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 20:20:12 +0100 Subject: l copyq: remove (broken) path extensions --- lass/2configs/copyq.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/lass/2configs/copyq.nix b/lass/2configs/copyq.nix index 56c091a6e..ed78699b0 100644 --- a/lass/2configs/copyq.nix +++ b/lass/2configs/copyq.nix @@ -25,9 +25,6 @@ in { environment = { DISPLAY = ":${toString config.services.xserver.display}"; }; - path = with pkgs; [ - qt5.full - ]; serviceConfig = { SyslogIdentifier = "copyq"; ExecStart = "${pkgs.copyq}/bin/copyq"; -- cgit v1.3.1 From 4ed62e280e52ce373c6f1a9c44c5d365c24f572c Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 20:23:33 +0100 Subject: l icarus.r shodan.r: remove borken ssh-cryptsetup --- lass/1systems/icarus/config.nix | 1 - lass/1systems/shodan/config.nix | 2 -- 2 files changed, 3 deletions(-) diff --git a/lass/1systems/icarus/config.nix b/lass/1systems/icarus/config.nix index 8332e7c53..609da6011 100644 --- a/lass/1systems/icarus/config.nix +++ b/lass/1systems/icarus/config.nix @@ -19,7 +19,6 @@ with import ; # - ]; diff --git a/lass/1systems/shodan/config.nix b/lass/1systems/shodan/config.nix index e41c9bd1e..9e01396bc 100644 --- a/lass/1systems/shodan/config.nix +++ b/lass/1systems/shodan/config.nix @@ -15,8 +15,6 @@ with import ; - - -- cgit v1.3.1 From 39f58ebd9a9b69ea11ec6fb432391ce661249dc2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 20:36:32 +0100 Subject: l domsen: remove obsolete nextcloud nginx --- lass/2configs/websites/domsen.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index a177a0228..0714d9374 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -97,7 +97,6 @@ in { overwriteProtocol = "https"; }; https = true; - nginx.enable = true; }; services.nginx.virtualHosts."o.xanf.org" = { enableACME = true; -- cgit v1.3.1 From fbbee5daca66332179e1efed442764b26718cfbe Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 27 Oct 2020 20:38:44 +0100 Subject: l websites: fix acme issues --- lass/2configs/websites/lassulus.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix index 74585a6f8..17df71310 100644 --- a/lass/2configs/websites/lassulus.nix +++ b/lass/2configs/websites/lassulus.nix @@ -16,7 +16,6 @@ in { email = "acme@lassul.us"; acceptTerms = true; certs."lassul.us" = { - allowKeysForGroup = true; group = "lasscert"; }; }; @@ -78,7 +77,6 @@ in { email = "lassulus@lassul.us"; webroot = "/var/lib/acme/acme-challenge"; group = "nginx"; - user = "nginx"; }; -- cgit v1.3.1 From 239ff32905f60d6ef55e2fdb55fececd549da0b3 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 3 Nov 2020 18:57:46 +0100 Subject: reaktor2: 0.3.0 -> 0.4.0 --- krebs/5pkgs/haskell/reaktor2/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/5pkgs/haskell/reaktor2/default.nix b/krebs/5pkgs/haskell/reaktor2/default.nix index ae242efea..6a48f865c 100644 --- a/krebs/5pkgs/haskell/reaktor2/default.nix +++ b/krebs/5pkgs/haskell/reaktor2/default.nix @@ -6,13 +6,13 @@ , time, transformers, unagi-chan, unix, unordered-containers , vector, wai, warp }: -mkDerivation { +mkDerivation rec { pname = "reaktor2"; - version = "0.3.0"; + version = "0.4.0"; src = fetchgit { url = "https://cgit.krebsco.de/reaktor2"; - sha256 = "02hqpq8wcfd6rvi8qk10zy3f3lrzzqnjwqal4cbvksjn3vahz36h"; - rev = "a6893c00f78a8acd0a4bfe7da87ab6889eabcf21"; + sha256 = "0bnn23hjl57y0a5rf3h8kq078dziby7il7fandz5wh6s4i3psicp"; + rev = "v${version}"; fetchSubmodules = true; }; isLibrary = false; -- cgit v1.3.1 From bd1c82c769dea90c1171988a57fb71f715447379 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 3 Nov 2020 20:19:15 +0100 Subject: krebs: activate nscd again --- krebs/2configs/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/krebs/2configs/default.nix b/krebs/2configs/default.nix index 3442272ec..f56f6045a 100644 --- a/krebs/2configs/default.nix +++ b/krebs/2configs/default.nix @@ -43,7 +43,6 @@ with import ; ]; }; services.cron.enable = false; - services.nscd.enable = false; services.ntp.enable = false; users.mutableUsers = false; -- cgit v1.3.1 From 88b343292bf15269d1df3dd23198fa90c97ef485 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 3 Nov 2020 20:40:28 +0100 Subject: github-hosts-sync: fix deprecated user definition --- krebs/3modules/github-hosts-sync.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/github-hosts-sync.nix b/krebs/3modules/github-hosts-sync.nix index 0b7d56098..7d618ebfd 100644 --- a/krebs/3modules/github-hosts-sync.nix +++ b/krebs/3modules/github-hosts-sync.nix @@ -62,8 +62,8 @@ let }; }; - users.extraUsers = singleton { - inherit (user) name uid; + users.users.${user.name} = { + inherit (user) uid; home = cfg.dataDir; }; }; -- cgit v1.3.1 From 975138fc175e4d559e271beed52e8bf2ced47393 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 3 Nov 2020 20:56:36 +0100 Subject: reaktor2: disable stockholm issue cause lentil is broken --- krebs/2configs/reaktor2.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index b80198b03..473028f95 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -95,7 +95,7 @@ let } hooks.sed (generators.command_hook { - inherit (commands) hello random-emoji nixos-version stockholm-issue; + inherit (commands) hello random-emoji nixos-version; tell = { filename = "${pkgs.Reaktor.src}/reaktor/commands/tell-on_privmsg"; -- cgit v1.3.1 From 4e08eb5dffbfc9707633b6d30e200bb993185db2 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 3 Nov 2020 22:59:13 +0100 Subject: puyak.r,wolf.r: move all services from wolf to puyak --- krebs/1systems/puyak/config.nix | 79 +++++++++++++++++++++++++++++++++++- krebs/1systems/wolf/config.nix | 76 ---------------------------------- makefu/2configs/urlwatch/default.nix | 1 + 3 files changed, 79 insertions(+), 77 deletions(-) diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 08a3392bd..fb7d01e70 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -13,13 +13,90 @@ + ### shackspace + # handle the worlddomination map via coap + + + # drivedroid.shack for shackphone + + # + # Say if muell will be collected + + # provide muellshack api + + # provide light control api + + # light.shack web-ui + + # send mail if muell was not handled + + # send mail if muell was not handled + + # powerraw usb serial to mqtt and raw socket + + + { # do not log to /var/spool/log + services.nginx.appendHttpConfig = '' + map $request_method $loggable { + default 1; + GET 0; + } + log_format vhost '$host $remote_addr - $remote_user ' + '[$time_local] "$request" $status ' + '$body_bytes_sent "$http_referer" ' + '"$http_user_agent"'; + error_log stderr; + access_log syslog:server=unix:/dev/log vhost; + ''; + services.journald.rateLimitBurst = 10000; + } + + # create samba share for anonymous usage with the laser and 3d printer pc + + + # mobile.lounge.mpd.shack + + + # hass.shack + + + # connect to git.shackspace.de as group runner for rz + + + # Statistics collection and visualization + # # graphiteApi is broken and unused(hopefully) + ## Collect data from mqtt.shack and store in graphite database + + ## Collect radioactive data and put into graphite + + ## mqtt.shack + + ## influx.shack + + + ## Collect local statistics via collectd and send to collectd + + + + + # prometheus.shack + # + + # + # grafana.shack + + + # shackdns.shack + # replacement for leases.shack and shackles.shack + + + # monitoring: prometheus.shack - ## Collect local statistics via collectd and send to collectd diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 0160f9ebb..eff09630c 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -14,82 +14,6 @@ in - # handle the worlddomination map via coap - - - - # drivedroid.shack for shackphone - - # - # Say if muell will be collected - - # provide muellshack api - - # provide light control api - - # light.shack web-ui - - # send mail if muell was not handled - - # send mail if muell was not handled - - # powerraw usb serial to mqtt and raw socket - - - { # do not log to /var/spool/log - services.nginx.appendHttpConfig = '' - map $request_method $loggable { - default 1; - GET 0; - } - log_format vhost '$host $remote_addr - $remote_user ' - '[$time_local] "$request" $status ' - '$body_bytes_sent "$http_referer" ' - '"$http_user_agent"'; - error_log stderr; - access_log syslog:server=unix:/dev/log vhost; - ''; - services.journald.rateLimitBurst = 10000; - } - - # create samba share for anonymous usage with the laser and 3d printer pc - - - # mobile.lounge.mpd.shack - - - # hass.shack - - - # connect to git.shackspace.de as group runner for rz - - - # Statistics collection and visualization - # # graphiteApi is broken and unused(hopefully) - ## Collect data from mqtt.shack and store in graphite database - - ## Collect radioactive data and put into graphite - - ## mqtt.shack - - ## influx.shack - - - ## Collect local statistics via collectd and send to collectd - - - - - # prometheus.shack - # - - # - # grafana.shack - - - # shackdns.shack - # replacement for leases.shack and shackles.shack - # misc diff --git a/makefu/2configs/urlwatch/default.nix b/makefu/2configs/urlwatch/default.nix index 838c26278..5b059a3b2 100644 --- a/makefu/2configs/urlwatch/default.nix +++ b/makefu/2configs/urlwatch/default.nix @@ -34,6 +34,7 @@ in { https://pypi.python.org/simple/pyserial/ https://pypi.python.org/simple/semantic_version/ # weird shit + https://www.zigbee2mqtt.io/information/supported_adapters.html http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/ https://erdgeist.org/gitweb/opentracker/info/refs?service=git-upload-pack -- cgit v1.3.1 From fd0a2c3c309fd4d86d0c8b4e4472bf828954fd1f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 4 Nov 2020 08:51:34 +0100 Subject: wolf.r: re-add shack ssh keys --- krebs/1systems/wolf/config.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index eff09630c..0c95f4d13 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -14,9 +14,13 @@ in + #### shackspace services + # misc + + ]; # use your own binary cache, fallback use cache.nixos.org (which is used by -- cgit v1.3.1 From 696f6a534a7e193fa726692bcdeb968a68b61612 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 4 Nov 2020 23:01:50 +0100 Subject: puyak.r: cleanup imports --- krebs/1systems/puyak/config.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index fb7d01e70..827f984d6 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -79,11 +79,9 @@ - - # prometheus.shack - # - - # + ## netbox.shack: Netbox is disabled as nobody seems to be using it anyway + # + # grafana.shack -- cgit v1.3.1 From a23066a27e0c7c448912d71d0ece0c92420b3671 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 10:30:05 +0100 Subject: ma minimal: keep nscd enabled --- makefu/2configs/minimal.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/makefu/2configs/minimal.nix b/makefu/2configs/minimal.nix index 78a9dcfa6..445e6c577 100644 --- a/makefu/2configs/minimal.nix +++ b/makefu/2configs/minimal.nix @@ -82,5 +82,4 @@ "net.ipv6.conf.default.use_tempaddr" = 2; }; - services.nscd.enable = false; } -- cgit v1.3.1 From 4bd6d7a13c982b87f0792bc346ab2e9293f4adff Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Nov 2020 12:00:42 +0100 Subject: nscd-fix: RIP --- krebs/1systems/hotdog/config.nix | 1 - krebs/2configs/nscd-fix.nix | 24 ------------------------ lass/2configs/default.nix | 1 - 3 files changed, 26 deletions(-) delete mode 100644 krebs/2configs/nscd-fix.nix diff --git a/krebs/1systems/hotdog/config.nix b/krebs/1systems/hotdog/config.nix index bb84b1873..c0fa38284 100644 --- a/krebs/1systems/hotdog/config.nix +++ b/krebs/1systems/hotdog/config.nix @@ -12,7 +12,6 @@ - ]; diff --git a/krebs/2configs/nscd-fix.nix b/krebs/2configs/nscd-fix.nix deleted file mode 100644 index 8e5909e72..000000000 --- a/krebs/2configs/nscd-fix.nix +++ /dev/null @@ -1,24 +0,0 @@ -with import ; -{ pkgs, ... }: let - - enable = versionOlderThan "19.03"; - - versionOlderThan = v: - compareVersions - (versions.majorMinor version) - (versions.majorMinor v) - == -1; - - warning = '' - Using custom services.nscd.config because - https://github.com/NixOS/nixpkgs/pull/50316 - ''; - -in - optionalAttrs enable (trace warning { - services.nscd.enable = mkForce true; - services.nscd.config = mkForce (readFile (pkgs.fetchurl { - url = https://raw.githubusercontent.com/arianvp/nixpkgs/1d5f4cb/nixos/modules/services/system/nscd.conf; - sha256 = "1jlddk38lyynjn51zx3xi1nc29ahajyh0qg48qbq6dqlsrn3wxqs"; - })); - }) diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index f59988b75..babcb51de 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -2,7 +2,6 @@ with import ; { config, pkgs, ... }: { imports = [ - ./binary-cache/client.nix ./backup.nix ./gc.nix -- cgit v1.3.1 From 27cf7317f21cba168b18b52fed45cba94a633db8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Nov 2020 12:14:53 +0100 Subject: alertmanager-bot-telegram: modSha -> vendorSha --- krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix b/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix index f0e221406..a84407457 100644 --- a/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix +++ b/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { sha256 = "09cciml1j8x76jpm2v5v6h2q6j1fkhsz1kswslmx8wl4wk40xgp4"; }; - modSha256 = "0nlnxkpcna7g7qslyz5i1619paw4jkb1ma4fgpsgvgx1spwrjm8h"; + vendorSha256 = "0nlnxkpcna7g7qslyz5i1619paw4jkb1ma4fgpsgvgx1spwrjm8h"; postInstall = '' install -D ./default.tmpl $out/templates/default.tmpl ''; -- cgit v1.3.1 From b12308aba18b523ea6f819bd9de98d7346ec19be Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Nov 2020 13:20:33 +0100 Subject: ma minimal: activate nscd again --- makefu/2configs/minimal.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/makefu/2configs/minimal.nix b/makefu/2configs/minimal.nix index 78a9dcfa6..d4feb9980 100644 --- a/makefu/2configs/minimal.nix +++ b/makefu/2configs/minimal.nix @@ -81,6 +81,4 @@ "net.ipv6.conf.all.use_tempaddr" = 2; "net.ipv6.conf.default.use_tempaddr" = 2; }; - - services.nscd.enable = false; } -- cgit v1.3.1 From f36fd9b46ffe1898792b59709efffcce43d468e2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Nov 2020 16:38:42 +0100 Subject: jeschli: disable most hosts in ci --- krebs/3modules/jeschli/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/krebs/3modules/jeschli/default.nix b/krebs/3modules/jeschli/default.nix index 75d7eda6e..390f7585f 100644 --- a/krebs/3modules/jeschli/default.nix +++ b/krebs/3modules/jeschli/default.nix @@ -12,6 +12,7 @@ with import ; in { hosts = mapAttrs hostDefaults { brauerei = { + ci = false; nets = { retiolum = { ip4.addr = "10.243.27.29"; @@ -93,6 +94,7 @@ in { }; bolide = { + ci = false; nets = { retiolum = { ip4.addr = "10.243.27.31"; @@ -130,6 +132,7 @@ in { }; reagenzglas = { + ci = false; nets = { retiolum = { ip4.addr = "10.243.27.32"; -- cgit v1.3.1 From 34ac9e7143658b4edfcfc3a8930614005a30bf90 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 5 Nov 2020 16:56:27 +0100 Subject: filebitch.r: fix luks devices syntax --- .../1systems/filebitch/hardware-configuration.nix | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/krebs/1systems/filebitch/hardware-configuration.nix b/krebs/1systems/filebitch/hardware-configuration.nix index 574618e39..1e7fa7872 100644 --- a/krebs/1systems/filebitch/hardware-configuration.nix +++ b/krebs/1systems/filebitch/hardware-configuration.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let byid = dev: "/dev/disk/by-id/" + dev; - keyFile = byid "usb-SMI_USB_DISK_AA08061700009650-0:0"; + keyFile = byid "usb-SMI_USB_DISK_AA08061700009650-0:0"; in { imports = @@ -19,7 +19,7 @@ in boot.tmpOnTmpfs = true; - boot.initrd.availableKernelModules = [ + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "usbhid" "sd_mod" "raid456" "usbhid" @@ -77,20 +77,18 @@ in networking.hostId = "54d97450"; # required for zfs use boot.initrd.luks.devices = let - usbkey = name: device: { - inherit name device keyFile; + usbkey = device: { + inherit device keyFile; keyFileSize = 2048; preLVM = true; }; - in [ - ((usbkey "swap" (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part2")) - // { allowDiscards = true; } ) - ((usbkey "root" (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part3")) - // { allowDiscards = true; } ) - (usbkey "125" "/dev/md125") - (usbkey "126" "/dev/md126") - (usbkey "127" "/dev/md127") - ]; - - + in { + swap = ((usbkey (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part2")) + // { allowDiscards = true; } ); + root = ((usbkey (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part3")) + // { allowDiscards = true; } ); + md125 = usbkey "/dev/md125"; + md126 = usbkey "/dev/md126"; + md127 = usbkey "/dev/md127"; + }; } -- cgit v1.3.1 From 9919cb25912dfcc50881239f95494dd2f8e7b858 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 22:14:09 +0100 Subject: puyak.r: initrd bootstrapping via tor --- krebs/1systems/puyak/config.nix | 6 +++++ krebs/2configs/tor/initrd.nix | 50 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 krebs/2configs/tor/initrd.nix diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 827f984d6..3357964ef 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -7,12 +7,18 @@ + + ## initrd unlocking + # (brain hosts/puyak/luks-ssd;echo) | ssh root@$(brain krebs-secrets/puyak/initrd/hostname) 'cat > /crypt-ramfs/passphrase' + + + ### shackspace # handle the worlddomination map via coap diff --git a/krebs/2configs/tor/initrd.nix b/krebs/2configs/tor/initrd.nix new file mode 100644 index 000000000..cb6008f73 --- /dev/null +++ b/krebs/2configs/tor/initrd.nix @@ -0,0 +1,50 @@ +{config, pkgs, ... }: +## unlock command: +# (brain hosts/puyak/luks-ssd;echo) | ssh root@$(brain krebs-secrets/puyak/initrd/hostname) 'cat > /crypt-ramfs/passphrase' +{ + boot.initrd.network.enable = true; + boot.initrd.network.ssh = { + enable = true; + port = 22; + authorizedKeys = [ + config.krebs.users.jeschli-brauerei.pubkey + config.krebs.users.lass.pubkey + config.krebs.users.lass-mors.pubkey + config.krebs.users.makefu.pubkey + config.krebs.users.tv.pubkey + ]; + hostECDSAKey = ; + }; + boot.initrd.availableKernelModules = [ "e1000e" ]; + + boot.initrd.secrets = { + "/etc/tor/onion/bootup" = ; + }; + + boot.initrd.extraUtilsCommands = '' + copy_bin_and_libs ${pkgs.tor}/bin/tor + ''; + + # start tor during boot process + boot.initrd.network.postCommands = let + torRc = (pkgs.writeText "tor.rc" '' + DataDirectory /etc/tor + SOCKSPort 127.0.0.1:9050 IsolateDestAddr + SOCKSPort 127.0.0.1:9063 + HiddenServiceDir /etc/tor/onion/bootup + HiddenServicePort 22 127.0.0.1:22 + ''); + in '' + echo "tor: preparing onion folder" + # have to do this otherwise tor does not want to start + chmod -R 700 /etc/tor + + echo "make sure localhost is up" + ip a a 127.0.0.1/8 dev lo + ip link set lo up + + echo "tor: starting tor" + tor -f ${torRc} --verify-config + tor -f ${torRc} & + ''; +} -- cgit v1.3.1 From 430dad522cfc6d19329c323e009f47dc0cdc9250 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 22:25:24 +0100 Subject: krebs dummy-secrets: add initrd --- krebs/0tests/data/secrets/initrd/host_ecdsa.pub | 0 krebs/0tests/data/secrets/initrd/host_ecdsa_key | 0 krebs/0tests/data/secrets/initrd/hostname | 0 krebs/0tests/data/secrets/initrd/hs_ed25519_public_key | 0 krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 krebs/0tests/data/secrets/initrd/host_ecdsa.pub create mode 100644 krebs/0tests/data/secrets/initrd/host_ecdsa_key create mode 100644 krebs/0tests/data/secrets/initrd/hostname create mode 100644 krebs/0tests/data/secrets/initrd/hs_ed25519_public_key create mode 100644 krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key diff --git a/krebs/0tests/data/secrets/initrd/host_ecdsa.pub b/krebs/0tests/data/secrets/initrd/host_ecdsa.pub new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/host_ecdsa_key b/krebs/0tests/data/secrets/initrd/host_ecdsa_key new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hostname b/krebs/0tests/data/secrets/initrd/hostname new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hs_ed25519_public_key b/krebs/0tests/data/secrets/initrd/hs_ed25519_public_key new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key b/krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key new file mode 100644 index 000000000..e69de29bb -- cgit v1.3.1 From 32b9762495f44c0869f623c569fcb1cbea03c486 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 11 Nov 2020 18:12:22 +0100 Subject: l: delete legacy secrets --- lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem | 0 lass/2configs/tests/dummy-secrets/dcsovpn/cert.key | 0 lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem | 0 lass/2configs/tests/dummy-secrets/dcsovpn/login.txt | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/cert.key delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem delete mode 100644 lass/2configs/tests/dummy-secrets/dcsovpn/login.txt diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem b/lass/2configs/tests/dummy-secrets/dcsovpn/ca.pem deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/cert.key b/lass/2configs/tests/dummy-secrets/dcsovpn/cert.key deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem b/lass/2configs/tests/dummy-secrets/dcsovpn/cert.pem deleted file mode 100644 index e69de29bb..000000000 diff --git a/lass/2configs/tests/dummy-secrets/dcsovpn/login.txt b/lass/2configs/tests/dummy-secrets/dcsovpn/login.txt deleted file mode 100644 index e69de29bb..000000000 -- cgit v1.3.1 From 2408e07fd303eb74648c785b84cca3fa82a490f5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 12 Nov 2020 22:54:33 +0100 Subject: nixpkgs: 13d0c31 -> 896270d --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 72f85ab3a..68d950208 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "13d0c311e3ae923a00f734b43fd1d35b47d8943a", - "date": "2020-10-27T08:58:28+01:00", - "sha256": "0izp5y55whbdaf26w3zy2xvkjvlll39lib1ifvb61ps9gmvlqn39", + "rev": "896270d629efd47d14972e96f4fbb79fc9f45c80", + "date": "2020-11-10T22:42:32+01:00", + "sha256": "0xmjjayg19wm6cn88sh724mrsdj6mgrql6r3zc0g4x9bx4y342p7", "fetchSubmodules": false } -- cgit v1.3.1 From 5e6f56889580d4e2924491a7f471d7994b35212f Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 12 Nov 2020 10:28:14 +0100 Subject: puyak,wolf: add documentation for imports update share --- krebs/1systems/puyak/config.nix | 20 ++++++++++++-------- krebs/1systems/wolf/config.nix | 4 +++- krebs/2configs/shack/share.nix | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 3357964ef..0cadc3a10 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -27,20 +27,24 @@ # drivedroid.shack for shackphone # + # Say if muell will be collected - # provide muellshack api + # provide muellshack api: muell.shack - # provide light control api - - # light.shack web-ui - # send mail if muell was not handled - # send mail if muell was not handled - + + # provide light control api + # light.shack lounge.light.shack power.light.shack openhab.shack lightapi.shack + # light.shack web-ui + #light.shack + # powerraw usb serial to mqtt and raw socket - + # powerraw.shack standby.shack + # send power stats to s3 + # powerraw.shack must be available + { # do not log to /var/spool/log services.nginx.appendHttpConfig = '' diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 0c95f4d13..25e7c5f06 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -15,8 +15,10 @@ in #### shackspace services - + # wolf.shack + # gitlab runner + # misc diff --git a/krebs/2configs/shack/share.nix b/krebs/2configs/shack/share.nix index 465d6ef69..d8d65d309 100644 --- a/krebs/2configs/shack/share.nix +++ b/krebs/2configs/shack/share.nix @@ -37,6 +37,9 @@ # for legacy systems client min protocol = NT1 server min protocol = NT1 + workgroup = WORKGROUP + server string = ${config.networking.hostName} + netbios name = ${config.networking.hostName} ''; }; } -- cgit v1.3.1 From 3fdd49c0d4cafd6dcfcbffeb41441986a6331d8e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:22:52 +0100 Subject: ma omo.r: enable direct connect to gum share --- makefu/1systems/omo/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index dd89b4057..cbe97e28a 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -47,6 +47,7 @@ in { # + { krebs.airdcpp.dcpp.shares = let d = path: "/media/cryptX/${path}"; -- cgit v1.3.1 From 94b6aea2cd6af0454577bf3ba69cfdfd130f928b Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:31:17 +0100 Subject: ma bureautomation/kalauerbot: enterprise restart after 12h --- makefu/2configs/bureautomation/kalauerbot.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefu/2configs/bureautomation/kalauerbot.nix b/makefu/2configs/bureautomation/kalauerbot.nix index d61b8885e..ff045e2f3 100644 --- a/makefu/2configs/bureautomation/kalauerbot.nix +++ b/makefu/2configs/bureautomation/kalauerbot.nix @@ -12,6 +12,9 @@ WorkingDirectory = "/var/lib/kalauerbot"; ExecStart = "${pkgs.kalauerbot}/bin/kalauerbot"; PrivateTmp = true; + + Restart = "always"; + RuntimeMaxSec = "12h"; }; }; } -- cgit v1.3.1 From 4fb678f03f381b6bd0cda10a3c161dab8be5ed00 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:31:58 +0100 Subject: ma printer: use extraconfig for magicolor, new netconfig for lan devices --- makefu/2configs/printer.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index d297483b2..6fd1c1858 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -21,16 +21,20 @@ in { hardware.sane = { enable = true; extraBackends = [ ]; + netConf = + # drucker.lan SCX-3205W + '' + 192.168.1.6'' + # 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 # requires 'sane-extra', scan via: - #extraConfig."magicolor" = '' - # net 10.42.20.30 0x2098 - #''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf - extraConfig."xerox_mfp" = '' - tcp 192.168.1.5 - ''; #home printer SCX-3205W + extraConfig."magicolor" = '' + net 10.42.20.30 0x2098 + ''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf }; state = [ "/var/lib/cups" ]; } -- cgit v1.3.1 From 9323f9141ddd9824eacc8f718aa3ba49ea57b852 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:32:27 +0100 Subject: ma remote-build: enable gum for arm6l cross-build --- makefu/2configs/remote-build/gum.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/makefu/2configs/remote-build/gum.nix b/makefu/2configs/remote-build/gum.nix index 98e2e58b5..39e90f1b8 100644 --- a/makefu/2configs/remote-build/gum.nix +++ b/makefu/2configs/remote-build/gum.nix @@ -10,6 +10,14 @@ system = "x86_64-linux"; supportedFeatures = [ ]; } + { + hostName = "gum.krebsco.de"; + maxJobs = 8; + sshKey = toString ; + sshUser = "nixBuild"; + system = "armv6l-linux"; + supportedFeatures = [ ]; + } ]; }; } -- cgit v1.3.1 From 29c4df2d2228956b65f435cb1358d2f577119217 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:33:58 +0100 Subject: ma share/omo: set workgroup and netbios name --- makefu/2configs/share/omo.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makefu/2configs/share/omo.nix b/makefu/2configs/share/omo.nix index 732dc2036..1a488e69c 100644 --- a/makefu/2configs/share/omo.nix +++ b/makefu/2configs/share/omo.nix @@ -82,6 +82,9 @@ in { printing = bsd printcap name = /dev/null disable spoolss = yes + workgroup = WORKGROUP + server string = ${config.networking.hostName} + netbios name = ${config.networking.hostName} ''; }; } -- cgit v1.3.1 From b033dfd615db0334684f699731aa0064fcedf6e8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:35:30 +0100 Subject: ma urlwatch: watch zigbee2mqtt supported adapters --- makefu/2configs/urlwatch/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/urlwatch/default.nix b/makefu/2configs/urlwatch/default.nix index 5b059a3b2..ecd03710e 100644 --- a/makefu/2configs/urlwatch/default.nix +++ b/makefu/2configs/urlwatch/default.nix @@ -34,7 +34,9 @@ in { https://pypi.python.org/simple/pyserial/ https://pypi.python.org/simple/semantic_version/ # weird shit - https://www.zigbee2mqtt.io/information/supported_adapters.html + { url = "https://www.zigbee2mqtt.io/information/supported_adapters.html"; + filter = "html2text"; + } http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/ https://erdgeist.org/gitweb/opentracker/info/refs?service=git-upload-pack -- cgit v1.3.1 From a1ab1cde34c13cc0a1c78eee28835e22cdcc1794 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:36:10 +0100 Subject: ma wireguard/server: add workaround for failing tunnel behind nat --- makefu/2configs/wireguard/server.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makefu/2configs/wireguard/server.nix b/makefu/2configs/wireguard/server.nix index ae10f34a2..1b81cf57f 100644 --- a/makefu/2configs/wireguard/server.nix +++ b/makefu/2configs/wireguard/server.nix @@ -54,4 +54,10 @@ in { # wireguard server } ]; }; + # TODO: this issue is related to the router which connects to the host but is + # unable to re-connect once restarted + systemd.services.wireguard-wg0.serviceConfig = { + Restart = "always"; + RuntimeMaxSec = "12h"; + }; } -- cgit v1.3.1 From c743b9e53c4dfe2a39409c8bd01f373ce86b8e06 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:37:03 +0100 Subject: ma pkgs.droidcam: init software + kernel module --- makefu/2configs/hw/droidcam.nix | 7 ++++ makefu/5pkgs/droidcam/default.nix | 55 ++++++++++++++++++++++++++++++++ makefu/5pkgs/v4l2loopback-dc/default.nix | 36 +++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 makefu/2configs/hw/droidcam.nix create mode 100644 makefu/5pkgs/droidcam/default.nix create mode 100644 makefu/5pkgs/v4l2loopback-dc/default.nix diff --git a/makefu/2configs/hw/droidcam.nix b/makefu/2configs/hw/droidcam.nix new file mode 100644 index 000000000..c638123bb --- /dev/null +++ b/makefu/2configs/hw/droidcam.nix @@ -0,0 +1,7 @@ +{ pkgs, config, ... }: +{ + boot.extraModprobeConfig = "options v4l2loopback_dc width=640 height=480"; + boot.extraModulePackages = [ + (pkgs.callPackage ../../5pkgs/v4l2loopback-dc { kernel = config.boot.kernelPackages.kernel; }) + ]; +} diff --git a/makefu/5pkgs/droidcam/default.nix b/makefu/5pkgs/droidcam/default.nix new file mode 100644 index 000000000..d30fb01a6 --- /dev/null +++ b/makefu/5pkgs/droidcam/default.nix @@ -0,0 +1,55 @@ +{ stdenv, fetchFromGitHub +, pkg-config +, alsaLib +, libjpeg_turbo +, ffmpeg +, libusbmuxd +, speex +, gtk3 +, libappindicator-gtk3 +}: + +stdenv.mkDerivation rec { + pname = "droidcam"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "aramg"; + repo = "droidcam"; + rev = "v${version}"; + sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx"; + }; + + sourceRoot = "source/linux"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + alsaLib + libjpeg_turbo + ffmpeg + libusbmuxd + speex + gtk3 + libappindicator-gtk3 + ]; + + buildPhase = '' + runHook preBuild + make JPEG_DIR="" JPEG_INCLUDE="" JPEG_LIB="" JPEG="$(pkg-config --libs --cflags libturbojpeg)" + ''; + installPhase = '' + runHook preInstall + install -Dm755 "droidcam" "$out/bin/droidcam" + install -Dm755 "droidcam-cli" "$out/bin/droidcam-cli" + install -Dm644 icon2.png "$out/share/pixmaps/droidcam.png" + install -Dm644 README.md "$out/share/licenses/droidcam/LICENSE" + ''; + + meta = with stdenv.lib; { + description = "A kernel module to create V4L2 loopback devices"; + homepage = "https://github.com/aramg/droidcam"; + license = licenses.gpl2; + maintainers = [ maintainers.makefu ]; + platforms = platforms.linux; + }; +} diff --git a/makefu/5pkgs/v4l2loopback-dc/default.nix b/makefu/5pkgs/v4l2loopback-dc/default.nix new file mode 100644 index 000000000..2bb9d3d0b --- /dev/null +++ b/makefu/5pkgs/v4l2loopback-dc/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, kernel, kmod }: + +stdenv.mkDerivation rec { + name = "v4l2loopback-dc-${version}-${kernel.version}"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "aramg"; + repo = "droidcam"; + rev = "v${version}"; + sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx"; + }; + + sourceRoot = "source/linux/v4l2loopback"; + + buildTargets = "v4l2loopback-dc"; + hardeningDisable = [ "pic" ]; + + nativeBuildInputs = kernel.moduleBuildDependencies; + buildInputs = [ kmod ]; + + + makeFlags = [ + "KERNELRELEASE=${kernel.modDirVersion}" + "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=$(out)" + ]; + + meta = with stdenv.lib; { + description = "A kernel module to create V4L2 loopback devices"; + homepage = "https://github.com/aramg/droidcam"; + license = licenses.gpl2; + maintainers = [ maintainers.makefu ]; + platforms = platforms.linux; + }; +} -- cgit v1.3.1 From e824baec5ed0f42b6002632295ab241e9c7a80c7 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:37:51 +0100 Subject: ma pkgs.kalauerbot: use patched matrix-client --- makefu/5pkgs/kalauerbot/badsync.patch | 14 ++++++++++++++ makefu/5pkgs/kalauerbot/default.nix | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 makefu/5pkgs/kalauerbot/badsync.patch diff --git a/makefu/5pkgs/kalauerbot/badsync.patch b/makefu/5pkgs/kalauerbot/badsync.patch new file mode 100644 index 000000000..842129b94 --- /dev/null +++ b/makefu/5pkgs/kalauerbot/badsync.patch @@ -0,0 +1,14 @@ +diff --git a/matrix_client/client.py b/matrix_client/client.py +index af0e08f..f848c4f 100644 +--- a/matrix_client/client.py ++++ b/matrix_client/client.py +@@ -471,7 +471,7 @@ class MatrixClient(object): + self._sync(timeout_ms) + + def listen_forever(self, timeout_ms=30000, exception_handler=None, +- bad_sync_timeout=5): ++ bad_sync_timeout=61): + """ Keep listening for events forever. + + Args: + diff --git a/makefu/5pkgs/kalauerbot/default.nix b/makefu/5pkgs/kalauerbot/default.nix index 2cecbc3f2..ee90fdeec 100644 --- a/makefu/5pkgs/kalauerbot/default.nix +++ b/makefu/5pkgs/kalauerbot/default.nix @@ -8,7 +8,12 @@ rev = "08d98aa"; sha256 = "017hh61smgq4zsxd10brgwmykwgwabgllxjs31xayvs1hnqmkv2v"; }; propagatedBuildInputs = with python3.pkgs;[ - (callPackage ./python-matrixbot.nix {}) + (callPackage ./python-matrixbot.nix { + matrix-client = (stdenv.lib.overrideDerivation matrix-client (self: { + patches = [ ./badsync.patch ]; + })); + }) + (stdenv.lib.overrideDerivation googletrans (self: { patches = [ ./translate.patch ]; })) -- cgit v1.3.1 From c1b9374cf81e3e3a30f128d333ce36f43453e7b4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 16 Nov 2020 22:01:25 +0100 Subject: nixpkgs: 896270d -> f41c0fc --- krebs/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 68d950208..b21087764 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "896270d629efd47d14972e96f4fbb79fc9f45c80", - "date": "2020-11-10T22:42:32+01:00", - "sha256": "0xmjjayg19wm6cn88sh724mrsdj6mgrql6r3zc0g4x9bx4y342p7", + "rev": "f41c0fc7d8e49d94220f74495d4d702922df2a67", + "date": "2020-11-15T21:38:00-06:00", + "sha256": "01wim7ayn69y056q28ifw2f0mdypidpc0z15dda54aj5yy5vai09", "fetchSubmodules": false } -- cgit v1.3.1 From d1b32e88cbc5fb42e659331660c223284ac0426e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 22:15:04 +0100 Subject: ma sdev.r: disable torbrowser --- makefu/1systems/sdev/config.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 = [ -- cgit v1.3.1 From fcd6ae942df9f61120fc995f7889ec26e4bfb0ba Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 22:21:50 +0100 Subject: ma secrets/initrd: add new openssh_host_ecdsa_key --- krebs/0tests/data/secrets/initrd/openssh_host_ecdsa_key | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 krebs/0tests/data/secrets/initrd/openssh_host_ecdsa_key diff --git a/krebs/0tests/data/secrets/initrd/openssh_host_ecdsa_key b/krebs/0tests/data/secrets/initrd/openssh_host_ecdsa_key new file mode 100644 index 000000000..e69de29bb -- cgit v1.3.1 From a84ec5151b0c8824bfab226c8ebd0a32fbd20ddd Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 22:25:22 +0100 Subject: tor/initrd: use hostKeys instead of hostECDSAKey --- krebs/2configs/tor/initrd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/2configs/tor/initrd.nix b/krebs/2configs/tor/initrd.nix index cb6008f73..411588220 100644 --- a/krebs/2configs/tor/initrd.nix +++ b/krebs/2configs/tor/initrd.nix @@ -13,7 +13,7 @@ config.krebs.users.makefu.pubkey config.krebs.users.tv.pubkey ]; - hostECDSAKey = ; + hostKeys = [ ]; }; boot.initrd.availableKernelModules = [ "e1000e" ]; -- cgit v1.3.1 From 1183d847285093b9bd2cb6b8c40701473d0d081c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 22:41:11 +0100 Subject: shack/gitlab-runner: use upstream gitlab module --- krebs/2configs/shack/gitlab-runner.nix | 62 +++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/krebs/2configs/shack/gitlab-runner.nix b/krebs/2configs/shack/gitlab-runner.nix index bd391851a..ecb064579 100644 --- a/krebs/2configs/shack/gitlab-runner.nix +++ b/krebs/2configs/shack/gitlab-runner.nix @@ -1,24 +1,48 @@ -{ pkgs, ... }: -let - runner-src = builtins.fetchTarball { - url = "https://gitlab.com/arianvp/nixos-gitlab-runner/-/archive/master/nixos-gitlab-runner-master.tar.gz"; - sha256 = "1s0fy5ny2ygcfvx35xws8xz5ih4z4kdfqlq3r6byxpylw7r52fyi"; - }; -in +{ pkgs,lib, ... }: { - imports = [ - "${runner-src}/gitlab-runner.nix" - ]; - services.gitlab-runner2 = { + services.gitlab-runner = { enable = true; - ## registrationConfigurationFile contains: - # CI_SERVER_URL= - # REGISTRATION_TOKEN= - # RUNNER_TAG_LIST=nix,shacklan - # RUNNER_NAME=stockholm-runner-$name - registrationConfigFile = ; - #gracefulTermination = true; + services= { + # runner for building in docker via host's nix-daemon + # nix store will be readable in runner, might be insecure + nix = with lib;{ + # File should contain at least these two variables: + # `CI_SERVER_URL` + # `REGISTRATION_TOKEN` + registrationConfigFile = toString ; + dockerImage = "alpine"; + dockerVolumes = [ + "/nix/store:/nix/store:ro" + "/nix/var/nix/db:/nix/var/nix/db:ro" + "/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro" + ]; + dockerDisableCache = true; + preBuildScript = pkgs.writeScript "setup-container" '' + mkdir -p -m 0755 /nix/var/log/nix/drvs + mkdir -p -m 0755 /nix/var/nix/gcroots + mkdir -p -m 0755 /nix/var/nix/profiles + mkdir -p -m 0755 /nix/var/nix/temproots + mkdir -p -m 0755 /nix/var/nix/userpool + mkdir -p -m 1777 /nix/var/nix/gcroots/per-user + mkdir -p -m 1777 /nix/var/nix/profiles/per-user + mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root + mkdir -p -m 0700 "$HOME/.nix-defexpr" + . ${pkgs.nix}/etc/profile.d/nix.sh + ${pkgs.nix}/bin/nix-env -i ${concatStringsSep " " (with pkgs; [ nix cacert git openssh ])} + ${pkgs.nix}/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable + ${pkgs.nix}/bin/nix-channel --update nixpkgs + ''; + environmentVariables = { + ENV = "/etc/profile"; + USER = "root"; + NIX_REMOTE = "daemon"; + PATH = "/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin"; + NIX_SSL_CERT_FILE = "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"; + }; + tagList = [ "nix" "shacklan" ]; + }; + }; }; - systemd.services.gitlab-runner2.restartIfChanged = false; + systemd.services.gitlab-runner.restartIfChanged = false; systemd.services.docker.restartIfChanged = false; } -- cgit v1.3.1 From 414358df3cb25d004600628bd62be88c412f30d4 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 22:41:58 +0100 Subject: ma pkgs.navi: rip --- makefu/5pkgs/navi/default.nix | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 makefu/5pkgs/navi/default.nix diff --git a/makefu/5pkgs/navi/default.nix b/makefu/5pkgs/navi/default.nix deleted file mode 100644 index 1e8274f80..000000000 --- a/makefu/5pkgs/navi/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -# via https://git.ingolf-wagner.de/palo/nixos-config/src/master/pkgs/navi/default.nix - -{ rustPlatform, fetchFromGitHub, stdenv, fzf, makeWrapper, openssl, pkgconfig }: - -rustPlatform.buildRustPackage rec { - pname = "navi"; - version = "2.1.1"; - - src = fetchFromGitHub { - owner = "denisidoro"; - repo = "navi"; - rev = "v${version}"; - #rev = "${version}"; - sha256 = "1195f7c3ij2mkv0k1h9fwn6jkyjb01w0p6mj2xc39w5f6i0c0hwp"; - }; - - cargoSha256 = "0ks25w0dncaiw3ma05r8jrng3cczancrynnpgdksbvgz49lg3wjw"; - - postInstall = '' - mkdir -p $out/share/navi/ - mv shell $out/share/navi/ - - wrapProgram "$out/bin/navi" \ - --suffix "PATH" : "${fzf}/bin" - ''; - buildInputs = [ openssl ]; - nativeBuildInputs = [ makeWrapper pkgconfig ]; - - meta = with stdenv.lib; { - description = "An interactive cheatsheet tool for the command-line"; - homepage = "https://github.com/denisidoro/navi"; - license = licenses.asl20; - platforms = platforms.unix; - maintainers = with maintainers; [ mrVanDalo ]; - }; -} - -- cgit v1.3.1 From 53d23391b8d0094cd35ce687a1123a8714b78b65 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 23:09:30 +0100 Subject: gitlab-runner-shackspace: replaced by shack/gitlab-runner --- krebs/2configs/gitlab-runner-shackspace.nix | 33 ----------------------------- 1 file changed, 33 deletions(-) delete mode 100644 krebs/2configs/gitlab-runner-shackspace.nix diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix deleted file mode 100644 index f4247b6da..000000000 --- a/krebs/2configs/gitlab-runner-shackspace.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, ... }: -let - url = "https://git.shackspace.de/"; - # generate token from CI-token via: - ## gitlab-runner register - ## cat /etc/gitlab-runner/config.toml - token = import ; -in { - systemd.services.gitlab-runner.path = [ - "/run/wrappers" # /run/wrappers/bin/su - "/" # /bin/sh - ]; - systemd.services.gitlab-runner.serviceConfig.PrivateTmp = true; - virtualisation.docker.enable = true; - services.gitlab-runner = { - enable = true; - # configFile, configOptions and gracefulTimeout not yet in stable - # gracefulTimeout = "120min"; - configFile = pkgs.writeText "gitlab-runner.cfg" '' - concurrent = 1 - check_interval = 0 - - [[runners]] - name = "krebs-shell" - url = "${url}" - token = "${token}" - executor = "shell" - shell = "sh" - environment = ["PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"] - [runners.cache] - ''; - }; -} -- cgit v1.3.1 From 1fec69ac6b2ce44a9bc17ccffe8d4f1ed9e73fa6 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 08:58:38 +0100 Subject: ma krops: bump home-manager --- makefu/krops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/krops.nix b/makefu/krops.nix index 213af0497..2fa050e95 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -77,7 +77,7 @@ (lib.mkIf ( host-src.home-manager ) { home-manager.git = { url = https://github.com/rycee/home-manager; - ref = "cb17f1e"; + ref = "63f299b"; }; }) ]; -- cgit v1.3.1 From 299039549272f6c4df6d182de5fb6579b1e474c3 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 09:41:39 +0100 Subject: tor/initrd: fix typo in secrets-path --- krebs/2configs/tor/initrd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/2configs/tor/initrd.nix b/krebs/2configs/tor/initrd.nix index 411588220..98ed039b4 100644 --- a/krebs/2configs/tor/initrd.nix +++ b/krebs/2configs/tor/initrd.nix @@ -13,7 +13,7 @@ config.krebs.users.makefu.pubkey config.krebs.users.tv.pubkey ]; - hostKeys = [ ]; + hostKeys = [ ]; }; boot.initrd.availableKernelModules = [ "e1000e" ]; -- cgit v1.3.1 From 2fce838d369dfe4dfffc19830272daaba95e2dea Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 17 Nov 2020 19:09:55 +0100 Subject: tv: disable ci for all systems --- krebs/3modules/tv/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 6a09cc834..756caa03e 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -32,7 +32,7 @@ in { }; hosts = mapAttrs hostDefaults { alnus = { - ci = true; + ci = false; cores = 2; nets = { retiolum = { @@ -56,7 +56,7 @@ in { ssh.pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDP9JS2Nyjx4Pn+/4MrFi1EvBBYVKkGm2Q4lhgaAiSuiGLol53OSsL2KIo01mbcSSBWow9QpQpn8KDoRnT2aMLDrdTFqL20ztDLOXmtrSsz3flgCjmW4f6uOaoZF0RNjAybd1coqwSJ7EINugwoqOsg1zzN2qeIGKYFvqFIKibYFAnQ8hcksmkvPdIO5O8CbdIiP9sZSrSDp0ZyLK2T0PML2jensVZOeqSPulQDFqLsbmavpVLkpDjdzzPRwbZWNB4++YeipbYNOkX4GR1EB4wMZ93IbBV7kpJtib2Zb2AnUf7UW37hxWBjILdstj9ClwNOQggn8kD9ub7YxBzH1dz0Xd8a0mPOAWIDJz9MypXgFRc3vdvPB/W1I4Se0CLbgOkORun9CkgijKr9oEY8JNt8HFd6viZcAaQxOyIm6PNHZTnHfdSc7bIBS2n3e3IZBv0fTd77knGLXg402aTuu2bm/kxsKivxsILXIaGbeXe4ceN3Fynr3FzSM2bUkzHb0mAHu1BQ9YaX0xzCwjVueA5nzGls7ODSFkXsiBfg2FvMN/sTLFca6tnwyqcnD6nujoiS5+BxjDWPgnZYqCaW3B/IkpTsRMsX6QrfhOFcsP8qlJ2Cp82orWoDK/D0vZ9pdzAc6PFGga0RofuJKY2yiq+SRZ7/e9E6VncIVCYZ1OfN0Q=="; }; au = { - ci = true; + ci = false; cores = 4; nets = { retiolum = { @@ -83,7 +83,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsqDuhGJpjpqNv4QmjoOhcODObrPyY3GHLvtVkgXV0g root@au"; }; mu = { - ci = true; + ci = false; cores = 2; nets = { retiolum = { @@ -155,7 +155,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILGDdcKwFm6udU0/x6XGGb87k9py0VlrxF54HeYu9Izb"; }; nomic = { - ci = true; + ci = false; cores = 2; nets = { retiolum = { @@ -181,7 +181,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMIHmwXHV7E9UGuk4voVCADjlLkyygqNw054jvrsPn5t root@nomic"; }; wu = { - ci = true; + ci = false; cores = 4; nets = { retiolum = { @@ -207,7 +207,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcJvu8JDVzObLUtlAQg9qVugthKSfitwCljuJ5liyHa"; }; querel = { - ci = true; + ci = false; cores = 2; nets = { retiolum = { @@ -239,7 +239,7 @@ in { binary-cache = { pubkey = "xu-1:pYRENvaxZqGeImwLA9qHmRwHV4jfKaYx4u1VcZ31x0s="; }; - ci = true; + ci = false; cores = 4; nets = { retiolum = { @@ -266,7 +266,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPnjfceKuHNQu7S4eYFN1FqgzMqiL7haNZMh2ZLhvuhK root@xu"; }; zu = { - ci = true; + ci = false; cores = 4; nets = { retiolum = { -- cgit v1.3.1 From f911324c592ebd7809472a4100a8f6a6c83b0fe2 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 19:45:37 +0100 Subject: ma bam: remove dwd_pollen --- makefu/2configs/bureautomation/default.nix | 26 ++---------------- makefu/2configs/bureautomation/deps/dwd_pollen.nix | 32 ---------------------- 2 files changed, 2 insertions(+), 56 deletions(-) delete mode 100644 makefu/2configs/bureautomation/deps/dwd_pollen.nix diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index 9b33595f4..cd598f0aa 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -15,30 +15,8 @@ in { ]; networking.firewall.allowedTCPPorts = [ 8123 ]; state = [ "/var/lib/hass/known_devices.yaml" ]; - services.home-assistant = let - dwd_pollen = pkgs.fetchFromGitHub { - owner = "marcschumacher"; - repo = "dwd_pollen"; - rev = "0.1"; - sha256 = "1af2mx99gv2hk1ad53g21fwkdfdbymqcdl3jvzd1yg7dgxlkhbj1"; - }; - in { + services.home-assistant = { enable = true; - package = (pkgs.home-assistant.overrideAttrs (old: { - # TODO: find correct python package - installCheckPhase = '' - echo LOLLLLLLLLLLLLLL - ''; - postInstall = '' - cp -r ${dwd_pollen} $out/lib/python3.7/site-packages/homeassistant/components/dwd_pollen - ''; - })).override { - extraPackages = ps: with ps; [ - pkgs.picotts - python-forecastio jsonrpc-async jsonrpc-websocket mpd2 - (callPackage ./deps/openwrt-luci-rpc.nix { }) - ]; - }; autoExtraComponents = true; config = { config = {}; @@ -139,7 +117,7 @@ in { sensor = [] ++ [{ platform = "version"; }] # pyhaversion - ++ (import ./sensor/pollen.nix) + # ++ (import ./sensor/pollen.nix) ++ (import ./sensor/espeasy.nix) ++ (import ./sensor/airquality.nix) ++ ((import ./sensor/outside.nix) {inherit lib;}) diff --git a/makefu/2configs/bureautomation/deps/dwd_pollen.nix b/makefu/2configs/bureautomation/deps/dwd_pollen.nix deleted file mode 100644 index 39d9c3069..000000000 --- a/makefu/2configs/bureautomation/deps/dwd_pollen.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, python -, voluptuous -}: - -buildPythonPackage rec { - format = "other"; - pname = "dwd_pollen"; - version = "0.1"; - - src = fetchFromGitHub { - owner = "marcschumacher"; - repo = "dwd_pollen"; - rev = version; - sha256 = "1af2mx99gv2hk1ad53g21fwkdfdbymqcdl3jvzd1yg7dgxlkhbj1"; - }; - propagatedBuildInputs = [ - voluptuous - ]; - installPhase = '' - install -D -t $out/${python.sitePackages}/homeassistant/components/sensor/dwd_pollen * - ''; - - meta = with lib; { - description = "Home Assistant component to retrieve Pollen data from DWD (Germany)"; - homepage = https://github.com/marcschumacher/dwd_pollen; - license = licenses.mit; - maintainers = [ maintainers.makefu ]; - }; -} -- cgit v1.3.1 From 3f202e6ed5725935fb3737536558c28497152b23 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 20:03:10 +0100 Subject: shack/mqtt_sub: use python3 instead of 3.5 --- krebs/2configs/shack/mqtt_sub.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/2configs/shack/mqtt_sub.nix b/krebs/2configs/shack/mqtt_sub.nix index bd0b6df85..af2bc1e66 100644 --- a/krebs/2configs/shack/mqtt_sub.nix +++ b/krebs/2configs/shack/mqtt_sub.nix @@ -10,7 +10,7 @@ let sha256 = "1334jbbzlqizyp7zcn4hdswhhrnkj1p4p435n5nph82lzffrsi44"; }; buildInputs = [ - (pkgs.python35.withPackages (pythonPackages: with pythonPackages; [ + (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ docopt paho-mqtt ])) -- cgit v1.3.1 From a06144cc89556519ee5ede5c22fb02c9596cfaca Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 20:07:20 +0100 Subject: ma gum.r: disable gitlab-runner --- makefu/1systems/gum/config.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 # + + ###### Shack ##### # - + # + + -- cgit v1.3.1 From d20202b604371044a0ac2531462d0d3770e47c10 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 17 Nov 2020 20:10:21 +0100 Subject: Revert "tv: disable ci for all systems" This reverts commit 2fce838d369dfe4dfffc19830272daaba95e2dea. --- krebs/3modules/tv/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 756caa03e..6a09cc834 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -32,7 +32,7 @@ in { }; hosts = mapAttrs hostDefaults { alnus = { - ci = false; + ci = true; cores = 2; nets = { retiolum = { @@ -56,7 +56,7 @@ in { ssh.pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDP9JS2Nyjx4Pn+/4MrFi1EvBBYVKkGm2Q4lhgaAiSuiGLol53OSsL2KIo01mbcSSBWow9QpQpn8KDoRnT2aMLDrdTFqL20ztDLOXmtrSsz3flgCjmW4f6uOaoZF0RNjAybd1coqwSJ7EINugwoqOsg1zzN2qeIGKYFvqFIKibYFAnQ8hcksmkvPdIO5O8CbdIiP9sZSrSDp0ZyLK2T0PML2jensVZOeqSPulQDFqLsbmavpVLkpDjdzzPRwbZWNB4++YeipbYNOkX4GR1EB4wMZ93IbBV7kpJtib2Zb2AnUf7UW37hxWBjILdstj9ClwNOQggn8kD9ub7YxBzH1dz0Xd8a0mPOAWIDJz9MypXgFRc3vdvPB/W1I4Se0CLbgOkORun9CkgijKr9oEY8JNt8HFd6viZcAaQxOyIm6PNHZTnHfdSc7bIBS2n3e3IZBv0fTd77knGLXg402aTuu2bm/kxsKivxsILXIaGbeXe4ceN3Fynr3FzSM2bUkzHb0mAHu1BQ9YaX0xzCwjVueA5nzGls7ODSFkXsiBfg2FvMN/sTLFca6tnwyqcnD6nujoiS5+BxjDWPgnZYqCaW3B/IkpTsRMsX6QrfhOFcsP8qlJ2Cp82orWoDK/D0vZ9pdzAc6PFGga0RofuJKY2yiq+SRZ7/e9E6VncIVCYZ1OfN0Q=="; }; au = { - ci = false; + ci = true; cores = 4; nets = { retiolum = { @@ -83,7 +83,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsqDuhGJpjpqNv4QmjoOhcODObrPyY3GHLvtVkgXV0g root@au"; }; mu = { - ci = false; + ci = true; cores = 2; nets = { retiolum = { @@ -155,7 +155,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILGDdcKwFm6udU0/x6XGGb87k9py0VlrxF54HeYu9Izb"; }; nomic = { - ci = false; + ci = true; cores = 2; nets = { retiolum = { @@ -181,7 +181,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMIHmwXHV7E9UGuk4voVCADjlLkyygqNw054jvrsPn5t root@nomic"; }; wu = { - ci = false; + ci = true; cores = 4; nets = { retiolum = { @@ -207,7 +207,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcJvu8JDVzObLUtlAQg9qVugthKSfitwCljuJ5liyHa"; }; querel = { - ci = false; + ci = true; cores = 2; nets = { retiolum = { @@ -239,7 +239,7 @@ in { binary-cache = { pubkey = "xu-1:pYRENvaxZqGeImwLA9qHmRwHV4jfKaYx4u1VcZ31x0s="; }; - ci = false; + ci = true; cores = 4; nets = { retiolum = { @@ -266,7 +266,7 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPnjfceKuHNQu7S4eYFN1FqgzMqiL7haNZMh2ZLhvuhK root@xu"; }; zu = { - ci = false; + ci = true; cores = 4; nets = { retiolum = { -- cgit v1.3.1 From 9d99500e0922c5577c32bcb77f88d9edc472ffaa Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 20:16:19 +0100 Subject: ma hw/tp-x2x0: use utillinux instead of rfkill package --- makefu/2configs/hw/tp-x2x0.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index f4578bf77..b997a9eec 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -54,6 +54,6 @@ powerManagement.resumeCommands = '' - ${pkgs.rfkill}/bin/rfkill unblock all + ${pkgs.utillinux}/bin/rfkill unblock all ''; } -- cgit v1.3.1 From 064d51001d2daa17408fdf0311c763e05e0fe9c4 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 21:32:24 +0100 Subject: shack/glados: disable dwd_pollen --- krebs/2configs/shack/glados/default.nix | 19 +++------------ krebs/2configs/shack/glados/deps/dwd_pollen.nix | 32 ------------------------- 2 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 krebs/2configs/shack/glados/deps/dwd_pollen.nix diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index f47bca2db..04843cb24 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -21,23 +21,10 @@ in { ''; }; }; - services.home-assistant = let - dwd_pollen = pkgs.fetchFromGitHub { - owner = "marcschumacher"; - repo = "dwd_pollen"; - rev = "0.1"; - sha256 = "1af2mx99gv2hk1ad53g21fwkdfdbymqcdl3jvzd1yg7dgxlkhbj1"; - }; - in { + services.home-assistant = + { enable = true; - package = (pkgs.home-assistant.overrideAttrs (old: { # TODO: find correct python package - installCheckPhase = '' - echo LOLLLLLLLLLLLLLL - ''; - postInstall = '' - cp -r ${dwd_pollen} $out/lib/python3.7/site-packages/homeassistant/components/dwd_pollen - ''; - })).override { + package = pkgs.home-assistant.override { extraPackages = ps: with ps; [ python-forecastio jsonrpc-async jsonrpc-websocket mpd2 pkgs.picotts ]; diff --git a/krebs/2configs/shack/glados/deps/dwd_pollen.nix b/krebs/2configs/shack/glados/deps/dwd_pollen.nix deleted file mode 100644 index 39d9c3069..000000000 --- a/krebs/2configs/shack/glados/deps/dwd_pollen.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, python -, voluptuous -}: - -buildPythonPackage rec { - format = "other"; - pname = "dwd_pollen"; - version = "0.1"; - - src = fetchFromGitHub { - owner = "marcschumacher"; - repo = "dwd_pollen"; - rev = version; - sha256 = "1af2mx99gv2hk1ad53g21fwkdfdbymqcdl3jvzd1yg7dgxlkhbj1"; - }; - propagatedBuildInputs = [ - voluptuous - ]; - installPhase = '' - install -D -t $out/${python.sitePackages}/homeassistant/components/sensor/dwd_pollen * - ''; - - meta = with lib; { - description = "Home Assistant component to retrieve Pollen data from DWD (Germany)"; - homepage = https://github.com/marcschumacher/dwd_pollen; - license = licenses.mit; - maintainers = [ maintainers.makefu ]; - }; -} -- cgit v1.3.1 From 7750ce2befbff39121346df1a1ee4da964fe79a3 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 21:46:06 +0100 Subject: ma owncloud: disable memcached --- makefu/2configs/deployment/owncloud.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix index 317e0a29f..3a08b1f52 100644 --- a/makefu/2configs/deployment/owncloud.nix +++ b/makefu/2configs/deployment/owncloud.nix @@ -157,10 +157,9 @@ let error_reporting = E_ALL | E_STRICT html_errors = On date.timezone = "Europe/Berlin" - # extension=${pkgs.phpPackages.memcached}/lib/php/extensions/memcached.so extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - ''; + ''; # extension=${pkgs.phpPackages.memcached}/lib/php/extensions/memcached.so systemd.services."nextcloud-cron-${domain}" = { serviceConfig = { User = "nginx"; -- cgit v1.3.1 From b7944cf30af6f58752ad636a20dab1e077eb25be Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 21:56:13 +0100 Subject: puyak.r: disable newsbot for now waiting for brockman --- krebs/1systems/puyak/config.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 0cadc3a10..9ee61c6f8 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -14,12 +14,17 @@ + + ### Krebs ### + + #### NEWS #### - - + # + # + - ### shackspace + ### shackspace ### # handle the worlddomination map via coap -- cgit v1.3.1 From 9e6167a553991969205a041c4aef0ce871dba811 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 22:03:27 +0100 Subject: pkgs.alertmanager-bot-telegram: fix vendorSha256 --- krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix b/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix index a84407457..79a1740fd 100644 --- a/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix +++ b/krebs/5pkgs/simple/alertmanager-bot-telegram/default.nix @@ -11,7 +11,7 @@ buildGoModule rec { sha256 = "09cciml1j8x76jpm2v5v6h2q6j1fkhsz1kswslmx8wl4wk40xgp4"; }; - vendorSha256 = "0nlnxkpcna7g7qslyz5i1619paw4jkb1ma4fgpsgvgx1spwrjm8h"; + vendorSha256 = "1v0fgin8dn81b559zz4lqmrl7hikr46g4gb18sci4riql5qs1isj"; postInstall = '' install -D ./default.tmpl $out/templates/default.tmpl ''; -- cgit v1.3.1 From 60e1c9a6a7479dd588993eb55048cd3f1e711c01 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2020 22:23:05 +0100 Subject: ma owncloud: use php.buildEnv --- makefu/2configs/deployment/owncloud.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix index 3a08b1f52..af6592b2b 100644 --- a/makefu/2configs/deployment/owncloud.nix +++ b/makefu/2configs/deployment/owncloud.nix @@ -14,8 +14,18 @@ with lib; let + phpPackage = let + base = pkgs.php74; + in + base.buildEnv { + extensions = { enabled, all }: with all; + enabled ++ [ + apcu redis memcached imagick + ]; + }; + # TODO: copy-paste from lass/2/websites/util.nix - nextcloud = pkgs.nextcloud18; + nextcloud = pkgs.nextcloud20; serveCloud = domains: let domain = head domains; @@ -126,6 +136,7 @@ let services.phpfpm.pools."${domain}" = { user = "nginx"; group = "nginx"; + phpPackage = phpPackage; settings = { "listen.owner" = "nginx"; "pm" = "dynamic"; @@ -138,7 +149,7 @@ let "php_admin_flag[log_errors]" = "on"; "catch_workers_output" = true; }; - phpEnv."PATH" = lib.makeBinPath [ pkgs.php ]; + phpEnv."PATH" = lib.makeBinPath [ phpPackage ]; }; services.phpfpm.phpOptions = '' opcache.enable=1 @@ -149,7 +160,7 @@ let opcache.save_comments=1 opcache.revalidate_freq=1 opcache.file_cache = .opcache - zend_extension=${pkgs.php}/lib/php/extensions/opcache.so + zend_extension=${phpPackage}/lib/php/extensions/opcache.so display_errors = on display_startup_errors = on @@ -157,13 +168,15 @@ let error_reporting = E_ALL | E_STRICT html_errors = On date.timezone = "Europe/Berlin" - extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so - extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - ''; # extension=${pkgs.phpPackages.memcached}/lib/php/extensions/memcached.so + extension=${phpPackage}/lib/php/extensions/memcached.so + extension=${phpPackage}/lib/php/extensions/redis.so + extension=${phpPackage}/lib/php/extensions/apcu.so + ''; + systemd.services."nextcloud-cron-${domain}" = { serviceConfig = { User = "nginx"; - ExecStart = "${pkgs.php}/bin/php -f ${root}/cron.php"; + ExecStart = "${phpPackage}/bin/php -f ${root}/cron.php"; }; startAt = "*:0/15"; }; -- cgit v1.3.1 From ccb7655103ff13e1ed9bb7e85dbc2fd644b1e5f5 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 13:42:16 +0100 Subject: ma download.binaergewitter.de: fix for 20.09 --- makefu/2configs/bgt/download.binaergewitter.de.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix index 77c9ddc81..e3be6778f 100644 --- a/makefu/2configs/bgt/download.binaergewitter.de.nix +++ b/makefu/2configs/bgt/download.binaergewitter.de.nix @@ -36,6 +36,11 @@ in { } ''; }; + + # 20.09 unharden nginx to write logs + systemd.services.nginx.serviceConfig.ReadWritePaths = [ + "/var/spool/nginx/logs/" + ]; services.nginx = { appendHttpConfig = '' types { -- cgit v1.3.1 From 34da75341bc63e0ade7a6a5596891655d4f82659 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 19:37:33 +0100 Subject: ma bgt/download: remove obsolete netdata entry --- makefu/2configs/bgt/download.binaergewitter.de.nix | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix index e3be6778f..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 = '' @@ -41,6 +43,7 @@ in { systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/spool/nginx/logs/" ]; + services.nginx = { appendHttpConfig = '' types { @@ -60,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" ]; - } -- cgit v1.3.1 From a54974412751c98dec78b5e3977afc4a97aadea9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 20:50:43 +0100 Subject: ma bureautomation: move to 20.09 style imports --- .../bureautomation/automation/bureau-shutdown.nix | 157 ++++++++++---------- .../bureautomation/automation/hass-restart.nix | 65 +++++---- .../bureautomation/automation/nachtlicht.nix | 71 ++++----- .../bureautomation/automation/schlechteluft.nix | 130 +++++++++-------- .../bureautomation/binary_sensor/buttons.nix | 9 +- .../bureautomation/binary_sensor/motion.nix | 27 ++-- makefu/2configs/bureautomation/camera/comic.nix | 23 +-- .../2configs/bureautomation/camera/stuttgart.nix | 42 +++--- .../bureautomation/camera/verkehrskamera.nix | 31 ++-- makefu/2configs/bureautomation/default.nix | 92 +++++------- .../bureautomation/device_tracker/openwrt.nix | 29 ++-- makefu/2configs/bureautomation/light/buzzer.nix | 12 +- .../2configs/bureautomation/light/statuslight.nix | 14 +- .../2configs/bureautomation/multi/10h_timers.nix | 16 ++- makefu/2configs/bureautomation/multi/README.md | 3 - makefu/2configs/bureautomation/multi/aramark.nix | 21 +-- .../bureautomation/multi/daily-standup.nix | 83 +++++------ makefu/2configs/bureautomation/multi/frosch.nix | 158 +++++++++++---------- makefu/2configs/bureautomation/multi/matrix.nix | 106 +++++++------- .../2configs/bureautomation/multi/mittagessen.nix | 93 ++++++------ makefu/2configs/bureautomation/person/team.nix | 147 +++++++++---------- .../2configs/bureautomation/script/multi_blink.nix | 73 +++++----- .../2configs/bureautomation/sensor/airquality.nix | 21 +-- makefu/2configs/bureautomation/sensor/espeasy.nix | 12 +- makefu/2configs/bureautomation/sensor/influxdb.nix | 18 --- makefu/2configs/bureautomation/sensor/outside.nix | 54 +++---- .../bureautomation/sensor/tasmota_firmware.nix | 5 +- makefu/2configs/bureautomation/switch/rfbridge.nix | 16 ++- .../bureautomation/switch/tasmota_switch.nix | 17 ++- 29 files changed, 794 insertions(+), 751 deletions(-) delete mode 100644 makefu/2configs/bureautomation/multi/README.md delete mode 100644 makefu/2configs/bureautomation/sensor/influxdb.nix 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"; + } ]; - } - ]; - } - { - 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"; + }; + + action = [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.schlechteluft" + ]; } - { condition = "time"; - after = "06:00:00"; - before = "20:00:00"; + { service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = "BEEP BEEP - Die luft ist schon ${toString long_threshold} Minuten schlecht! Student Nummer {{ range(1,500) | random }}, öffne ein Fenster."; + language = "de"; + }; } ]; - }; - - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.schlechteluft" - ]; - } - { service = "tts.google_say"; - entity_id = "media_player.mpd"; - data_template = { - message = "BEEP BEEP - Die luft ist schon ${toString long_threshold} Minuten schlecht! Student Nummer {{ range(1,500) | random }}, öffne ein Fenster."; - language = "de"; - }; - } - ]; - } -] + } + ]; +} diff --git a/makefu/2configs/bureautomation/binary_sensor/buttons.nix b/makefu/2configs/bureautomation/binary_sensor/buttons.nix index e23c4a362..20590a6b3 100644 --- a/makefu/2configs/bureautomation/binary_sensor/buttons.nix +++ b/makefu/2configs/bureautomation/binary_sensor/buttons.nix @@ -12,6 +12,9 @@ let # expire_after = "5"; #expire after 5 seconds qos = 1; }; -in [ - (tasmota_button "RedButton" "redbutton") -] +in { + services.home-assistant.config.binary_sensor = + [ + (tasmota_button "RedButton" "redbutton") + ]; +} diff --git a/makefu/2configs/bureautomation/binary_sensor/motion.nix b/makefu/2configs/bureautomation/binary_sensor/motion.nix index ad8fab038..0c5a808e0 100644 --- a/makefu/2configs/bureautomation/binary_sensor/motion.nix +++ b/makefu/2configs/bureautomation/binary_sensor/motion.nix @@ -1,12 +1,15 @@ -[ - { platform = "mqtt"; - device_class = "motion"; - name = "Motion"; - state_topic = "/bam/easy2/movement/Switch"; - payload_on = "1"; - payload_off = "0"; - availability_topic = "/bam/easy2/tele/LWT"; - payload_available = "Online"; - payload_not_available = "Offline"; - } -] +{ + services.home-assistant.config.binary_sensor = + [ + { platform = "mqtt"; + device_class = "motion"; + name = "Motion"; + state_topic = "/bam/easy2/movement/Switch"; + payload_on = "1"; + payload_off = "0"; + availability_topic = "/bam/easy2/tele/LWT"; + payload_available = "Online"; + payload_not_available = "Offline"; + } + ]; +} diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix index a523d032e..ae24760e3 100644 --- a/makefu/2configs/bureautomation/camera/comic.nix +++ b/makefu/2configs/bureautomation/camera/comic.nix @@ -1,10 +1,13 @@ -[ - { name = "Poorly Drawn Lines"; - platform = "generic"; - still_image_url = http://127.0.0.1:8123/local/lines.png ; - } - { name = "XKCD"; - platform = "generic"; - still_image_url = http://127.0.0.1:8123/local/xkcd.png ; - } -] +{ + services.home-assistant.config.camera = + [ + { name = "Poorly Drawn Lines"; + platform = "generic"; + still_image_url = http://127.0.0.1:8123/local/lines.png ; + } + { name = "XKCD"; + platform = "generic"; + still_image_url = http://127.0.0.1:8123/local/xkcd.png ; + } + ]; +} diff --git a/makefu/2configs/bureautomation/camera/stuttgart.nix b/makefu/2configs/bureautomation/camera/stuttgart.nix index 78cbeb3e2..0badcb285 100644 --- a/makefu/2configs/bureautomation/camera/stuttgart.nix +++ b/makefu/2configs/bureautomation/camera/stuttgart.nix @@ -5,22 +5,26 @@ let inherit name still_image_url; platform = "generic"; }; -in [ - ( cam "Max-Eyth-See" https://www.wav-stuttgart.de/webcam/_/webcam1.jpg ) - ( cam "Wilhelma" http://webcam.wilhelma.de/webcam02/webcam02.jpg ) - ( cam "Marktplatz" https://webcam.stuttgart.de/wcam007/current.jpg ) - ( cam "Schoch Areal" https://webcam.stuttgart.de/wcam004/current.jpg ) - ( cam "Leuze" https://webcam.stuttgart.de/wcam005/current.jpg ) - ( cam "Straße Wilhelma" https://webcam.stuttgart.de/wcam006/current.jpg ) - ( cam "Fernsehturm 1" http://webcam.fernsehturmstuttgart.com/current.jpg ) - ( cam "Fernsehturm 2" http://webcam.fernsehturmstuttgart.com/current2.jpg ) - ( cam "Feuerbach Lemberg" http://www.regio7.de/handy/current.jpg ) - ( cam "Flughafen Stuttgart 1" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam2.jpg ) - ( cam "Flughafen Stuttgart 2" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam5.jpg ) - ( cam "Flughafen Stuttgart 3" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam7.jpg ) - ( cam "S21 1" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-03/s21-turm03.jpg ) - ( cam "S21 2" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-02/s21-turm-02.jpg ) - ( cam "S21 3" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-01/s21-turm-01.jpg ) - ( cam "S21 4" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Jaegerstrasse-Nordkopf/s21-jaegerstrassse-nordkopf.jpg ) - ( cam "S21 5" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Bahndirektion-Nord/S21-Bundesbahndirektion-Nord.jpg ) -] +in +{ + services.home-assistant.config.camera = + [ + ( cam "Max-Eyth-See" https://www.wav-stuttgart.de/webcam/_/webcam1.jpg ) + ( cam "Wilhelma" http://webcam.wilhelma.de/webcam02/webcam02.jpg ) + ( cam "Marktplatz" https://webcam.stuttgart.de/wcam007/current.jpg ) + ( cam "Schoch Areal" https://webcam.stuttgart.de/wcam004/current.jpg ) + ( cam "Leuze" https://webcam.stuttgart.de/wcam005/current.jpg ) + ( cam "Straße Wilhelma" https://webcam.stuttgart.de/wcam006/current.jpg ) + ( cam "Fernsehturm 1" http://webcam.fernsehturmstuttgart.com/current.jpg ) + ( cam "Fernsehturm 2" http://webcam.fernsehturmstuttgart.com/current2.jpg ) + ( cam "Feuerbach Lemberg" http://www.regio7.de/handy/current.jpg ) + ( cam "Flughafen Stuttgart 1" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam2.jpg ) + ( cam "Flughafen Stuttgart 2" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam5.jpg ) + ( cam "Flughafen Stuttgart 3" http://webcam.flughafen-stuttgart.de/Flughafen_Stuttgart_Webcam7.jpg ) + ( cam "S21 1" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-03/s21-turm03.jpg ) + ( cam "S21 2" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-02/s21-turm-02.jpg ) + ( cam "S21 3" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Turm-01/s21-turm-01.jpg ) + ( cam "S21 4" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Jaegerstrasse-Nordkopf/s21-jaegerstrassse-nordkopf.jpg ) + ( cam "S21 5" http://webcam-bahnprojekt-stuttgart-ulm.de/S21-Bahndirektion-Nord/S21-Bundesbahndirektion-Nord.jpg ) + ]; +} diff --git a/makefu/2configs/bureautomation/camera/verkehrskamera.nix b/makefu/2configs/bureautomation/camera/verkehrskamera.nix index f2dfdcd91..f09dc9423 100644 --- a/makefu/2configs/bureautomation/camera/verkehrskamera.nix +++ b/makefu/2configs/bureautomation/camera/verkehrskamera.nix @@ -1,14 +1,17 @@ -[ - { name = "Baumarkt"; - platform = "generic"; - still_image_url = http://t4915209254324-p80-c0-h6jv2afnujcoftrcstsafb45kdrqv4buy.webdirect.mdex.de/oneshotimage ;# baumarkt - } - { name = "Autobahn Heilbronn"; - platform = "generic"; - still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K10 ; - } - { name = "Autobahn Singen"; - platform = "generic"; - still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K11 ; - } -] +{ + services.home-assistant.config.camera = + [ + { name = "Baumarkt"; + platform = "generic"; + still_image_url = http://t4915209254324-p80-c0-h6jv2afnujcoftrcstsafb45kdrqv4buy.webdirect.mdex.de/oneshotimage ;# baumarkt + } + { name = "Autobahn Heilbronn"; + platform = "generic"; + still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K10 ; + } + { name = "Autobahn Singen"; + platform = "generic"; + still_image_url = https://api.svz-bw.de/v2/verkehrskameras/kameras/K11 ; + } + ]; +} diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index cd598f0aa..7e8b6a4d3 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -1,20 +1,51 @@ { config, pkgs, lib, ... }: let kodi-host = "192.168.8.11"; - ten_hours = import ./multi/10h_timers.nix { inherit lib; }; # provides: timer automation script - mittagessen = import ./multi/mittagessen.nix { inherit lib; }; # provides: automation script - matrix = import ./multi/matrix.nix { inherit lib; }; # provides: matrix automation - frosch = import ./multi/frosch.nix { inherit lib; }; # provides: sensor binary_sensor switch light script automation - aramark = import ./multi/aramark.nix { inherit lib; }; # provides: sensor binary_sensor - standup = import ./multi/daily-standup.nix { inherit lib; }; # provides: automation script in { imports = [ ./ota.nix ./comic-updater.nix ./puppy-proxy.nix + + # hass config + ## complex configs + ./multi/daily-standup.nix + ./multi/aramark.nix + ./multi/matrix.nix + ./multi/frosch.nix + ./multi/mittagessen.nix + ./multi/10h_timers.nix + + ./switch/tasmota_switch.nix + ./switch/rfbridge.nix + + ./light/statuslight.nix + ./light/buzzer.nix + + ./script/multi_blink.nix + + ./binary_sensor/buttons.nix + ./binary_sensor/motion.nix + + # ./sensor/pollen.nix requires dwd_pollen + ./sensor/espeasy.nix + ./sensor/airquality.nix + ./sensor/outside.nix + ./sensor/tasmota_firmware.nix + + ./camera/verkehrskamera.nix + ./camera/comic.nix + ./camera/stuttgart.nix + ./automation/bureau-shutdown.nix + ./automation/nachtlicht.nix + ./automation/schlechteluft.nix + ./automation/hass-restart.nix + ./device_tracker/openwrt.nix + ./person/team.nix ]; networking.firewall.allowedTCPPorts = [ 8123 ]; state = [ "/var/lib/hass/known_devices.yaml" ]; + services.home-assistant = { enable = true; autoExtraComponents = true; @@ -51,7 +82,6 @@ in { source = "hass"; }; }; - matrix = matrix.matrix; mqtt = { discovery = true; discovery_prefix = "homeassistant"; @@ -73,13 +103,6 @@ in { retain = true; }; }; - switch = (import ./switch/tasmota_switch.nix) - ++ frosch.switch - ++ (import ./switch/rfbridge.nix); - light = (import ./light/statuslight.nix) - ++ (import ./light/buzzer.nix) - ++ frosch.light; - timer = ten_hours.timer; notify = [ { platform = "kodi"; @@ -93,7 +116,7 @@ in { (builtins.fromJSON (builtins.readFile )).allowed_chat_ids 0; } - ] ++ matrix.notify; + ]; media_player = [ { platform = "kodi"; host = kodi-host; @@ -102,37 +125,10 @@ in { host = "127.0.0.1"; } ]; - script = lib.fold lib.recursiveUpdate {} [ - ((import ./script/multi_blink.nix) {inherit lib;}) - frosch.script - ten_hours.script - mittagessen.script - # standup.script - ]; - binary_sensor = - (import ./binary_sensor/buttons.nix) - ++ (import ./binary_sensor/motion.nix) - ++ frosch.binary_sensor - ++ aramark.binary_sensor; - sensor = [] - ++ [{ platform = "version"; }] # pyhaversion - # ++ (import ./sensor/pollen.nix) - ++ (import ./sensor/espeasy.nix) - ++ (import ./sensor/airquality.nix) - ++ ((import ./sensor/outside.nix) {inherit lib;}) - ++ (import ./sensor/influxdb.nix) - ++ (import ./sensor/tasmota_firmware.nix) - ++ frosch.sensor - ++ aramark.sensor; + sensor = [{ platform = "version"; }]; # pyhaversion - camera = - (import ./camera/verkehrskamera.nix) - ++ (import ./camera/comic.nix) - ++ (import ./camera/stuttgart.nix); - person = - (import ./person/team.nix ); frontend = { }; http = { @@ -263,16 +259,6 @@ in { # feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ]; # we don't use imports because the expressions do not merge in # home-assistant - automation = (import ./automation/bureau-shutdown.nix) - ++ (import ./automation/nachtlicht.nix) - ++ (import ./automation/schlechteluft.nix) - ++ (import ./automation/hass-restart.nix) - ++ ten_hours.automation - ++ matrix.automation - # ++ standup.automation - ++ frosch.automation - ++ mittagessen.automation; - device_tracker = (import ./device_tracker/openwrt.nix ); }; }; } diff --git a/makefu/2configs/bureautomation/device_tracker/openwrt.nix b/makefu/2configs/bureautomation/device_tracker/openwrt.nix index 5de216474..6b0144129 100644 --- a/makefu/2configs/bureautomation/device_tracker/openwrt.nix +++ b/makefu/2configs/bureautomation/device_tracker/openwrt.nix @@ -1,16 +1,19 @@ # requires `opkg install luci-mod-rpc` on router # see https://www.home-assistant.io/components/luci/ -[ - { platform = "luci"; - host = "192.168.8.1"; - username = "root"; - password = import ; - interval_seconds = 30; # instead of 12seconds - consider_home = 300; # 5 minutes timeout - new_device_defaults = { - track_new_devices = true; - hide_if_away = false; - }; - } -] +{ + services.home-assistant.config.device_tracker = + [ + { platform = "luci"; + host = "192.168.8.1"; + username = "root"; + password = import ; + interval_seconds = 30; # instead of 12seconds + consider_home = 300; # 5 minutes timeout + new_device_defaults = { + track_new_devices = true; + hide_if_away = false; + }; + } + ]; +} diff --git a/makefu/2configs/bureautomation/light/buzzer.nix b/makefu/2configs/bureautomation/light/buzzer.nix index 2067e47bf..bc2ba4e57 100644 --- a/makefu/2configs/bureautomation/light/buzzer.nix +++ b/makefu/2configs/bureautomation/light/buzzer.nix @@ -21,8 +21,10 @@ let optimistic = false; qos = 0; }; -in -[ -# (tasmota_pwm "RedButton LED" "redbutton" 1 1023) #LED PWM1 - (tasmota_pwm "RedButton Buzzer" "redbutton" 2 512) #buzzer PWM2 -] +in { + services.home-assistant.config.light = + [ + # (tasmota_pwm "RedButton LED" "redbutton" 1 1023) #LED PWM1 + (tasmota_pwm "RedButton Buzzer" "redbutton" 2 512) #buzzer PWM2 + ]; +} diff --git a/makefu/2configs/bureautomation/light/statuslight.nix b/makefu/2configs/bureautomation/light/statuslight.nix index c9d301758..de65a2379 100644 --- a/makefu/2configs/bureautomation/light/statuslight.nix +++ b/makefu/2configs/bureautomation/light/statuslight.nix @@ -48,9 +48,11 @@ let 12 # fire pattern ]; }; -in -[ - (tasmota_rgb "Status Felix" "status1") - (tasmota_rgb "Status Daniel" "status2") - (tasmota_rgb "Buslicht" "buslicht") -] +in { + services.home-assistant.config.light = + [ + (tasmota_rgb "Status Felix" "status1") + (tasmota_rgb "Status Daniel" "status2") + (tasmota_rgb "Buslicht" "buslicht") + ]; +} diff --git a/makefu/2configs/bureautomation/multi/10h_timers.nix b/makefu/2configs/bureautomation/multi/10h_timers.nix index a30fb28b0..6edcde4b0 100644 --- a/makefu/2configs/bureautomation/multi/10h_timers.nix +++ b/makefu/2configs/bureautomation/multi/10h_timers.nix @@ -198,11 +198,13 @@ let ]; in { - timer =lib.fold lib.recursiveUpdate {} - (map tmr_10h persons); - automation = (lib.flatten (map automation_10h persons)); - script = lib.fold lib.recursiveUpdate {} ( - (map announce_user persons) ++ - (map zu_lange_user persons) - ); + services.home-assistant.config = { + timer =lib.fold lib.recursiveUpdate {} + (map tmr_10h persons); + automation = (lib.flatten (map automation_10h persons)); + script = lib.fold lib.recursiveUpdate {} ( + (map announce_user persons) ++ + (map zu_lange_user persons) + ); + }; } diff --git a/makefu/2configs/bureautomation/multi/README.md b/makefu/2configs/bureautomation/multi/README.md deleted file mode 100644 index baad87fda..000000000 --- a/makefu/2configs/bureautomation/multi/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Combination Folder -files return a dictionary of different types used in home-assistant instead of -a single thing. diff --git a/makefu/2configs/bureautomation/multi/aramark.nix b/makefu/2configs/bureautomation/multi/aramark.nix index ebe2cde81..45fadb082 100644 --- a/makefu/2configs/bureautomation/multi/aramark.nix +++ b/makefu/2configs/bureautomation/multi/aramark.nix @@ -12,13 +12,16 @@ let ((aramark "${menue}/price" "${menue} Preis") // { unit_of_measurement = "€"; }) ]; in -{ - sensor = (aramark_menue "Menü 1") - ++ (aramark_menue "Menü 2") - ++ (aramark_menue "Mercato") - ++ (aramark_menue "Aktion"); - binary_sensor = - [ - ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; }) - ]; + { + services.home-assistant.config = + { + sensor = (aramark_menue "Menü 1") + ++ (aramark_menue "Menü 2") + ++ (aramark_menue "Mercato") + ++ (aramark_menue "Aktion"); + binary_sensor = + [ + ((aramark "pommes" "Pommes" ) // { payload_on = "True"; payload_off = "False"; }) + ]; + }; } diff --git a/makefu/2configs/bureautomation/multi/daily-standup.nix b/makefu/2configs/bureautomation/multi/daily-standup.nix index 38fb22c1a..063def1ef 100644 --- a/makefu/2configs/bureautomation/multi/daily-standup.nix +++ b/makefu/2configs/bureautomation/multi/daily-standup.nix @@ -1,4 +1,4 @@ -{ lib }: +{lib, ... }: let random_daily_text = ''{{ [ "Es ist so weit, es ist Standup Zeit!", @@ -9,46 +9,49 @@ let "Morgens, halb elf in Deutschland - das Standupchen" ] | random }}''; in { - script = - { "random_daily" = { - alias = "Random Daily Introduction"; + services.home-assistant.config = + { + script = + { "random_daily" = { + alias = "Random Daily Introduction"; - sequence = [ - { service = "media_player.play_media"; - data = { - entity_id = "media_player.mpd"; - media_content_type = "playlist"; - media_content_id = "ansage"; - }; - } - { delay.seconds = 5; } - { service = "tts.google_say"; - entity_id = "media_player.mpd"; - data_template = { - message = random_daily_text; - language = "de"; - }; - } - ]; - }; - }; - automation = [ - { - alias = "Daily Standup"; - trigger = { - platform = "time"; - at = "10:35:00"; + sequence = [ + { service = "media_player.play_media"; + data = { + entity_id = "media_player.mpd"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { delay.seconds = 5; } + { service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = random_daily_text; + language = "de"; + }; + } + ]; }; - action = - [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.blitz_10s" - "script.random_daily" - ]; - } - ]; + }; + automation = [ + { + alias = "Daily Standup"; + trigger = { + platform = "time"; + at = "10:35:00"; + }; + action = + [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.blitz_10s" + "script.random_daily" + ]; + } + ]; - } - ]; + } + ]; + }; } diff --git a/makefu/2configs/bureautomation/multi/frosch.nix b/makefu/2configs/bureautomation/multi/frosch.nix index 816539d46..61606d4eb 100644 --- a/makefu/2configs/bureautomation/multi/frosch.nix +++ b/makefu/2configs/bureautomation/multi/frosch.nix @@ -1,4 +1,4 @@ -{ lib }: +{lib, ... }: # needs: binary_sensor.pommes # notify.matrix_notify let @@ -17,83 +17,87 @@ let "Der Weltmarktpreis von Pommes ist durch verschiedene Weltkrisen leider so hoch, dass Aramark den Verkaufspreis verdoppeln musste.", "Vorfreude, schönste Freude, Freude bei Aramark. Pommes in die Schale rein, alle Kunden werden glücklich sein.", "In 15 Minuten ist es wieder so weit, es ist Pommes Zeit!"] | random }}''; -in { - sensor = [ - { platform = "mqtt"; - name = "frosch brightness"; - device_class = "illuminance"; - state_topic = "/bam/frosch/sensor/brightness/state"; - availability_topic = "/bam/frosch/status"; - payload_available = "online"; - payload_not_available = "offline"; - } - ]; - binary_sensor = [ - { platform = "mqtt"; - name = "frosch auge"; - state_topic = "/bam/frosch/binary_sensor/froschauge/state"; - availability_topic = "/bam/frosch/status"; - payload_available = "online"; - payload_not_available = "offline"; - } - ]; - switch = [ - { platform = "mqtt"; - name = "frosch blasen"; - state_topic = "/bam/frosch/switch/blasen/state"; - command_topic = "/bam/frosch/switch/blasen/command"; - availability_topic = "/bam/frosch/status"; - payload_available = "online"; - payload_not_available = "offline"; - } - ]; - light = []; - automation = [ - { alias = "Pommeszeit"; - trigger = { - platform = "time"; - at = "11:00:00"; +in +{ + services.home-assistant.config = + { + sensor = [ + { platform = "mqtt"; + name = "frosch brightness"; + device_class = "illuminance"; + state_topic = "/bam/frosch/sensor/brightness/state"; + availability_topic = "/bam/frosch/status"; + payload_available = "online"; + payload_not_available = "offline"; + } + ]; + binary_sensor = [ + { platform = "mqtt"; + name = "frosch auge"; + state_topic = "/bam/frosch/binary_sensor/froschauge/state"; + availability_topic = "/bam/frosch/status"; + payload_available = "online"; + payload_not_available = "offline"; + } + ]; + switch = [ + { platform = "mqtt"; + name = "frosch blasen"; + state_topic = "/bam/frosch/switch/blasen/state"; + command_topic = "/bam/frosch/switch/blasen/command"; + availability_topic = "/bam/frosch/status"; + payload_available = "online"; + payload_not_available = "offline"; + } + ]; + light = []; + automation = [ + { alias = "Pommeszeit"; + trigger = { + platform = "time"; + at = "11:00:00"; + }; + condition = { + condition = "state"; + entity_id = "binary_sensor.pommes"; # from multi/aramark.nix + state = "on"; + }; + action = [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.pommes_announce" + "script.seifenblasen_30s" # from script/multi_blink.nix + ]; + } + ]; + } + ]; + script = { + pommes_announce = { + alias = "Random Pommes announce"; + sequence = [ + { + service = "media_player.play_media"; + data = { + entity_id = "media_player.mpd"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { delay.seconds = 5; } + { + service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = random_pommes; + language = "de"; + }; + } + { service = "notify.matrix_notify"; + data_template.message = random_pommes; + } + ]; }; - condition = { - condition = "state"; - entity_id = "binary_sensor.pommes"; # from multi/aramark.nix - state = "on"; - }; - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.pommes_announce" - "script.seifenblasen_30s" # from script/multi_blink.nix - ]; - } - ]; - } - ]; - script = { - pommes_announce = { - alias = "Random Pommes announce"; - sequence = [ - { - service = "media_player.play_media"; - data = { - entity_id = "media_player.mpd"; - media_content_type = "playlist"; - media_content_id = "ansage"; - }; - } - { delay.seconds = 5; } - { - service = "tts.google_say"; - entity_id = "media_player.mpd"; - data_template = { - message = random_pommes; - language = "de"; - }; - } - { service = "notify.matrix_notify"; - data_template.message = random_pommes; - } - ]; }; }; } diff --git a/makefu/2configs/bureautomation/multi/matrix.nix b/makefu/2configs/bureautomation/multi/matrix.nix index 4fcfe8da4..b9b8fc4e8 100644 --- a/makefu/2configs/bureautomation/multi/matrix.nix +++ b/makefu/2configs/bureautomation/multi/matrix.nix @@ -8,58 +8,62 @@ # name: my_command let mom_room = "!kTQjvTQvfVsvfEtmth:thales.citadel.team"; -in { - matrix = +in +{ + services.home-assistant.config = { - # secrets: - # homeserver, username, password - homeserver = "https://ext01.citadel.team"; - rooms = [ - mom_room - ]; - commands = [ - { - # alternative: expression for regexp - word = "version"; - name = "version"; - } - { - word = "luftqualität"; - name = "luftqualitaet"; - } - ]; - } // (builtins.fromJSON (builtins.readFile - )); - automation = [ + matrix = { - alias = "React to !version"; - trigger = { - platform = "event"; - event_type = "matrix_command"; - event_data.command = "version"; - }; - action = { - service = "notify.matrix_notify"; - data_template.message = "Running home-assistant {{states.sensor.current_version.state}}"; - }; - } - { - alias = "React to !luftqualität"; - trigger = { - platform = "event"; - event_type = "matrix_command"; - event_data.command = "luftqualitaet"; - }; - action = { - service = "notify.matrix_notify"; - data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}''; - }; - } + # secrets: + # homeserver, username, password + homeserver = "https://ext01.citadel.team"; + rooms = [ + mom_room + ]; + commands = [ + { + # alternative: expression for regexp + word = "version"; + name = "version"; + } + { + word = "luftqualität"; + name = "luftqualitaet"; + } + ]; + } // (builtins.fromJSON (builtins.readFile + )); + automation = [ + { + alias = "React to !version"; + trigger = { + platform = "event"; + event_type = "matrix_command"; + event_data.command = "version"; + }; + action = { + service = "notify.matrix_notify"; + data_template.message = "Running home-assistant {{states.sensor.current_version.state}}"; + }; + } + { + alias = "React to !luftqualität"; + trigger = { + platform = "event"; + event_type = "matrix_command"; + event_data.command = "luftqualitaet"; + }; + action = { + service = "notify.matrix_notify"; + data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}''; + }; + } - ]; - notify = [{ - name = "matrix_notify"; - platform = "matrix"; - default_room = mom_room; - }]; + ]; + notify = [{ + name = "matrix_notify"; + platform = "matrix"; + default_room = mom_room; + }]; + }; } diff --git a/makefu/2configs/bureautomation/multi/mittagessen.nix b/makefu/2configs/bureautomation/multi/mittagessen.nix index 2a9993e92..52ec99a92 100644 --- a/makefu/2configs/bureautomation/multi/mittagessen.nix +++ b/makefu/2configs/bureautomation/multi/mittagessen.nix @@ -38,52 +38,55 @@ let "Jetzt nur noch kurz die Mail fertig schreiben und schon kann es los gehen.", "Es ist 13 Uhr und die Mittagspause ist bald vorbei .... Kleiner Scherz, es ist erst 12:30, aber Ihr hättet auch nicht wirklich etwas verpasst.", "Hallo, es ist nun 12 Uhr 30! Dies entspricht der Essenszeit aller Büroinsassen. Bitte begebt euch zur Aramark Essensausgabe um euren menschlichen Bedürfnissen nachzukommen."] | random }}''; -in { - automation = [ - { alias = "Mittagessen"; - trigger = { - platform = "time"; - at = "12:30:00"; +in +{ + services.home-assistant.config = { + automation = [ + { alias = "Mittagessen"; + trigger = { + platform = "time"; + at = "12:30:00"; + }; + action = [ + { service = "homeassistant.turn_on"; + entity_id = [ + "script.mittagessen_announce" + "script.blitz_10s" + "script.mittagessenlicht" + ]; + } + ]; + } + ]; + script = { + mittagessenlicht = (flash_entity { + entity = "switch.bauarbeiterlampe"; + alias = "Bauarbeiterlampe Mittagessenlicht"; + delay = 1000; + count = 5; + }); + mittagessen_announce = { + alias = "Random Mittagessen announce"; + sequence = [ + { + service = "media_player.play_media"; + data = { + entity_id = "media_player.mpd"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { delay.seconds = 5; } + { + service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = random_mittagessen; + language = "de"; + }; + } + ]; }; - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.mittagessen_announce" - "script.blitz_10s" - "script.mittagessenlicht" - ]; - } - ]; - } - ]; - script = { - mittagessenlicht = (flash_entity { - entity = "switch.bauarbeiterlampe"; - alias = "Bauarbeiterlampe Mittagessenlicht"; - delay = 1000; - count = 5; - }); - mittagessen_announce = { - alias = "Random Mittagessen announce"; - sequence = [ - { - service = "media_player.play_media"; - data = { - entity_id = "media_player.mpd"; - media_content_type = "playlist"; - media_content_id = "ansage"; - }; - } - { delay.seconds = 5; } - { - service = "tts.google_say"; - entity_id = "media_player.mpd"; - data_template = { - message = random_mittagessen; - language = "de"; - }; - } - ]; }; }; } diff --git a/makefu/2configs/bureautomation/person/team.nix b/makefu/2configs/bureautomation/person/team.nix index 2a15abaf5..124e85536 100644 --- a/makefu/2configs/bureautomation/person/team.nix +++ b/makefu/2configs/bureautomation/person/team.nix @@ -1,72 +1,75 @@ -[ - { name = "Thorsten"; - id = 1; - device_trackers = [ - "device_tracker.thorsten_phone" - #"device_tracker.thorsten_arbeitphone" - ]; - } - { name = "Felix"; - id = 2; - device_trackers = [ - "device_tracker.felix_phone" - "device_tracker.felix_laptop" - ]; - } - { name = "Ecki"; - id = 3; - device_trackers = [ - "device_tracker.ecki_phone" - "device_tracker.ecki_tablet" - ]; - } - { name = "Daniel"; - id = 4; - device_trackers = [ - "device_tracker.daniel_phone" - ]; - } - { name = "Thierry"; - id = 5; - device_trackers = [ - "device_tracker.thierry_phone" - ]; - } - { name = "Frank"; - id = 6; - device_trackers = [ - "device_tracker.frank_phone" - ]; - } - { name = "Carsten"; - id = 7; - device_trackers = [ - "device_tracker.carsten_phone" - ]; - } - { name = "Emeka"; - id = 8; - device_trackers = [ - "device_tracker.emeka_phone" - ]; - } - { name = "Sabine"; - id = 9; - device_trackers = [ - "device_tracker.sabine_phone" - ]; - } - { name = "Tobias"; - id = 10; - device_trackers = [ - "device_tracker.tobias_phone" - ]; - } - { name = "Tancrede"; - id = 11; - device_trackers = [ - "device_tracker.tancrede_phone" - "device_tracker.tancrede_laptop" - ]; - } -] +{ + services.home-assistant.config.person = + [ + { name = "Thorsten"; + id = 1; + device_trackers = [ + "device_tracker.thorsten_phone" + #"device_tracker.thorsten_arbeitphone" + ]; + } + { name = "Felix"; + id = 2; + device_trackers = [ + "device_tracker.felix_phone" + "device_tracker.felix_laptop" + ]; + } + { name = "Ecki"; + id = 3; + device_trackers = [ + "device_tracker.ecki_phone" + "device_tracker.ecki_tablet" + ]; + } + { name = "Daniel"; + id = 4; + device_trackers = [ + "device_tracker.daniel_phone" + ]; + } + { name = "Thierry"; + id = 5; + device_trackers = [ + "device_tracker.thierry_phone" + ]; + } + { name = "Frank"; + id = 6; + device_trackers = [ + "device_tracker.frank_phone" + ]; + } + { name = "Carsten"; + id = 7; + device_trackers = [ + "device_tracker.carsten_phone" + ]; + } + { name = "Emeka"; + id = 8; + device_trackers = [ + "device_tracker.emeka_phone" + ]; + } + { name = "Sabine"; + id = 9; + device_trackers = [ + "device_tracker.sabine_phone" + ]; + } + { name = "Tobias"; + id = 10; + device_trackers = [ + "device_tracker.tobias_phone" + ]; + } + { name = "Tancrede"; + id = 11; + device_trackers = [ + "device_tracker.tancrede_phone" + "device_tracker.tancrede_laptop" + ]; + } + ]; +} diff --git a/makefu/2configs/bureautomation/script/multi_blink.nix b/makefu/2configs/bureautomation/script/multi_blink.nix index e6acdc303..753918f31 100644 --- a/makefu/2configs/bureautomation/script/multi_blink.nix +++ b/makefu/2configs/bureautomation/script/multi_blink.nix @@ -19,39 +19,42 @@ let ) count); }; in { - buzz_red_led = (flash_entity { - entity = "light.redbutton_buzzer"; - alias = "Red Button Buzz"; - count = 4; - }); - buzz_red_led_fast = (flash_entity { - entity = "light.redbutton_buzzer"; - delay = 250; - count = 2; - alias = "Red Button Buzz fast"; - }); - blitz_10s = (flash_entity { - entity = "switch.blitzdings"; - delay = 10000; - count = 1; - alias = "blitz for 10 seconds"; - }); - blasen_10s = (flash_entity { - entity = "switch.frosch_blasen"; - delay = 10000; - count = 1; - alias = "blasen for 10 seconds"; - }); - blasen_30s = (flash_entity { - entity = "switch.frosch_blasen"; - delay = 30000; - count = 1; - alias = "blasen for 30 seconds"; - }); - schlechteluft = (flash_entity { - entity = "switch.bauarbeiterlampe"; - alias = "Schlechte Luft Lampe 5 secs"; - delay = 5000; - count = 1; - }); + services.home-assistant.config.script = + { + buzz_red_led = (flash_entity { + entity = "light.redbutton_buzzer"; + alias = "Red Button Buzz"; + count = 4; + }); + buzz_red_led_fast = (flash_entity { + entity = "light.redbutton_buzzer"; + delay = 250; + count = 2; + alias = "Red Button Buzz fast"; + }); + blitz_10s = (flash_entity { + entity = "switch.blitzdings"; + delay = 10000; + count = 1; + alias = "blitz for 10 seconds"; + }); + blasen_10s = (flash_entity { + entity = "switch.frosch_blasen"; + delay = 10000; + count = 1; + alias = "blasen for 10 seconds"; + }); + blasen_30s = (flash_entity { + entity = "switch.frosch_blasen"; + delay = 30000; + count = 1; + alias = "blasen for 30 seconds"; + }); + schlechteluft = (flash_entity { + entity = "switch.bauarbeiterlampe"; + alias = "Schlechte Luft Lampe 5 secs"; + delay = 5000; + count = 1; + }); + }; } diff --git a/makefu/2configs/bureautomation/sensor/airquality.nix b/makefu/2configs/bureautomation/sensor/airquality.nix index 217fa9595..7d95c3c15 100644 --- a/makefu/2configs/bureautomation/sensor/airquality.nix +++ b/makefu/2configs/bureautomation/sensor/airquality.nix @@ -1,9 +1,12 @@ -[ - # coming from 2configs/stats/telegraf/ - { platform = "mqtt"; - name = "Air Quality"; - state_topic = "/telegraf/wbob/airquality"; - value_template = "{{ value_json.fields.value }}"; - unit_of_measurement = "VOC"; - } -] +{ + services.home-assistant.config.sensor = + [ + # coming from 2configs/stats/telegraf/ + { platform = "mqtt"; + name = "Air Quality"; + state_topic = "/telegraf/wbob/airquality"; + value_template = "{{ value_json.fields.value }}"; + unit_of_measurement = "VOC"; + } + ]; +} diff --git a/makefu/2configs/bureautomation/sensor/espeasy.nix b/makefu/2configs/bureautomation/sensor/espeasy.nix index 4b78ee84e..c68f39f1a 100644 --- a/makefu/2configs/bureautomation/sensor/espeasy.nix +++ b/makefu/2configs/bureautomation/sensor/espeasy.nix @@ -24,8 +24,10 @@ let payload_available = "Online"; payload_not_available = "Offline"; }; -in -(espeasy_dht22 "easy1") ++ -(espeasy_dht22 "easy2") ++ [ - (espeasy_ds18 "easy3" ) -] +in { + services.home-assistant.config.sensor = + (espeasy_dht22 "easy1") ++ + (espeasy_dht22 "easy2") ++ [ + (espeasy_ds18 "easy3" ) + ]; +} diff --git a/makefu/2configs/bureautomation/sensor/influxdb.nix b/makefu/2configs/bureautomation/sensor/influxdb.nix deleted file mode 100644 index 820a56c4d..000000000 --- a/makefu/2configs/bureautomation/sensor/influxdb.nix +++ /dev/null @@ -1,18 +0,0 @@ -[ - #{ platform = "influxdb"; - # queries = [ - # { name = "mean value of feinstaub P1"; - # where = '' "node" = 'esp8266-1355142' ''; - # measurement = "feinstaub"; - # database = "telegraf"; - # field = "P1"; - # } - # { name = "mean value of feinstaub P2"; - # where = '' "node" = 'esp8266-1355142' ''; - # measurement = "feinstaub"; - # database = "telegraf"; - # field = "P2"; - # } - # ]; - #} -] diff --git a/makefu/2configs/bureautomation/sensor/outside.nix b/makefu/2configs/bureautomation/sensor/outside.nix index 596473f17..b5d25ecd3 100644 --- a/makefu/2configs/bureautomation/sensor/outside.nix +++ b/makefu/2configs/bureautomation/sensor/outside.nix @@ -1,25 +1,29 @@ -{lib,...}: [ - { platform = "darksky"; - api_key = lib.removeSuffix "\n" - (builtins.readFile ); - language = "de"; - monitored_conditions = [ - "summary" "icon" - "nearest_storm_distance" "precip_probability" - "precip_intensity" - "temperature" # "temperature_high" "temperature_low" - "apparent_temperature" - "hourly_summary" # next 24 hours text - "humidity" - "pressure" - "uv_index" - ]; - units = "si" ; - scan_interval = "00:30:00"; - } - { platform = "luftdaten"; - name = "Ditzingen"; - sensorid = "5341"; - monitored_conditions = [ "P1" "P2" ]; - } - ] +{lib,...}: +{ + services.home-assistant.config.sensor = + [ + { platform = "darksky"; + api_key = lib.removeSuffix "\n" + (builtins.readFile ); + language = "de"; + monitored_conditions = [ + "summary" "icon" + "nearest_storm_distance" "precip_probability" + "precip_intensity" + "temperature" # "temperature_high" "temperature_low" + "apparent_temperature" + "hourly_summary" # next 24 hours text + "humidity" + "pressure" + "uv_index" + ]; + units = "si" ; + scan_interval = "00:30:00"; + } + { platform = "luftdaten"; + name = "Ditzingen"; + sensorid = "5341"; + monitored_conditions = [ "P1" "P2" ]; + } + ]; +} diff --git a/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix b/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix index 1a4738e12..f5f063dbf 100644 --- a/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix +++ b/makefu/2configs/bureautomation/sensor/tasmota_firmware.nix @@ -9,8 +9,11 @@ let payload_not_available= "Offline"; }; in +{ + services.home-assistant.config.sensor = map tasmota_firmware [ "plug" "plug2" "plug3" "plug4" "plug5" "status1" "status2" "buslicht" "rfbridge" - ] + ]; +} diff --git a/makefu/2configs/bureautomation/switch/rfbridge.nix b/makefu/2configs/bureautomation/switch/rfbridge.nix index 1336549a3..9b9de7793 100644 --- a/makefu/2configs/bureautomation/switch/rfbridge.nix +++ b/makefu/2configs/bureautomation/switch/rfbridge.nix @@ -8,10 +8,12 @@ let payload_available= "Online"; payload_not_available= "Offline"; }; -in -[ - (bridge "Nachtlicht A" "#414551" "#414554") - (bridge "Nachtlicht B" "#415151" "#415154") - (bridge "Nachtlicht C" "#415451" "#415454") - (bridge "Nachtlicht D" "#41551F" "#415514") -] +in { + services.home-assistant.config.switch = + [ + (bridge "Nachtlicht A" "#414551" "#414554") + (bridge "Nachtlicht B" "#415151" "#415154") + (bridge "Nachtlicht C" "#415451" "#415454") + (bridge "Nachtlicht D" "#41551F" "#415514") + ]; +} diff --git a/makefu/2configs/bureautomation/switch/tasmota_switch.nix b/makefu/2configs/bureautomation/switch/tasmota_switch.nix index 115bae0cc..6c5f6b8a6 100644 --- a/makefu/2configs/bureautomation/switch/tasmota_switch.nix +++ b/makefu/2configs/bureautomation/switch/tasmota_switch.nix @@ -13,10 +13,13 @@ let retain = false; qos = 1; }; -in [ - (tasmota_plug "Bauarbeiterlampe" "plug") - (tasmota_plug "Blitzdings" "plug2") - (tasmota_plug "Fernseher" "plug3") - (tasmota_plug "Feuer" "plug4") - (tasmota_plug "Blaulicht" "plug5") -] +in { + services.home-assistant.config.switch = + [ + (tasmota_plug "Bauarbeiterlampe" "plug") + (tasmota_plug "Blitzdings" "plug2") + (tasmota_plug "Fernseher" "plug3") + (tasmota_plug "Feuer" "plug4") + (tasmota_plug "Blaulicht" "plug5") + ]; +} -- cgit v1.3.1 From 90a96f000e19ef1521f582d401e09a5eb4c33bd9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 21:08:26 +0100 Subject: ma bureautomation: update team --- makefu/2configs/bureautomation/person/team.nix | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/makefu/2configs/bureautomation/person/team.nix b/makefu/2configs/bureautomation/person/team.nix index 124e85536..bf3d09c57 100644 --- a/makefu/2configs/bureautomation/person/team.nix +++ b/makefu/2configs/bureautomation/person/team.nix @@ -40,12 +40,12 @@ "device_tracker.frank_phone" ]; } - { name = "Carsten"; - id = 7; - device_trackers = [ - "device_tracker.carsten_phone" - ]; - } + #{ name = "Carsten"; + # id = 7; + # device_trackers = [ + # "device_tracker.carsten_phone" + # ]; + #} { name = "Emeka"; id = 8; device_trackers = [ @@ -58,17 +58,23 @@ "device_tracker.sabine_phone" ]; } - { name = "Tobias"; - id = 10; - device_trackers = [ - "device_tracker.tobias_phone" - ]; - } - { name = "Tancrede"; - id = 11; + #{ name = "Tobias"; + # id = 10; + # device_trackers = [ + # "device_tracker.tobias_phone" + # ]; + #} + #{ name = "Tancrede"; + # id = 11; + # device_trackers = [ + # "device_tracker.tancrede_phone" + # "device_tracker.tancrede_laptop" + # ]; + #} + { name = "Chris"; + id = 12; device_trackers = [ - "device_tracker.tancrede_phone" - "device_tracker.tancrede_laptop" + "device_tracker.chris_phone" ]; } ]; -- cgit v1.3.1 From 245e5f54226703dd60bc4f967b9e32e897140e84 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 21:08:48 +0100 Subject: ma sickbeard: use python37 --- makefu/2configs/sickbeard/sickgear.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefu/2configs/sickbeard/sickgear.nix b/makefu/2configs/sickbeard/sickgear.nix index 9746ee073..da984358c 100644 --- a/makefu/2configs/sickbeard/sickgear.nix +++ b/makefu/2configs/sickbeard/sickgear.nix @@ -1,8 +1,8 @@ -{ stdenv, fetchFromGitHub, python3, makeWrapper }: +{ stdenv, fetchFromGitHub, python37, makeWrapper }: let - pythonEnv = python3.withPackages(ps: with ps; [ - (python3.pkgs.callPackage ./cheetah3.nix {}) + pythonEnv = python37.withPackages(ps: with ps; [ + (ps.callPackage ./cheetah3.nix {}) ]); in stdenv.mkDerivation rec { pname = "sickgear"; -- cgit v1.3.1 From ed8f5b65c86ba1b7c796b3214610e0b3f71bc6a7 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 21:09:11 +0100 Subject: ma wireguard/server: remove restart logic --- makefu/2configs/wireguard/server.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/makefu/2configs/wireguard/server.nix b/makefu/2configs/wireguard/server.nix index 1b81cf57f..76fea1d6d 100644 --- a/makefu/2configs/wireguard/server.nix +++ b/makefu/2configs/wireguard/server.nix @@ -56,8 +56,4 @@ in { # wireguard server }; # TODO: this issue is related to the router which connects to the host but is # unable to re-connect once restarted - systemd.services.wireguard-wg0.serviceConfig = { - Restart = "always"; - RuntimeMaxSec = "12h"; - }; } -- cgit v1.3.1 From e04ae7a3147c731fa3eff16721253cec4dfccdbc Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 22:20:24 +0100 Subject: ma ham/zigbee2mqtt: use upstream module --- makefu/2configs/ham/multi/zigbee2mqtt.nix | 127 --------------------------- makefu/2configs/ham/zigbee2mqtt/default.nix | 30 ++++--- makefu/2configs/ham/zigbee2mqtt/hass.nix | 130 ++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+), 139 deletions(-) delete mode 100644 makefu/2configs/ham/multi/zigbee2mqtt.nix create mode 100644 makefu/2configs/ham/zigbee2mqtt/hass.nix diff --git a/makefu/2configs/ham/multi/zigbee2mqtt.nix b/makefu/2configs/ham/multi/zigbee2mqtt.nix deleted file mode 100644 index 84f2cc9d3..000000000 --- a/makefu/2configs/ham/multi/zigbee2mqtt.nix +++ /dev/null @@ -1,127 +0,0 @@ -# provides: -# switch -# automation -# binary_sensor -# sensor -# input_select -# timer -let - inherit (import ../lib) zigbee; - prefix = zigbee.prefix; -in { - sensor = - - [ - # Sensor for monitoring the bridge state - { - platform = "mqtt"; - name = "Zigbee2mqtt Bridge state"; - state_topic = "${prefix}/bridge/state"; - icon = "mdi:router-wireless"; - } - # Sensor for Showing the Zigbee2mqtt Version - { - platform = "mqtt"; - name = "Zigbee2mqtt Version"; - state_topic = "${prefix}/bridge/config"; - value_template = "{{ value_json.version }}"; - icon = "mdi:zigbee"; - } - # Sensor for Showing the Coordinator Version - { - platform = "mqtt"; - name = "Coordinator Version"; - state_topic = "${prefix}/bridge/config"; - value_template = "{{ value_json.coordinator }}"; - icon = "mdi:chip"; - } - ]; - switch = [ - { - platform = "mqtt"; - name = "Zigbee2mqtt Main join"; - state_topic = "${prefix}/bridge/config/permit_join"; - command_topic = "${prefix}/bridge/config/permit_join"; - payload_on = "true"; - payload_off = "false"; - } - ]; - automation = [ - { - alias = "Zigbee2mqtt Log Level"; - initial_state = "on"; - trigger = { - platform = "state"; - entity_id = "input_select.zigbee2mqtt_log_level"; - }; - action = [ - { - service = "mqtt.publish"; - data = { - payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}"; - topic = "${prefix}/bridge/config/log_level"; - }; - } - ]; - } -# Automation to start timer when enable join is turned on - { - id = "zigbee_join_enabled"; - alias = "Zigbee Join Enabled"; - trigger = - { - platform = "state"; - entity_id = "switch.zigbee2mqtt_main_join"; - to = "on"; - }; - action = - { - service = "timer.start"; - entity_id = "timer.zigbee_permit_join"; - }; - } -# # Automation to stop timer when switch turned off and turn off switch when timer finished - { - id = "zigbee_join_disabled"; - alias = "Zigbee Join Disabled"; - trigger = [ - { - platform = "event"; - event_type = "timer.finished"; - event_data.entity_id = "timer.zigbee_permit_join"; - } - { - platform = "state"; - entity_id = "switch.zigbee2mqtt_main_join"; - to = "off"; - } - ]; - action = [ - { service = "timer.cancel"; - data.entity_id = "timer.zigbee_permit_join"; - } - { service = "switch.turn_off"; - entity_id = "switch.zigbee2mqtt_main_join"; - } - ]; - } - ]; - input_select.zigbee2mqtt_log_level = - { - name = "Zigbee2mqtt Log Level"; - options = [ - "debug" - "info" - "warn" - "error" - ]; - initial = "info"; - icon = "mdi:format-list-bulleted"; - }; - - timer.zigbee_permit_join = - { - name = "Zigbee Time remaining"; - duration = 120; - }; -} diff --git a/makefu/2configs/ham/zigbee2mqtt/default.nix b/makefu/2configs/ham/zigbee2mqtt/default.nix index 84d32c872..36d332d42 100644 --- a/makefu/2configs/ham/zigbee2mqtt/default.nix +++ b/makefu/2configs/ham/zigbee2mqtt/default.nix @@ -1,21 +1,27 @@ {config, pkgs, lib, ...}: - -{ +let + dataDir = "/var/lib/zigbee2mqtt"; +in + { # symlink the zigbee controller services.udev.extraRules = '' - SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dailout" + SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" ''; - system.activationScripts.installZigbee = '' - install -d /var/lib/zigbee2mqtt - ''; + services.zigbee2mqtt = { + enable = true; + inherit dataDir; + }; + + state = [ "${dataDir}/configuration.yaml" "${dataDir}/state.json" ]; - docker-containers.zigbee2mqtt = { - image = "koenkk/zigbee2mqtt"; - extraDockerOptions = [ "--device=/dev/cc2531:/dev/cc2531" ]; - volumes = ["/var/lib/zigbee2mqtt:/app/data"]; + systemd.services.zigbee2mqtt = { + serviceConfig.ExecStartPre = lib.mkForce "${pkgs.coreutils}/bin/true"; + after = [ + "home-assistant.service" + "mosquitto.service" + "network-online.target" + ]; }; - state = [ "/var/lib/zigbee2mqtt/configuration.yaml" "/var/lib/zigbee2mqtt/state.json" ]; - systemd.services.docker-zigbee2mqtt.after = [ "home-assistant.service" "docker.service" "network-online.target" ]; } diff --git a/makefu/2configs/ham/zigbee2mqtt/hass.nix b/makefu/2configs/ham/zigbee2mqtt/hass.nix new file mode 100644 index 000000000..faf864ba6 --- /dev/null +++ b/makefu/2configs/ham/zigbee2mqtt/hass.nix @@ -0,0 +1,130 @@ +# provides: +# switch +# automation +# binary_sensor +# sensor +# input_select +# timer +let + inherit (import ../lib) zigbee; + prefix = zigbee.prefix; +in +{ + services.home-assistant.config = { + sensor = + + [ + # Sensor for monitoring the bridge state + { + platform = "mqtt"; + name = "Zigbee2mqtt Bridge state"; + state_topic = "${prefix}/bridge/state"; + icon = "mdi:router-wireless"; + } + # Sensor for Showing the Zigbee2mqtt Version + { + platform = "mqtt"; + name = "Zigbee2mqtt Version"; + state_topic = "${prefix}/bridge/config"; + value_template = "{{ value_json.version }}"; + icon = "mdi:zigbee"; + } + # Sensor for Showing the Coordinator Version + { + platform = "mqtt"; + name = "Coordinator Version"; + state_topic = "${prefix}/bridge/config"; + value_template = "{{ value_json.coordinator }}"; + icon = "mdi:chip"; + } + ]; + switch = [ + { + platform = "mqtt"; + name = "Zigbee2mqtt Main join"; + state_topic = "${prefix}/bridge/config/permit_join"; + command_topic = "${prefix}/bridge/config/permit_join"; + payload_on = "true"; + payload_off = "false"; + } + ]; + automation = [ + { + alias = "Zigbee2mqtt Log Level"; + initial_state = "on"; + trigger = { + platform = "state"; + entity_id = "input_select.zigbee2mqtt_log_level"; + }; + action = [ + { + service = "mqtt.publish"; + data = { + payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}"; + topic = "${prefix}/bridge/config/log_level"; + }; + } + ]; + } + # Automation to start timer when enable join is turned on + { + id = "zigbee_join_enabled"; + alias = "Zigbee Join Enabled"; + trigger = + { + platform = "state"; + entity_id = "switch.zigbee2mqtt_main_join"; + to = "on"; + }; + action = + { + service = "timer.start"; + entity_id = "timer.zigbee_permit_join"; + }; + } + # # Automation to stop timer when switch turned off and turn off switch when timer finished + { + id = "zigbee_join_disabled"; + alias = "Zigbee Join Disabled"; + trigger = [ + { + platform = "event"; + event_type = "timer.finished"; + event_data.entity_id = "timer.zigbee_permit_join"; + } + { + platform = "state"; + entity_id = "switch.zigbee2mqtt_main_join"; + to = "off"; + } + ]; + action = [ + { service = "timer.cancel"; + data.entity_id = "timer.zigbee_permit_join"; + } + { service = "switch.turn_off"; + entity_id = "switch.zigbee2mqtt_main_join"; + } + ]; + } + ]; + input_select.zigbee2mqtt_log_level = + { + name = "Zigbee2mqtt Log Level"; + options = [ + "debug" + "info" + "warn" + "error" + ]; + initial = "info"; + icon = "mdi:format-list-bulleted"; + }; + + timer.zigbee_permit_join = + { + name = "Zigbee Time remaining"; + duration = 120; + }; + }; +} -- cgit v1.3.1 From 78fc347be0a0b680bd39a72ac94418d211f5d777 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 22:23:33 +0100 Subject: ma ham: use new home-assistant merge function --- makefu/2configs/ham/automation/firetv_restart.nix | 52 ++--- makefu/2configs/ham/calendar/nextcloud.nix | 11 +- makefu/2configs/ham/default.nix | 66 ++----- makefu/2configs/ham/device_tracker/openwrt.nix | 23 ++- makefu/2configs/ham/multi/fliegen-couter.nix | 100 +++++----- makefu/2configs/ham/multi/kurzzeitwecker.nix | 223 +++++++++++----------- makefu/2configs/ham/multi/the_playlist.nix | 139 +++++++------- makefu/2configs/ham/sensor/outside.nix | 45 +++-- makefu/2configs/ham/zigbee2mqtt/osram.nix | 14 ++ 9 files changed, 342 insertions(+), 331 deletions(-) create mode 100644 makefu/2configs/ham/zigbee2mqtt/osram.nix diff --git a/makefu/2configs/ham/automation/firetv_restart.nix b/makefu/2configs/ham/automation/firetv_restart.nix index 1094d177f..9ae469872 100644 --- a/makefu/2configs/ham/automation/firetv_restart.nix +++ b/makefu/2configs/ham/automation/firetv_restart.nix @@ -7,27 +7,31 @@ let }; }; sec = seconds: { delay.seconds = seconds; }; -in [ - { - alias = "Nightly reboot of firetv"; - trigger = { - platform = "time"; - at = "03:00:00"; - }; - action = [ - (cmd "reboot") - (sec 90) # go to my music because apparently select_source does not seem to always work - (cmd "HOME") - (sec 2) - (cmd "DOWN") - (sec 2) - (cmd "DOWN") - (sec 2) - (cmd "ENTER") - (sec 4) - (cmd "RIGHT") - (sec 2) - (cmd "RIGHT") - ]; - } -] +in +{ + services.home-assistant.config.sensor = + [ + { + alias = "Nightly reboot of firetv"; + trigger = { + platform = "time"; + at = "03:00:00"; + }; + action = [ + (cmd "reboot") + (sec 90) # go to my music because apparently select_source does not seem to always work + (cmd "HOME") + (sec 2) + (cmd "DOWN") + (sec 2) + (cmd "DOWN") + (sec 2) + (cmd "ENTER") + (sec 4) + (cmd "RIGHT") + (sec 2) + (cmd "RIGHT") + ]; + } + ]; +} diff --git a/makefu/2configs/ham/calendar/nextcloud.nix b/makefu/2configs/ham/calendar/nextcloud.nix index 0be23ad7b..80e51b348 100644 --- a/makefu/2configs/ham/calendar/nextcloud.nix +++ b/makefu/2configs/ham/calendar/nextcloud.nix @@ -2,7 +2,12 @@ let cred = import ; in { - platform = "caldav"; - inherit (cred) username password; - url = "https://o.euer.krebsco.de/remote.php/dav"; + services.home-assistant.config.calendar = + [ + { + platform = "caldav"; + inherit (cred) username password; + url = "https://o.euer.krebsco.de/remote.php/dav"; + } + ]; } diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index 3a6d1952f..44a36c0ab 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -4,39 +4,27 @@ ## wake-on-lan server ## let - upkgs = (import {}).pkgs; - hlib = (import ./lib); - prefix = hlib.prefix; - tasmota = hlib.tasmota; + prefix = (import ./lib).prefix; firetv_stick = "192.168.1.24"; hassdir = "/var/lib/hass"; - zigbee = import ./multi/zigbee2mqtt.nix; - #flurlicht = import ./multi/flurlicht.nix; - kurzzeitwecker = import ./multi/kurzzeitwecker.nix; - firetv_restart = import ./multi/firetv_restart.nix; - the_playlist = import ./multi/the_playlist.nix; - fliegen-counter = import ./multi/fliegen-couter.nix; -# switch -# automation -# binary_sensor -# sensor -# input_select -# timer in { imports = [ ./mqtt.nix + ./zigbee2mqtt/default.nix + + # hass config + ./zigbee2mqtt/hass.nix + # ./multi/flurlicht.nix + ./multi/kurzzeitwecker.nix + ./multi/the_playlist.nix + ./multi/fliegen-couter.nix + ./device_tracker/openwrt.nix + ./sensor/outside.nix + ./calendar/nextcloud.nix + ./automation/firetv_restart.nix ]; services.home-assistant = { - package = (upkgs.home-assistant.overrideAttrs (old: { - doCheck = false; - checkPhase = ":"; - installCheckPhase = ":"; - })).override { - extraPackages = ps: with ps; [ - python-forecastio jsonrpc-async jsonrpc-websocket mpd2 pkgs.picotts androidtv - ]; - }; config = { influxdb = { database = "ham"; @@ -48,8 +36,6 @@ in { }; config = {}; - input_select = zigbee.input_select; # dict - timer = zigbee.timer // kurzzeitwecker.timer; # dict homeassistant = { name = "Home"; time_zone = "Europe/Berlin"; latitude = "48.7687"; @@ -60,12 +46,10 @@ in { conversation = {}; history = {}; logbook = {}; - counter = fliegen-counter.counter; logger = { default = "info"; }; - rest_command = {} - // the_playlist.rest_command; + rest_command = {}; tts = [ { platform = "google_translate"; language = "de"; @@ -81,7 +65,7 @@ in { # "platform": "broadcast", # "api_key": "", # talk to Botfather /newbot # "allowed_chat_ids": [ ID ] # curl -X GET # https://api.telegram.org/bot/getUpdates - #} + # } (builtins.fromJSON (builtins.readFile )) ]; @@ -101,7 +85,6 @@ in { ]; sun.elevation = 247; recorder = {}; - device_tracker = (import ./device_tracker/openwrt.nix); media_player = [ { platform = "FireTV Stick kodi"; host = firetv_stick; @@ -149,25 +132,12 @@ in { monitored_conditions = [ "ping" "download" "upload" ]; } # https://www.home-assistant.io/cookbook/automation_for_rainy_days/ - ] - ++ ((import ./sensor/outside.nix) {inherit lib;}) - ++ the_playlist.sensor - ++ zigbee.sensor ; + ]; frontend = { }; - calendar = [ (import ./calendar/nextcloud.nix) ]; - # light = flurlicht.light; http = { }; switch = []; - automation = [] - ++ (import ./automation/firetv_restart.nix) - ++ kurzzeitwecker.automation - #++ flurlicht.automation - ++ the_playlist.automation - ++ fliegen-counter.automation - ++ zigbee.automation; - script = - { } - // kurzzeitwecker.script; # dict + automation = []; + script = { }; }; enable = true; configDir = hassdir; diff --git a/makefu/2configs/ham/device_tracker/openwrt.nix b/makefu/2configs/ham/device_tracker/openwrt.nix index 8173fcfcb..0a34f702a 100644 --- a/makefu/2configs/ham/device_tracker/openwrt.nix +++ b/makefu/2configs/ham/device_tracker/openwrt.nix @@ -1,10 +1,13 @@ -[ - { platform = "luci"; - host = "192.168.1.5"; - username = "root"; - password = import ; - interval_seconds = 30; # instead of 12seconds - consider_home = 300; # 5 minutes timeout - new_device_defaults.track_new_devices = true; - } -] +{ + services.home-assistant.config.device_tracker = + [ + { platform = "luci"; + host = "192.168.1.5"; + username = "root"; + password = import ; + interval_seconds = 30; # instead of 12seconds + consider_home = 300; # 5 minutes timeout + new_device_defaults.track_new_devices = true; + } + ]; +} diff --git a/makefu/2configs/ham/multi/fliegen-couter.nix b/makefu/2configs/ham/multi/fliegen-couter.nix index d5c180e03..5b8abb2ff 100644 --- a/makefu/2configs/ham/multi/fliegen-couter.nix +++ b/makefu/2configs/ham/multi/fliegen-couter.nix @@ -15,53 +15,57 @@ let data.entity_id = "counter.${for}_fliegen"; }) incr; }; -in { - counter = { - felix_fliegen = {}; - misa_fliegen = {}; +in +{ + services.home-assistant.config = + { + counter = { + felix_fliegen = {}; + misa_fliegen = {}; + }; + automation = [ + (fly_swat "misa" "btn1" "single" 1) + (fly_swat "misa" "btn1" "double" 2) + (fly_swat "misa" "btn1" "triple" 3) + (fly_swat "felix" "btn2" "single" 1) + (fly_swat "felix" "btn2" "double" 2) + (fly_swat "felix" "btn2" "triple" 3) + { + alias = "Send Fly Counter Update"; + trigger = [ + { + platform = "state"; + entity_id = "counter.felix_fliegen"; + } + { + platform = "state"; + entity_id = "counter.misa_fliegen"; + #above = -1; + } + ]; + action = { + service = "mqtt.publish"; + data_template = { # gauge-style + payload = "{{ trigger.to_state.state }}"; + topic = "${hlib.prefix}/flycounter/{{ trigger.to_state.object_id }}"; + }; + }; + } + { + alias = "Reset Fly counters on midnight"; + trigger = { + platform = "time"; + at = "01:00:00"; + }; + action = [ + { service = "counter.reset"; + data.entity_id = "counter.misa_fliegen"; + } + { service = "counter.reset"; + data.entity_id = "counter.felix_fliegen"; + } + ]; + } + ]; }; - automation = [ - (fly_swat "misa" "btn1" "single" 1) - (fly_swat "misa" "btn1" "double" 2) - (fly_swat "misa" "btn1" "triple" 3) - (fly_swat "felix" "btn2" "single" 1) - (fly_swat "felix" "btn2" "double" 2) - (fly_swat "felix" "btn2" "triple" 3) - { - alias = "Send Fly Counter Update"; - trigger = [ - { - platform = "state"; - entity_id = "counter.felix_fliegen"; - } - { - platform = "state"; - entity_id = "counter.misa_fliegen"; - #above = -1; - } - ]; - action = { - service = "mqtt.publish"; - data_template = { # gauge-style - payload = "{{ trigger.to_state.state }}"; - topic = "${hlib.prefix}/flycounter/{{ trigger.to_state.object_id }}"; - }; - }; - } - { - alias = "Reset Fly counters on midnight"; - trigger = { - platform = "time"; - at = "01:00:00"; - }; - action = [ - { service = "counter.reset"; - data.entity_id = "counter.misa_fliegen"; - } - { service = "counter.reset"; - data.entity_id = "counter.felix_fliegen"; - } - ]; - } - ]; } diff --git a/makefu/2configs/ham/multi/kurzzeitwecker.nix b/makefu/2configs/ham/multi/kurzzeitwecker.nix index 03d0d5aac..bd81465cb 100644 --- a/makefu/2configs/ham/multi/kurzzeitwecker.nix +++ b/makefu/2configs/ham/multi/kurzzeitwecker.nix @@ -8,125 +8,128 @@ # notify.telegrambot let button = "sensor.zigbee_btn2_click"; -in { - timer.kurzzeitwecker = - { - name = "Zigbee Kurzzeitwecker"; - duration = 300; - }; - script.add_5_minutes_to_kurzzeitwecker = - { - alias = "Add 5 minutes to kurzzeitwecker"; - sequence = [ - { service = "timer.pause"; - entity_id = "timer.kurzzeitwecker"; - } - { service = "timer.start"; - data_template = { - entity_id = "timer.kurzzeitwecker"; - duration = '' - {% set r = state_attr('timer.kurzzeitwecker', 'remaining') ~ '-0000' %} - {% set t = strptime(r, '%H:%M:%S.%f%z') %} - {{ (as_timestamp(t) + 300) | timestamp_custom('%H:%M:%S', false) }} - ''; - }; - } - ]; - }; - automation = - [ +in +{ + services.home-assistant.config = { + timer.kurzzeitwecker = { - alias = "Start Timer 5min"; - trigger = { - platform = "state"; - entity_id = button; - to = "single"; - }; - condition = - { condition = "state"; - entity_id = "timer.kurzzeitwecker"; - state = "idle"; - }; - - action = [ - { service = "timer.start"; - entity_id = "timer.kurzzeitwecker"; - data.duration = "00:05:00"; - } - { - service = "notify.telegrambot"; - data.message = "Timer gestartet {{state_attr('timer.kurzzeitwecker', 'remaining') }}, verbleibend "; - } - ]; - } - { - alias = "Add Timer 5min"; - trigger = { - platform = "state"; - entity_id = button; - to = "single"; - }; - condition = - { condition = "state"; + name = "Zigbee Kurzzeitwecker"; + duration = 300; + }; + script.add_5_minutes_to_kurzzeitwecker = + { + alias = "Add 5 minutes to kurzzeitwecker"; + sequence = [ + { service = "timer.pause"; entity_id = "timer.kurzzeitwecker"; - state = "active"; + } + { service = "timer.start"; + data_template = { + entity_id = "timer.kurzzeitwecker"; + duration = '' + {% set r = state_attr('timer.kurzzeitwecker', 'remaining') ~ '-0000' %} + {% set t = strptime(r, '%H:%M:%S.%f%z') %} + {{ (as_timestamp(t) + 300) | timestamp_custom('%H:%M:%S', false) }} + ''; }; - - action = [ - { service = "homeassistant.turn_on"; - entity_id = "script.add_5_minutes_to_kurzzeitwecker"; - } - { - service = "notify.telegrambot"; - data.message = ''Timer um 5 minuten verlängert, {{ state_attr('timer.kurzzeitwecker', 'remaining') | truncate(9,True," ") }} verbleibend ''; } ]; - } - { - alias = "Stop timer on double click"; - trigger = [ - { + }; + automation = + [ + { + alias = "Start Timer 5min"; + trigger = { platform = "state"; entity_id = button; - to = "double"; - } - { + to = "single"; + }; + condition = + { condition = "state"; + entity_id = "timer.kurzzeitwecker"; + state = "idle"; + }; + + action = [ + { service = "timer.start"; + entity_id = "timer.kurzzeitwecker"; + data.duration = "00:05:00"; + } + { + service = "notify.telegrambot"; + data.message = "Timer gestartet {{state_attr('timer.kurzzeitwecker', 'remaining') }}, verbleibend "; + } + ]; + } + { + alias = "Add Timer 5min"; + trigger = { platform = "state"; entity_id = button; - to = "triple"; - } - ]; - condition = - { - condition = "state"; - entity_id = "timer.kurzzeitwecker"; - state = "active"; - }; + to = "single"; + }; + condition = + { condition = "state"; + entity_id = "timer.kurzzeitwecker"; + state = "active"; + }; - action = [ - { - service = "timer.cancel"; - entity_id = "timer.kurzzeitwecker"; - } - { - service = "notify.telegrambot"; - data.message = "Timer gestoppt, abgebrochen"; - } - ]; - } - { - alias = "Timer Finished"; - trigger = { - platform = "event"; - event_type = "timer.finished"; - event_data.entity_id = "timer.kurzzeitwecker"; - }; - action = [ + action = [ + { service = "homeassistant.turn_on"; + entity_id = "script.add_5_minutes_to_kurzzeitwecker"; + } + { + service = "notify.telegrambot"; + data.message = ''Timer um 5 minuten verlängert, {{ state_attr('timer.kurzzeitwecker', 'remaining') | truncate(9,True," ") }} verbleibend ''; + } + ]; + } + { + alias = "Stop timer on double click"; + trigger = [ + { + platform = "state"; + entity_id = button; + to = "double"; + } + { + platform = "state"; + entity_id = button; + to = "triple"; + } + ]; + condition = { - service = "notify.telegrambot"; - data.message = "Timer beendet"; - } - ]; - } - ]; + condition = "state"; + entity_id = "timer.kurzzeitwecker"; + state = "active"; + }; + + action = [ + { + service = "timer.cancel"; + entity_id = "timer.kurzzeitwecker"; + } + { + service = "notify.telegrambot"; + data.message = "Timer gestoppt, abgebrochen"; + } + ]; + } + { + alias = "Timer Finished"; + trigger = { + platform = "event"; + event_type = "timer.finished"; + event_data.entity_id = "timer.kurzzeitwecker"; + }; + action = [ + { + service = "notify.telegrambot"; + data.message = "Timer beendet"; + } + ]; + } + ]; + }; } diff --git a/makefu/2configs/ham/multi/the_playlist.nix b/makefu/2configs/ham/multi/the_playlist.nix index ad090938c..0d714ea44 100644 --- a/makefu/2configs/ham/multi/the_playlist.nix +++ b/makefu/2configs/ham/multi/the_playlist.nix @@ -7,77 +7,80 @@ # automation # sensor { - rest_command = { - good_song = { - url = "http://prism.r:8001/good"; - method = "POST"; - }; - bad_song = { - url = "http://prism.r:8001/skip"; - method = "POST"; - }; - }; - automation = [ - { - alias = "playlist song publish"; - trigger = { - #platform = "event"; - #event_data.entity_id = "sensor.the_playlist_song"; - platform = "state"; - entity_id = "sensor.the_playlist_song"; - }; - action = { - service = "mqtt.publish"; - data = { - topic = "/ham/the_playlist/song"; - payload_template = "{{ states.sensor.the_playlist_song.state }}"; - }; - }; - } - { - alias = "playlist upvote on button"; - trigger = { - platform = "state"; - entity_id = "binary_sensor.playlist_button_good"; - from = "off"; - to = "on"; + services.home-assistant.config = + { + rest_command = { + good_song = { + url = "http://prism.r:8001/good"; + method = "POST"; }; - action.service = "rest_command.good_song"; - } - { - alias = "playlist downvote on button"; - trigger = { - platform = "state"; - entity_id = "binary_sensor.playlist_button_bad"; - from = "off"; - to = "on"; + bad_song = { + url = "http://prism.r:8001/skip"; + method = "POST"; }; - action.service = "rest_command.bad_song"; - } - ]; - sensor = [ - { platform = "rest"; - name = "pl"; - resource = "http://prism.r:8001/current"; - scan_interval = 30; - value_template = "1"; - json_attributes = [ "name" "filename" "youtube" ]; - } - { platform = "template"; - sensors = { - the_playlist_song = { - friendly_name = "Current Song"; - value_template = ''{{ states.sensor.pl.attributes['name'] }}''; + }; + automation = [ + { + alias = "playlist song publish"; + trigger = { + #platform = "event"; + #event_data.entity_id = "sensor.the_playlist_song"; + platform = "state"; + entity_id = "sensor.the_playlist_song"; }; - the_playlist_url = { - friendly_name = "Song Youtube URL"; - value_template = ''{{ states.sensor.pl.attributes['youtube'] }}''; + action = { + service = "mqtt.publish"; + data = { + topic = "/ham/the_playlist/song"; + payload_template = "{{ states.sensor.the_playlist_song.state }}"; + }; }; - the_playlist_filename = { - friendly_name = "Song Filename"; - value_template = ''{{ states.sensor.pl.attributes['filename'] }}''; + } + { + alias = "playlist upvote on button"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.playlist_button_good"; + from = "off"; + to = "on"; }; - }; - } - ]; + action.service = "rest_command.good_song"; + } + { + alias = "playlist downvote on button"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.playlist_button_bad"; + from = "off"; + to = "on"; + }; + action.service = "rest_command.bad_song"; + } + ]; + sensor = [ + { platform = "rest"; + name = "pl"; + resource = "http://prism.r:8001/current"; + scan_interval = 30; + value_template = "1"; + json_attributes = [ "name" "filename" "youtube" ]; + } + { platform = "template"; + sensors = { + the_playlist_song = { + friendly_name = "Current Song"; + value_template = ''{{ states.sensor.pl.attributes['name'] }}''; + }; + the_playlist_url = { + friendly_name = "Song Youtube URL"; + value_template = ''{{ states.sensor.pl.attributes['youtube'] }}''; + }; + the_playlist_filename = { + friendly_name = "Song Filename"; + value_template = ''{{ states.sensor.pl.attributes['filename'] }}''; + }; + }; + } + ]; + }; } diff --git a/makefu/2configs/ham/sensor/outside.nix b/makefu/2configs/ham/sensor/outside.nix index c46b35ba3..332746be8 100644 --- a/makefu/2configs/ham/sensor/outside.nix +++ b/makefu/2configs/ham/sensor/outside.nix @@ -1,20 +1,25 @@ -{lib,...}: [ - { platform = "darksky"; - api_key = lib.removeSuffix "\n" - (builtins.readFile ); - language = "de"; - monitored_conditions = [ - "summary" "icon" - "nearest_storm_distance" "precip_probability" - "precip_intensity" - "temperature" # "temperature_high" "temperature_low" - "apparent_temperature" - "hourly_summary" # next 24 hours text - "humidity" - "pressure" - "uv_index" - ]; - units = "si" ; - scan_interval = "00:30:00"; - } - ] +{lib,...}: + +{ + services.home-assistant.config.sensor = + [ + { platform = "darksky"; + api_key = lib.removeSuffix "\n" + (builtins.readFile ); + language = "de"; + monitored_conditions = [ + "summary" "icon" + "nearest_storm_distance" "precip_probability" + "precip_intensity" + "temperature" # "temperature_high" "temperature_low" + "apparent_temperature" + "hourly_summary" # next 24 hours text + "humidity" + "pressure" + "uv_index" + ]; + units = "si" ; + scan_interval = "00:30:00"; + } + ]; +} diff --git a/makefu/2configs/ham/zigbee2mqtt/osram.nix b/makefu/2configs/ham/zigbee2mqtt/osram.nix new file mode 100644 index 000000000..d1bf2b296 --- /dev/null +++ b/makefu/2configs/ham/zigbee2mqtt/osram.nix @@ -0,0 +1,14 @@ +{ + + +availability_topic: /ham/zigbee/bridge/state +command_topic: /ham/zigbee/flur_arbeitszimmer_osram2/set + + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.battery_low}}" + device_class: "battery" +} -- cgit v1.3.1 From 266e2ee5195587832b73806f625d4f892c13a527 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 22:26:41 +0100 Subject: ma zigbee2mqtt: add comment about mkForce --- makefu/2configs/ham/zigbee2mqtt/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/2configs/ham/zigbee2mqtt/default.nix b/makefu/2configs/ham/zigbee2mqtt/default.nix index 36d332d42..a75075273 100644 --- a/makefu/2configs/ham/zigbee2mqtt/default.nix +++ b/makefu/2configs/ham/zigbee2mqtt/default.nix @@ -17,6 +17,7 @@ in state = [ "${dataDir}/configuration.yaml" "${dataDir}/state.json" ]; systemd.services.zigbee2mqtt = { + # override automatic configuration.yaml deployment serviceConfig.ExecStartPre = lib.mkForce "${pkgs.coreutils}/bin/true"; after = [ "home-assistant.service" -- cgit v1.3.1 From f4ea172e1ff873f7311beeac9eb0b4a86f97c76a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:03:29 +0100 Subject: ma ham/firetv_restart: fix typo --- makefu/2configs/ham/automation/firetv_restart.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/ham/automation/firetv_restart.nix b/makefu/2configs/ham/automation/firetv_restart.nix index 9ae469872..12e0e845a 100644 --- a/makefu/2configs/ham/automation/firetv_restart.nix +++ b/makefu/2configs/ham/automation/firetv_restart.nix @@ -9,7 +9,7 @@ let sec = seconds: { delay.seconds = seconds; }; in { - services.home-assistant.config.sensor = + services.home-assistant.config.automation = [ { alias = "Nightly reboot of firetv"; -- cgit v1.3.1 From 6a8a7781bcbeeee23354e7caaeb8ecd80fc00218 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:21:06 +0100 Subject: ma snapraid module: fix warning about string --- makefu/3modules/snapraid.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/3modules/snapraid.nix b/makefu/3modules/snapraid.nix index 9c7854787..1a2c08475 100644 --- a/makefu/3modules/snapraid.nix +++ b/makefu/3modules/snapraid.nix @@ -86,7 +86,7 @@ let ''; }; extraConfig = mkOption { - type = types.string; + type = types.lines; default = ""; description = '' Extra configuration to be appended to the snapraid conf file. -- cgit v1.3.1 From c5a1724aa6332a31113ee1a9f0b3bc4741b966b2 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:49:07 +0100 Subject: ma pkgs.hactool: rip --- makefu/5pkgs/hactool/default.nix | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 makefu/5pkgs/hactool/default.nix diff --git a/makefu/5pkgs/hactool/default.nix b/makefu/5pkgs/hactool/default.nix deleted file mode 100644 index 0bdaeb4be..000000000 --- a/makefu/5pkgs/hactool/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, stdenv, fetchFromGitHub -}: -stdenv.mkDerivation rec { - pname = "hactool"; - name = "${pname}-${version}"; - version = "1.4.0"; - - src = fetchFromGitHub { - owner = "SciresM"; - repo = "hactool"; - rev = version; - sha256 = "0305ngsnwm8npzgyhyifasi4l802xnfz19r0kbzzniirmcn4082d"; - }; - preBuild = '' - cp config.mk.template config.mk - ''; - installPhase = '' - install -D hactool $out/bin/hactool - ''; - buildInputs = [ ]; - nativeBuildInputs = [ ]; - - meta = { - description = "tool to view information about, decrypt, and extract common file formats for the Nintendo Switch, especially Nintendo Content Archives"; - homepage = https://github.com/SciresM/hactool; - license = stdenv.lib.licenses.isc; - platforms = stdenv.lib.platforms.linux; - maintainers = with stdenv.lib.maintainers; [ makefu ]; - }; -} -- cgit v1.3.1 From 5aa56f0b46ce55fc783990727828d9a8afc520cc Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:52:00 +0100 Subject: ma gui/base: fix warnings --- makefu/2configs/gui/base.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/makefu/2configs/gui/base.nix b/makefu/2configs/gui/base.nix index 9c1d560a0..f991f7649 100644 --- a/makefu/2configs/gui/base.nix +++ b/makefu/2configs/gui/base.nix @@ -31,8 +31,10 @@ in awesome.luaModules = [ pkgs.luaPackages.vicious ]; }; displayManager.defaultSession = lib.mkDefault "none+awesome"; - displayManager.lightdm = { enable = true; autoLogin.enable = true; autoLogin.user = mainUser; }; - desktopManager.xterm.enable = false; + displayManager.autoLogin = { + enable = true; + user = mainUser; + }; }; environment.systemPackages = [ pkgs.gnome3.defaultIconTheme ]; # lid switch is handled via button presses -- cgit v1.3.1 From e41da87fc0e81b85357e033394a0d7d71224f0ec Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:54:52 +0100 Subject: ma default: remove double-defined tmp --- makefu/2configs/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index beba0ac8c..695e8fee6 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -43,9 +43,6 @@ with import ; boot.tmpOnTmpfs = true; - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" - ]; environment.systemPackages = with pkgs; [ jq -- cgit v1.3.1 From 63b119a4b319ffeb5a7c7e72e5d04e5ea4bf083b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:57:02 +0100 Subject: ma omo.r: zigbee2mqtt is included via ham --- makefu/1systems/omo/config.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index cbe97e28a..a9e307ddf 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -92,7 +92,6 @@ in { - { makefu.ps3netsrv = { enable = true; -- cgit v1.3.1 From c20d3cb51ceefb699832c7436fd99baa0e018145 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:57:33 +0100 Subject: ma editor/vim: use py3k for youcompleteme support --- makefu/2configs/editor/vim.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/makefu/2configs/editor/vim.nix b/makefu/2configs/editor/vim.nix index 2277ed3a3..5751bf489 100644 --- a/makefu/2configs/editor/vim.nix +++ b/makefu/2configs/editor/vim.nix @@ -3,10 +3,8 @@ { environment.systemPackages = [ - pkgs.python27Full # required for youcompleteme - (pkgs.vim_configurable.customize { + ((pkgs.vim_configurable.override { python = pkgs.python3; }).customize { name = "vim"; - vimrcConfig.customRC = builtins.readFile ./vimrc; vimrcConfig.vam.knownPlugins = pkgs.vimPlugins; vimrcConfig.vam.pluginDictionaries = [ -- cgit v1.3.1 From 7117223d68adac92317b6ee700c9a1c19c66b573 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:57:59 +0100 Subject: ma ham/light/groups: init --- makefu/2configs/ham/default.nix | 6 ++++++ makefu/2configs/ham/light/groups.nix | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 makefu/2configs/ham/light/groups.nix diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index 44a36c0ab..9e3f7f669 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -18,10 +18,16 @@ in { ./multi/kurzzeitwecker.nix ./multi/the_playlist.nix ./multi/fliegen-couter.nix + ./device_tracker/openwrt.nix + ./sensor/outside.nix + ./calendar/nextcloud.nix + ./automation/firetv_restart.nix + + ./light/groups.nix ]; services.home-assistant = { diff --git a/makefu/2configs/ham/light/groups.nix b/makefu/2configs/ham/light/groups.nix new file mode 100644 index 000000000..e1812b68a --- /dev/null +++ b/makefu/2configs/ham/light/groups.nix @@ -0,0 +1,41 @@ +let + arbeitszimmer_licht = [ + "light.led_wand" + "light.arbeitszimmer_led1_led_strip" # LED-Kreis in cube + "light.arbeitszimmer_flur_osram_light" + "light.arbeitszimmer_schrank_dimmer_light" + "light.arbeitszimmer_schrank_osram_light" + ]; + wohnzimmer_licht = [ + "light.wohnzimmer_fernseher_led_strip" # led um fernseher + "light.wohnzimmer_komode_osram_light" + "light.wohnzimmer_schrank_osram_light" + "light.wohnzimmer_stehlampe_osram_light" + ]; + schlafzimmer_licht = [ + "schlafzimmer_komode_osram_light" + ]; +in { + services.home-assistant.config.light = [ + { + platform = "group"; + name = "Arbeitszimmer Lichter"; + entities = arbeitszimmer_licht; + } + { + platform = "group"; + name = "Wohnzimmer Lichter"; + entities = wohnzimmer_licht; + } + { + platform = "group"; + name = "Schlafzimmer Lichter"; + entities = schlafzimmer_licht; + } + { + platform = "group"; + name = "Alle Lichter"; + entities = arbeitszimmer_licht ++ wohnzimmer_licht ++ schlafzimmer_licht; + } + ]; +} -- cgit v1.3.1 From b26b6c4ccedfc6f92193dd7386e382d0bf88a293 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 18 Nov 2020 23:58:18 +0100 Subject: ma hw: tlp.extraConfig -> tlp.settings --- makefu/2configs/hw/tp-x2x0.nix | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index b997a9eec..8d3e17c7f 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -38,20 +38,17 @@ }; services.tlp.enable = true; - services.tlp.extraConfig = '' + services.tlp.settings = { # BUG: http://linrunner.de/en/tlp/docs/tlp-faq.html#erratic-battery - START_CHARGE_THRESH_BAT0=95 - STOP_CHARGE_THRESH_BAT0=100 - - - CPU_SCALING_GOVERNOR_ON_AC=performance - CPU_SCALING_GOVERNOR_ON_BAT=ondemand - CPU_MIN_PERF_ON_AC=0 - CPU_MAX_PERF_ON_AC=100 - CPU_MIN_PERF_ON_BAT=0 - CPU_MAX_PERF_ON_BAT=30 - ''; - + START_CHARGE_THRESH_BAT0 = 95; + STOP_CHARGE_THRESH_BAT0 = 100; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "ondemand"; + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 30; + }; powerManagement.resumeCommands = '' ${pkgs.utillinux}/bin/rfkill unblock all -- cgit v1.3.1 From 98de93f009b0ae5f07585185efc0c8d5e3fd666f Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 19 Nov 2020 18:49:04 +0100 Subject: remove deprecated hass module --- lass/2configs/default.nix | 1 + lass/2configs/hass/default.nix | 2 +- lass/2configs/hass/rooms/bett.nix | 62 +++++++++++++++++++------------------- lass/2configs/hass/rooms/essen.nix | 2 +- lass/2configs/hass/rooms/nass.nix | 2 +- lass/2configs/hass/zigbee.nix | 2 +- lass/3modules/default.nix | 1 - lass/3modules/hass.nix | 51 ------------------------------- 8 files changed, 36 insertions(+), 87 deletions(-) delete mode 100644 lass/3modules/hass.nix diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index babcb51de..81c813b97 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -222,4 +222,5 @@ with import ; # use 24:00 time format, the default got sneakily changed around 20.03 i18n.defaultLocale = mkDefault "C.UTF-8"; + system.stateVersion = lib.mkDefault "20.03"; } diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix index 66d430cd1..78379ba1c 100644 --- a/lass/2configs/hass/default.nix +++ b/lass/2configs/hass/default.nix @@ -26,7 +26,7 @@ with import ./lib.nix { inherit lib; }; lovelaceConfigWritable = true; }; - lass.hass.config = let + services.home-assistant.config = let tasmota_s20 = name: topic: { platform = "mqtt"; inherit name; diff --git a/lass/2configs/hass/rooms/bett.nix b/lass/2configs/hass/rooms/bett.nix index 16227fcb6..48a1f72d7 100644 --- a/lass/2configs/hass/rooms/bett.nix +++ b/lass/2configs/hass/rooms/bett.nix @@ -2,38 +2,38 @@ with import ../lib.nix { inherit lib; }; { - lass.hass.config = lib.mkMerge [ + services.home-assistant.config = lib.mkMerge [ (lightswitch switches.dimmer.bett lights.bett) ]; - lass.hass.love = { - resources = [{ - url = "https://raw.githubusercontent.com/ljmerza/light-entity-card/master/dist/light-entity-card.js.map"; - type = "js"; - }]; - views = [{ - title = "bett"; - cards = [ - { - type = "markdown"; - title = "hello world"; - content = "This is just a test"; - } - { - type = "light"; - entity = "light.${lights.bett}"; - } - { - type = "custom:light-entity-card"; - entity = "light.${lights.bett}"; - } - { - type = "history-graph"; - entities = [ - "light.${lights.bett}" - ]; - } - ]; - }]; - }; + # lass.hass.love = { + # resources = [{ + # url = "https://raw.githubusercontent.com/ljmerza/light-entity-card/master/dist/light-entity-card.js.map"; + # type = "js"; + # }]; + # views = [{ + # title = "bett"; + # cards = [ + # { + # type = "markdown"; + # title = "hello world"; + # content = "This is just a test"; + # } + # { + # type = "light"; + # entity = "light.${lights.bett}"; + # } + # { + # type = "custom:light-entity-card"; + # entity = "light.${lights.bett}"; + # } + # { + # type = "history-graph"; + # entities = [ + # "light.${lights.bett}" + # ]; + # } + # ]; + # }]; + # }; } diff --git a/lass/2configs/hass/rooms/essen.nix b/lass/2configs/hass/rooms/essen.nix index f74996154..eeb3d30d2 100644 --- a/lass/2configs/hass/rooms/essen.nix +++ b/lass/2configs/hass/rooms/essen.nix @@ -2,7 +2,7 @@ with import ../lib.nix { inherit lib; }; { - lass.hass.config = lib.mkMerge [ + services.home-assistant.config = lib.mkMerge [ (detect_movement sensors.movement.essen lights.essen 10) (lightswitch switches.dimmer.essen lights.essen) ]; diff --git a/lass/2configs/hass/rooms/nass.nix b/lass/2configs/hass/rooms/nass.nix index 163f4fc48..7e6298738 100644 --- a/lass/2configs/hass/rooms/nass.nix +++ b/lass/2configs/hass/rooms/nass.nix @@ -2,7 +2,7 @@ with import ../lib.nix { inherit lib; }; { - lass.hass.config = lib.mkMerge [ + services.home-assistant.config = lib.mkMerge [ (detect_movement sensors.movement.nass lights.nass 100) (lightswitch switches.dimmer.nass lights.nass) ]; diff --git a/lass/2configs/hass/zigbee.nix b/lass/2configs/hass/zigbee.nix index 6d091066e..b2a221e49 100644 --- a/lass/2configs/hass/zigbee.nix +++ b/lass/2configs/hass/zigbee.nix @@ -35,7 +35,7 @@ in { volumes = ["/var/lib/zigbee2mqtt:/app/data"]; }; - lass.hass.config = { + services.home-assistant.config = { sensor = [ # Sensor for monitoring the bridge state { diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix index 335658ed8..c3c73bdcb 100644 --- a/lass/3modules/default.nix +++ b/lass/3modules/default.nix @@ -4,7 +4,6 @@ _: ./dnsmasq.nix ./ejabberd ./folderPerms.nix - ./hass.nix ./hosts.nix ./klem.nix ./mysql-backup.nix diff --git a/lass/3modules/hass.nix b/lass/3modules/hass.nix deleted file mode 100644 index 96521aaa9..000000000 --- a/lass/3modules/hass.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ config, lib, pkgs, ... }: -with import ; -let - - cfg = config.lass.hass; - -in { - options.lass.hass = { - config = mkOption { - default = {}; - type = with lib.types; let - valueType = nullOr (oneOf [ - bool - int - float - str - (attrsOf valueType) - (listOf valueType) - ]) // { - description = "Yaml value"; - emptyValue.value = {}; - }; - in valueType; - }; - love = mkOption { - default = {}; - type = with lib.types; let - valueType = nullOr (oneOf [ - bool - int - float - str - (attrsOf valueType) - (listOf valueType) - ]) // { - description = "Yaml value"; - emptyValue.value = {}; - }; - in valueType; - }; - }; - - config = - assert versionOlder version "20.09"; - mkIf (cfg.config != {}) - { - services.home-assistant.config = cfg.config; - # services.home-assistant.lovelaceConfig = cfg.love; - }; -} - -- cgit v1.3.1 From e2ecd1df6dc515b95dc9656aede57443c1952a92 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 19 Nov 2020 19:13:49 +0100 Subject: l: fix lib usage --- lass/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index 81c813b97..1cf421fed 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -222,5 +222,5 @@ with import ; # use 24:00 time format, the default got sneakily changed around 20.03 i18n.defaultLocale = mkDefault "C.UTF-8"; - system.stateVersion = lib.mkDefault "20.03"; + system.stateVersion = mkDefault "20.03"; } -- cgit v1.3.1 From e509e9fb80f2d62667be23b21e002e658ae38dda Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Tue, 10 Nov 2020 21:25:58 +0100 Subject: mic92: add loki.r alias to rock.r --- krebs/3modules/external/mic92.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 39d738337..433ed6a3d 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -347,7 +347,10 @@ in { nets = { retiolum = { ip4.addr = "10.243.29.171"; - aliases = [ "rock.r" ]; + aliases = [ + "rock.r" + "loki.r" + ]; tinc.pubkey = '' -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0uhNk3XXVxQcIVhD1Ime -- cgit v1.3.1 From c334743d6f3d4618025e100f336ece3ef5dc549d Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Thu, 19 Nov 2020 23:27:20 +0100 Subject: mic92: add bernie --- krebs/3modules/external/mic92.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 433ed6a3d..57a9cc63b 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -511,5 +511,33 @@ in { }; }; }; + bernie = { + owner = config.krebs.users.mic92; + nets = rec { + retiolum = { + addrs = [ + config.krebs.hosts.doctor.nets.retiolum.ip4.addr + config.krebs.hosts.doctor.nets.retiolum.ip6.addr + ]; + ip4.addr = "10.243.29.169"; + aliases = [ "bernie.r" ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIICCgKCAgEApH5nG/Lwe/LiBkdL38vk1QcjOG/kf8dUqifouB56OQqe+MXASTSM + vhipszZqXVGgWRVrSH3WSZt0YAXTQQGEjtnAr6fSSnUek21omRGFgr47LiGJp9R8 + OuhGPQs1sykIyl3HNSvDxj2EfWrXO73bKQPYdGIlfJWmsL69akWGlyYdEK1kloLC + ld5+eYICjiTtqAQ8snZQNaPIucW4cGOa0sATUP4H1jbDWtFCKE2/mR/gGo/W/opC + oOcJM7d5mb63blWVp9Zji/Gb64QltR50N3qvwc6W5ANHXIV97jYcNhSGqTsV0CEd + n0cqUqymh2e8fJdmbB4DvwqhWITn6nwuFOWoVCSFMmbiidyTm3RAH9ztZARzsQRL + Nj8OmeAr+plrzNH7AJpSkz30zukawCnbt+qWjqXLULH4kxJfOwzVh+KDfLzy7iLe + OWWrblgJZA2GHKzCC5zntNujW6Nr2AliSY2Hch2XfkLTWeNtclKIEXMkRxif5oxm + XpEJJ3lqdXz9/e37R/mkWVrdhpVfll2/v5c/PlnKMzky2mgkGpzegO0IiQcdJjrl + fuXAsh5UbnE5kt6vKL5aducScatyd5FRkNumKG5ji26eZR4lZmXn380JLDInV4n7 + SODZL2fQFBnSD1wTWcq9Q/luPh4FitzJUZzHexvNxR/KBZycZJtdVw8CAwEAAQ== + -----END RSA PUBLIC KEY----- + ''; + }; + }; + }; }; } -- cgit v1.3.1 From d9dfd892bfd410afad5722363c9f297ad4075175 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Thu, 19 Nov 2020 23:36:52 +0100 Subject: mic92: improve tinc cross-compiling --- krebs/3modules/tinc.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 0f5e1aa83..4252c8d3b 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -112,13 +112,15 @@ let hostsArchive = mkOption { type = types.package; - default = pkgs.runCommand "retiolum-hosts.tar.bz2" {} '' + default = pkgs.runCommand "retiolum-hosts.tar.bz2" { + nativeBuildInputs = [ pkgs.gnutar pkgs.coreutils ]; + } '' cp \ --no-preserve=mode \ --recursive \ ${tinc.config.hostsPackage} \ hosts - ${pkgs.gnutar}/bin/tar -cjf $out hosts + tar -cjf $out hosts ''; readOnly = true; }; -- cgit v1.3.1 From 9ebbea467b2e8c022f694721bda3bfa2a0794cb1 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Thu, 19 Nov 2020 23:27:20 +0100 Subject: mic92: fix bernie tinc address --- krebs/3modules/external/mic92.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 57a9cc63b..269c540bf 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -516,8 +516,8 @@ in { nets = rec { retiolum = { addrs = [ - config.krebs.hosts.doctor.nets.retiolum.ip4.addr - config.krebs.hosts.doctor.nets.retiolum.ip6.addr + config.krebs.hosts.bernie.nets.retiolum.ip4.addr + config.krebs.hosts.bernie.nets.retiolum.ip6.addr ]; ip4.addr = "10.243.29.169"; aliases = [ "bernie.r" ]; -- cgit v1.3.1 From 636d1eb762aae20e1da580d6f37460aa25391f45 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Nov 2020 11:32:23 +0100 Subject: l: init styx.r --- krebs/3modules/lass/default.nix | 39 ++++++++++++++++++++ lass/1systems/styx/config.nix | 80 +++++++++++++++++++++++++++++++++++++++++ lass/1systems/styx/physical.nix | 34 ++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 lass/1systems/styx/config.nix create mode 100644 lass/1systems/styx/physical.nix diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index d2a945284..3466ef8eb 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -645,6 +645,45 @@ in { ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPARXXe0HaP1r0pLqtInhnbYSZsP0g4VC6aaWP7qi5+w"; syncthing.id = "J6PHKTS-2JG5NOL-H5ZWOF6-6L6ENA7-L4RO6DV-BQHU7YL-CHOLDCC-S5YX3AC"; }; + styx = { + cores = 1; + nets = { + retiolum = { + ip4.addr = "10.243.11.1"; + ip6.addr = r6 "111"; + aliases = [ + "styx.r" + ]; + tinc.pubkey = '' + -----BEGIN PUBLIC KEY----- + MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuMJFklzpbxoDGD8LQ3tn + ETYrLu/TJjq5iSQx/JbbonJriMS3X/0+m8JREzeol67svQDuZEXTEg5EfEldxrrU + aZpNmTSmFbj2NLLCIfNBL/oLOvg9ElzhN+f+4jvakfEKi7Y7LekV25VVGrHbOEVE + 3G6XWfHx5qO5Vd6kqNWQKD3LG38aZ/Lx9XYDMbujYxPGCtOsabtAz8BKo/RgOZzi + 6A/54RFhdecJm0VoQk3iKpp2YqyCN6dLfJVLil4cREs4sW6nDyF4Y4l3dtZdfskq + m/MoZt6fwOjNIKuI9DGdU4/X1hQelnemstzxY5x1XwG52cz+ww0h7pMF2aggsHqn + Vmaq3b0fXrbn066Ybkbhz3UEIU9zKQGYaANGCnXxbvkd5lWbIN60GEXGE3zYJSAt + EH3FLDTGa27fTNgAnbdnSV40KWKN4FM0iY/xrt3aOXfneTP9S2fqzTVEL9vd04C/ + 7RWvRjvZ7mlAi+kVKSHkOibFVjeo+Z4Pvw5YxCAavrjXCiWj8zP8o3MNWcq/bMao + Uk9zBMXymm8zX43w5LNnhf59oitBjiY/mzZ3NDI9N3szMvJsaUEnhO4Kq1CWtMs2 + 6/TpEyRSmen1UmNwgKKFx3rELuctwMmNbOLL8cGLotEBhIk7vnZKD7NvLVX7xtOF + wzhy2N6a3ypB4XqM7dBzzAUCAwEAAQ== + -----END PUBLIC KEY----- + ''; + }; + wiregrill = { + ip6.addr = w6 "111"; + aliases = [ + "styx.w" + ]; + wireguard.pubkey = '' + 0BZfd8f0pZMRfyoHrdYZY0cR5zfFvJcS8gQLn6xGuFs= + ''; + }; + }; + ssh.privkey.path = ; + ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII3OpzRB3382d7c2apdHC+U/R0ZlaWxXZa3GFAj54ZhU "; + }; }; users = rec { lass = lass-blue; diff --git a/lass/1systems/styx/config.nix b/lass/1systems/styx/config.nix new file mode 100644 index 000000000..4c3ae1411 --- /dev/null +++ b/lass/1systems/styx/config.nix @@ -0,0 +1,80 @@ +{ config, pkgs, ... }: + +with import ; +{ + imports = [ + + + + + + + + + + # + # + # + + + # + # + # + ]; + + krebs.build.host = config.krebs.hosts.styx; + + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-p tcp --dport ${toString config.services.smokeping.port}"; target = "ACCEPT"; } + ]; + services.smokeping = { + enable = true; + targetConfig = '' + probe = FPing + menu = top + title = top + + + Local + menu = Local + title = Local Network + ++ LocalMachine + menu = Local Machine + title = This host + host = localhost + + + Internet + menu = internet + title = internet + + ++ CloudflareDNS + menu = Cloudflare DNS + title = Cloudflare DNS server + host = 1.1.1.1 + + ++ GoogleDNS + menu = Google DNS + title = Google DNS server + host = 8.8.8.8 + + + retiolum + menu = retiolum + title = retiolum + + ++ gum + menu = gum.r + title = gum.r + host = gum.r + + ++ ni + menu = ni.r + title = ni.r + host = ni.r + + ++ prism + menu = prism.r + title = prism.r + host = prism.r + ''; + }; +} + diff --git a/lass/1systems/styx/physical.nix b/lass/1systems/styx/physical.nix new file mode 100644 index 000000000..a3899f87d --- /dev/null +++ b/lass/1systems/styx/physical.nix @@ -0,0 +1,34 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./config.nix + + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.loader.grub.enable = true; + boot.loader.grub.efiSupport = true; + boot.loader.grub.device = "/dev/disk/by-id/ata-SanDisk_SSD_G5_BICS4_20248F446514"; + boot.loader.grub.efiInstallAsRemovable = true; + + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ee5c9099-17fa-401e-852e-67cb4ae068f4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/EAA5-88A9"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} -- cgit v1.3.1 From 6236a97876597e9689ab3ea6436c42d3da04368d Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Mon, 23 Nov 2020 16:55:28 +0100 Subject: add alertmanager.r --- krebs/3modules/external/mic92.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/3modules/external/mic92.nix b/krebs/3modules/external/mic92.nix index 269c540bf..29d0b27fa 100644 --- a/krebs/3modules/external/mic92.nix +++ b/krebs/3modules/external/mic92.nix @@ -468,6 +468,7 @@ in { aliases = [ "eva.r" "prometheus.r" + "alertmanager.r" ]; tinc.pubkey = '' -----BEGIN PUBLIC KEY----- -- cgit v1.3.1 From b6ec091cba1ed31dc7c7d1fcb512547a359e0b59 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 23 Nov 2020 21:03:43 +0100 Subject: nixpkgs-unstable: 34ad166 -> a322b32 --- krebs/nixpkgs-unstable.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index 9ea1d4141..aa78bef29 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,7 +1,10 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "34ad166a830d3ac1541dcce571c52231f2f0865a", - "date": "2020-11-02T21:18:15-05:00", - "sha256": "1jvi1562x3kq65w642vfimpszv65zbc7c2nv8gakhzcx4n3f47xq", - "fetchSubmodules": false + "rev": "a322b32e9d74fb476944ff6cfb55833dc69cfaaa", + "date": "2020-11-19T01:15:20+01:00", + "path": "/nix/store/cgb65l8rr7v7dd4hk5sv05bnmqkcgl0n-nixpkgs", + "sha256": "1r0mkiqxija75spnyksmh8x5j4smnrxv5f7768s81gsl570kls0l", + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false } -- cgit v1.3.1 From ff1d896c8d436cdc83f60f7df7203f38f03fceac Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Tue, 24 Nov 2020 10:25:37 +0100 Subject: mic92: add shannan --- krebs/3modules/external/default.nix | 4 ++++ krebs/3modules/external/ssh/shannan.pub | 1 + lass/1systems/prism/config.nix | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 krebs/3modules/external/ssh/shannan.pub diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index d14526703..277169e11 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -608,6 +608,10 @@ in { mail = "joerg@thalheim.io"; pubkey = ssh-for "mic92"; }; + shannan = { + mail = "shannan@lekwati.com"; + pubkey = ssh-for "shannan"; + }; qubasa = { mail = "luis.nixos@gmail.com"; pubkey = ssh-for "qubasa"; diff --git a/krebs/3modules/external/ssh/shannan.pub b/krebs/3modules/external/ssh/shannan.pub new file mode 100644 index 000000000..ed89d702a --- /dev/null +++ b/krebs/3modules/external/ssh/shannan.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOBXTForyB6oNMK5bbGpALKU4lPsKRGxNLhrE/PnHHq7 shannan@bernie diff --git a/lass/1systems/prism/config.nix b/lass/1systems/prism/config.nix index 944a68beb..1206f1655 100644 --- a/lass/1systems/prism/config.nix +++ b/lass/1systems/prism/config.nix @@ -391,6 +391,15 @@ with import ; { predicate = "-i wiregrill -p udp --dport 4000:4002"; target = "ACCEPT"; } ]; } + { + users.users.shannan = { + uid = genid_uint31 "shannan"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + config.krebs.users.shannan.pubkey + ]; + }; + } { nix.trustedUsers = [ "mic92" ]; users.users.mic92 = { -- cgit v1.3.1