From 5a8eb7998b737a9a7e906d57ffe4e5a1ca0a18f1 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 17 Sep 2024 21:47:25 +0200 Subject: [PATCH 01/49] Add ntp service --- hosts/aluminium/services/default.nix | 1 + hosts/aluminium/services/dnsmasq.nix | 3 +++ hosts/aluminium/services/ntp.nix | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 hosts/aluminium/services/ntp.nix diff --git a/hosts/aluminium/services/default.nix b/hosts/aluminium/services/default.nix index 7ce0f6e..8639a37 100644 --- a/hosts/aluminium/services/default.nix +++ b/hosts/aluminium/services/default.nix @@ -7,6 +7,7 @@ ./esphome ./home-assistant.nix ./nginx.nix + ./ntp.nix ./unifi-controller.nix ]; } diff --git a/hosts/aluminium/services/dnsmasq.nix b/hosts/aluminium/services/dnsmasq.nix index 6363be1..ff4549a 100644 --- a/hosts/aluminium/services/dnsmasq.nix +++ b/hosts/aluminium/services/dnsmasq.nix @@ -39,6 +39,9 @@ in "2001:470:20::2" # ordns.he.net "74.82.42.42" # ordns.he.net ]; + dhcp-option = [ + "option:ntp-server,192.168.0.1" + ]; }; }; diff --git a/hosts/aluminium/services/ntp.nix b/hosts/aluminium/services/ntp.nix new file mode 100644 index 0000000..aed11f4 --- /dev/null +++ b/hosts/aluminium/services/ntp.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: +{ + services.chrony = { + enable = true; + extraConfig = '' + allow 192.168.0.0/24 + allow 192.168.10.0/24 + leapsectz right/UTC + ''; + }; + networking.firewall.interfaces.lechner.allowedUDPPorts = [ 123 ]; + networking.firewall.interfaces.heizung.allowedUDPPorts = [ 123 ]; +} From 240d8dbc4cd6b7ff93bac49b567716d85f9f43e5 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 17 Sep 2024 23:32:59 +0200 Subject: [PATCH 02/49] Allow unifi inform port on lan interface --- hosts/aluminium/ports.nix | 3 ++- hosts/aluminium/services/unifi-controller.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hosts/aluminium/ports.nix b/hosts/aluminium/ports.nix index f1d126f..34bfdaf 100644 --- a/hosts/aluminium/ports.nix +++ b/hosts/aluminium/ports.nix @@ -9,5 +9,6 @@ custom-utils.validatePortAttrset { home-assistant.tcp = 8123; nginx-http.tcp = 80; nginx-https.tcp = 443; - unifi.tcp = 8443; + unifi-inform.tcp = 8080; + unifi-ui.tcp = 8443; } diff --git a/hosts/aluminium/services/unifi-controller.nix b/hosts/aluminium/services/unifi-controller.nix index a97eda8..16489c6 100644 --- a/hosts/aluminium/services/unifi-controller.nix +++ b/hosts/aluminium/services/unifi-controller.nix @@ -9,6 +9,7 @@ in unifiPackage = pkgs.unifi8; }; networking.firewall.interfaces.lechner.allowedTCPPorts = [ - ports.unifi.tcp + ports.unifi-inform.tcp + ports.unifi-ui.tcp ]; } From f6e3fd2b98ced525974bd252575a4efeea9e9693 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 18 Sep 2024 15:42:37 +0200 Subject: [PATCH 03/49] Set max seg size for interface ppp0 --- hosts/aluminium/configuration.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hosts/aluminium/configuration.nix b/hosts/aluminium/configuration.nix index 7e843b6..cdd652a 100644 --- a/hosts/aluminium/configuration.nix +++ b/hosts/aluminium/configuration.nix @@ -74,9 +74,6 @@ "voice" ]; }; - firewall.extraForwardRules = '' - tcp flags syn tcp option maxseg size set rt mtu - ''; firewall.extraInputRules = '' iifname "voice" udp dport 5059 accept ip saddr 217.10.68.150 udp dport 5060 accept @@ -119,6 +116,16 @@ }; }; + networking.nftables.tables.pppoe = { + family = "ip"; + content = '' + chain clamp { + type filter hook forward priority mangle; + oifname "ppp0" tcp flags syn tcp option maxseg size set rt mtu comment "clamp MSS to Path MTU" + } + ''; + }; + zramSwap = { enable = true; algorithm = "zstd"; From 188de9cf193edfe1577583f37a5f55e9031fa2b2 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 18 Sep 2024 15:43:18 +0200 Subject: [PATCH 04/49] Allow sip port from voice network --- hosts/aluminium/services/asterisk/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/aluminium/services/asterisk/default.nix b/hosts/aluminium/services/asterisk/default.nix index ccc0e79..c6d8cd7 100644 --- a/hosts/aluminium/services/asterisk/default.nix +++ b/hosts/aluminium/services/asterisk/default.nix @@ -188,6 +188,10 @@ in to = rtp.end; } ]; + interfaces.voice = { + allowedTCPPorts = [ 5060 ]; + allowedUDPPorts = [ 5060 ]; + }; }; systemd.services."asterisk-reload-endpoint@" = { From ad462bc9ebb6292f2d96451e1e7007e0661db06b Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 19 Sep 2024 00:02:38 +0200 Subject: [PATCH 05/49] Add detergent dosing to washing machine --- .../esphome/devices/waschmaschine.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/hosts/iron/services/esphome/devices/waschmaschine.yaml b/hosts/iron/services/esphome/devices/waschmaschine.yaml index 8e4f376..0e5d854 100644 --- a/hosts/iron/services/esphome/devices/waschmaschine.yaml +++ b/hosts/iron/services/esphome/devices/waschmaschine.yaml @@ -38,4 +38,82 @@ sensor: name: "in Betrieb" current_operation: name: "aktueller Vorgang" + id: current_operation +number: + - platform: template + name: "Waschmittelmenge" + id: detergent_dosing + min_value: 25.0 + max_value: 150.0 + step: 1 + unit_of_measurement: "ml" + icon: 'mdi:cup-water' + restore_value: true + initial_value: 75.0 + optimistic: true + - platform: template + name: "Waschmittelvorrat" + id: detergent_supply + min_value: 0.0 + max_value: 5000 + step: 1.0 + unit_of_measurement: "ml" + icon: 'mdi:cup-water' + restore_value: true + initial_value: 0 + optimistic: true + +stepper: + - platform: a4988 + id: detergent_stepper + step_pin: GPIO32 + sleep_pin: GPIO33 + dir_pin: GPIO25 # not used + max_speed: 600 steps/s + acceleration: 125 steps/s^2 + deceleration: 125 steps/s^2 + +globals: + - id: dosing_enabled + type: bool + restore_value: false + initial_value: 'true' + +interval: + - interval: 1s + then: + if: + condition: + and: + - lambda: return id(current_operation).state == "Einw/Vorwäsche"; + - lambda: return id(dosing_enabled); + then: + - lambda: &dosing |- + float dose = id(detergent_dosing).state; + float current_supply = id(detergent_supply).state; + if (current_supply >= dose) { + id(detergent_stepper).set_target(dose * 125); + id(detergent_stepper).report_position(0); + id(detergent_supply).publish_state(current_supply - dose); + ESP_LOGD("custom", "Waschmitteldosierung durchgeführt: %.2f ml, verbleibender Vorrat: %.2f ml", dose, current_supply - dose); + } else { + ESP_LOGW("custom", "Nicht genug Waschmittelvorrat! Aktueller Vorrat: %.2f ml, gewünschte Dosierung: %.2f ml", current_supply, dose); + } + - lambda: |- + id(dosing_enabled) = false; + - interval: 1s + then: + if: + condition: + lambda: return id(current_operation).state == "Knitterschutz/Ende"; + then: + - lambda: |- + id(dosing_enabled) = true; + +button: + - platform: template + name: "Waschmitteldosierung auslösen" + icon: "mdi:cup-water" + on_press: + - lambda: *dosing From e3cf0168498c5d3fa197366b405647e3a48de084 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sat, 21 Sep 2024 00:16:17 +0200 Subject: [PATCH 06/49] Fix firmware embedding into VESC tool --- pkgs/vesc-tool/tool.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/vesc-tool/tool.nix b/pkgs/vesc-tool/tool.nix index 3cb591d..7b70eca 100644 --- a/pkgs/vesc-tool/tool.nix +++ b/pkgs/vesc-tool/tool.nix @@ -34,9 +34,7 @@ stdenv.mkDerivation { dontConfigure = true; buildPhase = '' - for f in ${vesc-firmware}/*; do - ln -s "$f" res/firmwares/ - done + cp -r ${vesc-firmware}/* res/firmwares/ qmake -config release "CONFIG += release_lin build_platinum" make clean make -j $NIX_BUILD_CORES From 8a39f779ef6993d7ac94841153e15479077b2bc0 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sat, 21 Sep 2024 00:17:15 +0200 Subject: [PATCH 07/49] Build vesc6 mk3 firmware This is the appropriate firmware for my VESC6 MKIII --- pkgs/vesc-tool/firmware.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/vesc-tool/firmware.nix b/pkgs/vesc-tool/firmware.nix index 9db0fdc..d79819f 100644 --- a/pkgs/vesc-tool/firmware.nix +++ b/pkgs/vesc-tool/firmware.nix @@ -33,7 +33,9 @@ stdenv.mkDerivation rec { ( cd bldc chmod +w . - make -j $NIX_BUILD_CORES fw_410 fw_60 + # print targets: + # make; false + make -j $NIX_BUILD_CORES fw_410 fw_60_mk3 python package_firmware.py ) mkdir -p $out From 937af5ea230a19ed4999cf9c3a9b0ec1371e9abf Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sat, 21 Sep 2024 00:18:22 +0200 Subject: [PATCH 08/49] Update VESC tool and firmware --- pkgs/vesc-tool/firmware.nix | 4 ++-- pkgs/vesc-tool/tool.nix | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/vesc-tool/firmware.nix b/pkgs/vesc-tool/firmware.nix index d79819f..dba61cf 100644 --- a/pkgs/vesc-tool/firmware.nix +++ b/pkgs/vesc-tool/firmware.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "vedderb"; repo = "bldc"; - rev = "dd3b97b041c325acfb95ac1adb550d28390ea253"; - sha256 = "2Zex2FNkedO4wjG05CQIyVFU0i0/+O9V3LzsxHZOnvg="; + rev = "b6e53d3f28e9fd7a54b266c149abbf8a1c23f80a"; + sha256 = "4Q0sAEglXONL6InlVfwVKtQ2ZXKGhfrVLBevnWyjXZ0="; fetchSubmodules = true; }; diff --git a/pkgs/vesc-tool/tool.nix b/pkgs/vesc-tool/tool.nix index 7b70eca..b20d1b2 100644 --- a/pkgs/vesc-tool/tool.nix +++ b/pkgs/vesc-tool/tool.nix @@ -12,9 +12,8 @@ stdenv.mkDerivation { src = fetchFromGitHub { owner = "vedderb"; repo = "vesc_tool"; - rev = "211f5d317542a3674df638405485a143a23f67ce"; - sha256 = "liF2JbcrRtVPSySJhY7CHRghsBV3gKRGD40pKVD19wE="; - + rev = "033c95697ec970413ff5c1dbb1988758563d630b"; + sha256 = "LIIE3Z5eoU6mUXmudbRr1iLA3l7338/CsSK8W/iwgf0="; fetchSubmodules = true; }; From d2b062e644e40597b5a732fc57b70d9283dcadb2 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 23 Sep 2024 09:57:22 +0200 Subject: [PATCH 09/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/22ee467a54a3ab7fa9d637ccad5330c6c087e9dc' (2024-09-16) → 'github:nix-community/disko/51994df8ba24d5db5459ccf17b6494643301ad28' (2024-09-20) • Updated input 'home-manager': 'github:nix-community/home-manager/208df2e558b73b6a1f0faec98493cb59a25f62ba' (2024-09-07) → 'github:nix-community/home-manager/2f23fa308a7c067e52dfcc30a0758f47043ec176' (2024-09-22) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/7570de7b9b504cfe92025dd1be797bf546f66528' (2024-09-05) → 'github:cachix/git-hooks.nix/4e743a6920eab45e8ba0fbe49dc459f1423a4b74' (2024-09-19) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/dc8b0296f68f72f3fe77469c549a6f098555c2e9' (2024-09-16) → 'github:nixos/nixos-hardware/d0cb432a9d28218df11cbd77d984a2a46caeb5ac' (2024-09-22) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/8f7492cce28977fbf8bd12c72af08b1f6c7c3e49' (2024-09-14) → 'github:nixos/nixpkgs/944b2aea7f0a2d7c79f72468106bc5510cbf5101' (2024-09-20) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/06e78ca76feaa97082b905d330265d495eefc9f7' (2024-09-17) → 'github:NixOS/nixpkgs/eae2c94383bcc2e611a77eb3af19d4a23d5ff452' (2024-09-23) • Updated input 'nur': 'github:nix-community/NUR/48b58426a0fb447bad367813e742247dc860bed6' (2024-09-17) → 'github:nix-community/NUR/bca3011ab052943280c53f2024abf9b993eafee2' (2024-09-23) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/a0cbe913ce184bef7cd739f75ba5d123e1f41ef2' (2024-09-15) → 'github:nix-community/poetry2nix/026858e4700f0e1cc5cf4d2b9a1ae11c41ab88be' (2024-09-23) --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 83e4427..328fe52 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1726524467, - "narHash": "sha256-xkPPPvfHhHK7BNX5ZrQ9N6AIEixCmFzRZHduDf0zv30=", + "lastModified": 1726842196, + "narHash": "sha256-u9h03JQUuQJ607xmti9F9Eh6E96kKUAGP+aXWgwm70o=", "owner": "nix-community", "repo": "disko", - "rev": "22ee467a54a3ab7fa9d637ccad5330c6c087e9dc", + "rev": "51994df8ba24d5db5459ccf17b6494643301ad28", "type": "github" }, "original": { @@ -203,11 +203,11 @@ ] }, "locked": { - "lastModified": 1725703823, - "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "owner": "nix-community", "repo": "home-manager", - "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1725513492, - "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", + "lastModified": 1726745158, + "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", + "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1726489388, - "narHash": "sha256-JBHtN+n1HzKawpnOQAz6jdgvrtYV9c/kyzgoIdguQGo=", + "lastModified": 1727040444, + "narHash": "sha256-19FNN5QT9Z11ZUMfftRplyNN+2PgcHKb3oq8KMW/hDA=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "dc8b0296f68f72f3fe77469c549a6f098555c2e9", + "rev": "d0cb432a9d28218df11cbd77d984a2a46caeb5ac", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726320982, - "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", + "lastModified": 1726838390, + "narHash": "sha256-NmcVhGElxDbmEWzgXsyAjlRhUus/nEqPC5So7BOJLUM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", + "rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1726573629, - "narHash": "sha256-O4fWqykLSQrGcNmx7HCElAmrYC6riGbhdCzk1dmj4qs=", + "lastModified": 1727078180, + "narHash": "sha256-g7h1GLV75RbADLo7ikSlJHVJvYDUNBnr9a2vCEFzvCo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "06e78ca76feaa97082b905d330265d495eefc9f7", + "rev": "eae2c94383bcc2e611a77eb3af19d4a23d5ff452", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1726569072, - "narHash": "sha256-x33fIaVSJGc/kLiXh+a8x97GrMN1DtnRd8Ar50sDaNs=", + "lastModified": 1727076083, + "narHash": "sha256-zxpNV5o7JY/2j1rKsG3VyCCkImJ//Q2T9pQITFqUMoc=", "owner": "nix-community", "repo": "NUR", - "rev": "48b58426a0fb447bad367813e742247dc860bed6", + "rev": "bca3011ab052943280c53f2024abf9b993eafee2", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1726394406, - "narHash": "sha256-RUzT5OUT+sCNl/fA4u6u/SPc1Bye7MU96Vtu6jksfxs=", + "lastModified": 1727073647, + "narHash": "sha256-/HGpq4yVSH7tHMBnTeCNUbfLuzYLLRRtvqNzDAP1d8k=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "a0cbe913ce184bef7cd739f75ba5d123e1f41ef2", + "rev": "026858e4700f0e1cc5cf4d2b9a1ae11c41ab88be", "type": "github" }, "original": { From 22a1f2807eddab3bc251c58199bb9d3a9663c88a Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 24 Sep 2024 21:33:23 +0200 Subject: [PATCH 10/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/51994df8ba24d5db5459ccf17b6494643301ad28' (2024-09-20) → 'github:nix-community/disko/6d42596a35d34918a905e8539a44d3fc91f42b5b' (2024-09-24) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/944b2aea7f0a2d7c79f72468106bc5510cbf5101' (2024-09-20) → 'github:nixos/nixpkgs/23cbb250f3bf4f516a2d0bf03c51a30900848075' (2024-09-22) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/eae2c94383bcc2e611a77eb3af19d4a23d5ff452' (2024-09-23) → 'github:NixOS/nixpkgs/b7643ddc3b422f1d6e42c83a2d58ea5ce222048c' (2024-09-24) • Updated input 'nur': 'github:nix-community/NUR/bca3011ab052943280c53f2024abf9b993eafee2' (2024-09-23) → 'github:nix-community/NUR/c7225411f6e9087829c3a120e2698867d1b05319' (2024-09-24) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/026858e4700f0e1cc5cf4d2b9a1ae11c41ab88be' (2024-09-23) → 'github:nix-community/poetry2nix/7624b3e0275d9b52dbdda46ef7ffee66b36ff823' (2024-09-24) --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 328fe52..6346249 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1726842196, - "narHash": "sha256-u9h03JQUuQJ607xmti9F9Eh6E96kKUAGP+aXWgwm70o=", + "lastModified": 1727196810, + "narHash": "sha256-xQzgXRlczZoFfrUdA4nD5qojCQVqpiIk82aYINQZd+U=", "owner": "nix-community", "repo": "disko", - "rev": "51994df8ba24d5db5459ccf17b6494643301ad28", + "rev": "6d42596a35d34918a905e8539a44d3fc91f42b5b", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726838390, - "narHash": "sha256-NmcVhGElxDbmEWzgXsyAjlRhUus/nEqPC5So7BOJLUM=", + "lastModified": 1726969270, + "narHash": "sha256-8fnFlXBgM/uSvBlLWjZ0Z0sOdRBesyNdH0+esxqizGc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101", + "rev": "23cbb250f3bf4f516a2d0bf03c51a30900848075", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1727078180, - "narHash": "sha256-g7h1GLV75RbADLo7ikSlJHVJvYDUNBnr9a2vCEFzvCo=", + "lastModified": 1727205223, + "narHash": "sha256-RHzehUZqXKM8W8tUywY58jASi+Z8LDvrssuJz4UnG1w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eae2c94383bcc2e611a77eb3af19d4a23d5ff452", + "rev": "b7643ddc3b422f1d6e42c83a2d58ea5ce222048c", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1727076083, - "narHash": "sha256-zxpNV5o7JY/2j1rKsG3VyCCkImJ//Q2T9pQITFqUMoc=", + "lastModified": 1727201865, + "narHash": "sha256-nqHWxGhUFS6xyiVminVIECdG0Gu5em7LPf1mb4+5PEw=", "owner": "nix-community", "repo": "NUR", - "rev": "bca3011ab052943280c53f2024abf9b993eafee2", + "rev": "c7225411f6e9087829c3a120e2698867d1b05319", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727073647, - "narHash": "sha256-/HGpq4yVSH7tHMBnTeCNUbfLuzYLLRRtvqNzDAP1d8k=", + "lastModified": 1727169160, + "narHash": "sha256-m/3tT0Wvk2V4H15riZC/yT7i7t+8V58HTDpthKV5yhk=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "026858e4700f0e1cc5cf4d2b9a1ae11c41ab88be", + "rev": "7624b3e0275d9b52dbdda46ef7ffee66b36ff823", "type": "github" }, "original": { From 2afbd0e328d30a85885e5942dd69adab54c16105 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 25 Sep 2024 03:54:57 +0200 Subject: [PATCH 11/49] Change controller --- .../services/esphome/devices/badspiegel.yaml | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/hosts/iron/services/esphome/devices/badspiegel.yaml b/hosts/iron/services/esphome/devices/badspiegel.yaml index 9f8989c..8041d2e 100644 --- a/hosts/iron/services/esphome/devices/badspiegel.yaml +++ b/hosts/iron/services/esphome/devices/badspiegel.yaml @@ -15,7 +15,7 @@ esphome: color_temperature: 2700 K esp32: - board: wemos_d1_uno32 + board: az-delivery-devkit-v4 framework: type: arduino version: recommended @@ -41,16 +41,16 @@ wifi: output: - platform: ledc - pin: GPIO17 + pin: GPIO33 id: output_background_warm - platform: ledc - pin: GPIO25 + pin: GPIO32 id: output_background_cold - platform: ledc - pin: GPIO16 + pin: GPIO25 id: output_front_warm - platform: ledc - pin: GPIO26 + pin: GPIO14 id: output_front_cold light: @@ -77,39 +77,47 @@ switch: - platform: gpio name: "Heating" id: heating - pin: GPIO2 + pin: GPIO26 icon: "mdi:thermometer" - platform: gpio name: "Soundsystem" id: soundsystem - pin: GPIO4 + pin: GPIO23 icon: "mdi:speaker" esp32_touch: # setup_mode: true + +sensor: + - platform: dht + pin: GPIO22 + temperature: + name: "Temperatur" + id: temperature + humidity: + name: "Feuchtigkeit" + id: humidity + accuracy_decimals: 1 + update_interval: 60s + binary_sensor: # ESP32 touch pins: 4, 13, 27, 32, 33 -# - platform: esp32_touch -# name: "touch pad GPIO13" -# pin: GPIO13 -# threshold: 1000 -# on_press: -# internal: true - platform: esp32_touch - name: "touch pad GPIO12" - pin: GPIO12 - threshold: 900 + name: "touch pad GPIO13" + pin: GPIO13 + threshold: 923 on_press: then: - light.toggle: id: front_light internal: true - platform: esp32_touch - name: "touch pad GPIO14" - pin: GPIO14 - threshold: 900 + name: "touch pad GPIO27" + pin: GPIO27 + threshold: 1125 on_press: then: - light.toggle: id: background_light + internal: true From 4eed03bc105f8e386981c2711a9970a31515e4e2 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 25 Sep 2024 11:02:35 +0200 Subject: [PATCH 12/49] Set indentation settings for sshconfig --- users/jalr/modules/neovim.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/users/jalr/modules/neovim.nix b/users/jalr/modules/neovim.nix index ee25579..ad9fe28 100644 --- a/users/jalr/modules/neovim.nix +++ b/users/jalr/modules/neovim.nix @@ -227,4 +227,7 @@ in setlocal spell setlocal colorcolumn=81 ''; + xdg.configFile."nvim/ftplugin/sshconfig.vim".text = '' + setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab + ''; } From fa8515dd38ad3c715583737bde27a6b96b02cc95 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 25 Sep 2024 16:17:00 +0200 Subject: [PATCH 13/49] Add custom icon for Digitaler Dienst Element --- .../modules/communication/element-desktop.nix | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/users/jalr/modules/communication/element-desktop.nix b/users/jalr/modules/communication/element-desktop.nix index c210a98..d634e21 100644 --- a/users/jalr/modules/communication/element-desktop.nix +++ b/users/jalr/modules/communication/element-desktop.nix @@ -4,6 +4,10 @@ let profiles = { "digitaler-dienst" = { description = "Digitaler Dienst"; + icon = pkgs.fetchurl { + url = "https://matrix.digitaler-dienst.gmbh/_matrix/media/v3/thumbnail/digitaler-dienst.gmbh/kfUmmNxpmbsLtdIRvZcxkWAh?width=256&height=256"; + sha256 = "uSxx9avx3I/rDzFnwgEZUwLVktsTeZiSWcDHjPzcUtw="; + }; }; "private" = { description = "private"; @@ -11,10 +15,6 @@ let }; in lib.mkIf nixosConfig.jalr.gui.enable { - home.packages = with pkgs; [ - element-desktop - ]; - # Create an empty directory in nix store # as we want to use Element only with `--profile-dir` xdg.configFile.Element = { @@ -22,21 +22,33 @@ lib.mkIf nixosConfig.jalr.gui.enable { target = "Element"; }; - xdg.desktopEntries = lib.attrsets.mapAttrs' - (name: value: lib.attrsets.nameValuePair "element-desktop-${name}" + (name: value: lib.attrsets.nameValuePair "element-desktop-${name}" ( + let + package = ( + if value ? icon then + pkgs.element-desktop.overrideAttrs + (oldAttrs: { + patchPhase = oldAttrs.patchPhase or "" + '' + rm build/icons/* res/img/* + cp ${value.icon} res/img/element.png + ''; + }) + else pkgs.element-desktop + ); + in { categories = [ "Network" "InstantMessaging" "Chat" ]; exec = toString (pkgs.writeShellScript "element-desktop-${name}" '' - exec element-desktop --profile-dir "$HOME/.config/element-profiles/${name}" + exec "${package}/bin/element-desktop" --profile-dir "$HOME/.config/element-profiles/${name}" ''); genericName = "Matrix Client"; - icon = "element"; + icon = "${package}/share/element/img/element.png"; mimeType = [ "x-scheme-handler/element" ]; name = "Element ${value.description}"; terminal = false; type = "Application"; } - ) + )) profiles; } From e23f0a276771ad06d3c6766d91c910a6d767b993 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sun, 29 Sep 2024 10:26:21 +0200 Subject: [PATCH 14/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/67dc29be3036cc888f0b9d4f0a788ee0f6768700' (2024-09-26) → 'github:nix-community/disko/b709e1cc33fcde71c7db43850a55ebe6449d0959' (2024-09-28) • Updated input 'gomod2nix': 'github:nix-community/gomod2nix/1c6fd4e862bf2f249c9114ad625c64c6c29a8a08' (2024-09-05) → 'github:nix-community/gomod2nix/ba932692e249374e91bcbfe2e3a25ed3342a72eb' (2024-09-27) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/4e743a6920eab45e8ba0fbe49dc459f1423a4b74' (2024-09-19) → 'github:cachix/git-hooks.nix/85f7a7177c678de68224af3402ab8ee1bcee25c8' (2024-09-28) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/d0cb432a9d28218df11cbd77d984a2a46caeb5ac' (2024-09-22) → 'github:nixos/nixos-hardware/8e8c6cbad12ef805268b4e380a7298fbc275898d' (2024-09-29) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/759537f06e6999e141588ff1c9be7f3a5c060106' (2024-09-25) → 'github:nixos/nixpkgs/fbca5e745367ae7632731639de5c21f29c8744ed' (2024-09-28) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/e0f477a570df7375172a08ddb9199c90853c63f0' (2024-09-27) → 'github:NixOS/nixpkgs/a33c9035167809d873252ac9f9f05134a05e6e16' (2024-09-29) • Updated input 'nur': 'github:nix-community/NUR/a3494e9def7d07a1d97fb4acfa13bff7da65fd2e' (2024-09-27) → 'github:nix-community/NUR/6acf80f88c3f8fbf4f95f5df7a936a488a7bca12' (2024-09-29) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/d024cc089cfa3b7cff70a796f15ba148d14ce2ec' (2024-09-26) → 'github:nix-community/poetry2nix/d8928e5929c2344704264e8447452e0f73c72497' (2024-09-28) • Updated input 'poetry2nix/nix-github-actions': 'github:nix-community/nix-github-actions/5163432afc817cf8bd1f031418d1869e4c9d5547' (2023-12-29) → 'github:nix-community/nix-github-actions/622f829f5fe69310a866c8a6cd07e747c44ef820' (2024-07-04) • Updated input 'poetry2nix/treefmt-nix': 'github:numtide/treefmt-nix/8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd' (2024-06-30) → 'github:numtide/treefmt-nix/879b29ae9a0378904fbbefe0dadaed43c8905754' (2024-09-27) --- flake.lock | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 6346249..9ade965 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1727196810, - "narHash": "sha256-xQzgXRlczZoFfrUdA4nD5qojCQVqpiIk82aYINQZd+U=", + "lastModified": 1727531434, + "narHash": "sha256-b+GBgCWd2N6pkiTkRZaMFOPztPO4IVTaclYPrQl2uLk=", "owner": "nix-community", "repo": "disko", - "rev": "6d42596a35d34918a905e8539a44d3fc91f42b5b", + "rev": "b709e1cc33fcde71c7db43850a55ebe6449d0959", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1725515722, - "narHash": "sha256-+gljgHaflZhQXtr3WjJrGn8NXv7MruVPAORSufuCFnw=", + "lastModified": 1727478263, + "narHash": "sha256-6/c82/1/Y4JRPGuhNPvVZFQltR2eXaFi3av1SZQEQ10=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "1c6fd4e862bf2f249c9114ad625c64c6c29a8a08", + "rev": "ba932692e249374e91bcbfe2e3a25ed3342a72eb", "type": "github" }, "original": { @@ -275,11 +275,11 @@ ] }, "locked": { - "lastModified": 1703863825, - "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "lastModified": 1720066371, + "narHash": "sha256-uPlLYH2S0ACj0IcgaK9Lsf4spmJoGejR9DotXiXSBZQ=", "owner": "nix-community", "repo": "nix-github-actions", - "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "rev": "622f829f5fe69310a866c8a6cd07e747c44ef820", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1726745158, - "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", + "lastModified": 1727514110, + "narHash": "sha256-0YRcOxJG12VGDFH8iS8pJ0aYQQUAgo/r3ZAL+cSh9nk=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", + "rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1727040444, - "narHash": "sha256-19FNN5QT9Z11ZUMfftRplyNN+2PgcHKb3oq8KMW/hDA=", + "lastModified": 1727595438, + "narHash": "sha256-bAvkJYuZKeDwW/J/Ga/axplEbYbQhq6jdQBVdGcpuO8=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "d0cb432a9d28218df11cbd77d984a2a46caeb5ac", + "rev": "8e8c6cbad12ef805268b4e380a7298fbc275898d", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726969270, - "narHash": "sha256-8fnFlXBgM/uSvBlLWjZ0Z0sOdRBesyNdH0+esxqizGc=", + "lastModified": 1727540905, + "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "23cbb250f3bf4f516a2d0bf03c51a30900848075", + "rev": "fbca5e745367ae7632731639de5c21f29c8744ed", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1727205223, - "narHash": "sha256-RHzehUZqXKM8W8tUywY58jASi+Z8LDvrssuJz4UnG1w=", + "lastModified": 1727597789, + "narHash": "sha256-SW4KO6eOwb+FZMwk0aYRZajSUqVSYByNF2jj53+XTb0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b7643ddc3b422f1d6e42c83a2d58ea5ce222048c", + "rev": "a33c9035167809d873252ac9f9f05134a05e6e16", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1727201865, - "narHash": "sha256-nqHWxGhUFS6xyiVminVIECdG0Gu5em7LPf1mb4+5PEw=", + "lastModified": 1727596560, + "narHash": "sha256-222fcWG6s13RXuAK711nbrHs6wOb3UORXJ/vt3rCM60=", "owner": "nix-community", "repo": "NUR", - "rev": "c7225411f6e9087829c3a120e2698867d1b05319", + "rev": "6acf80f88c3f8fbf4f95f5df7a936a488a7bca12", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727169160, - "narHash": "sha256-m/3tT0Wvk2V4H15riZC/yT7i7t+8V58HTDpthKV5yhk=", + "lastModified": 1727546745, + "narHash": "sha256-dtOOYKGcfYTf0bSPuiY+BVEKdSw/zd/u2QvNXciQ0/E=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "7624b3e0275d9b52dbdda46ef7ffee66b36ff823", + "rev": "d8928e5929c2344704264e8447452e0f73c72497", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1726524647, - "narHash": "sha256-qis6BtOOBBEAfUl7FMHqqTwRLB61OL5OFzIsOmRz2J4=", + "lastModified": 1727423009, + "narHash": "sha256-+4B/dQm2EnORIk0k2wV3aHGaE0WXTBjColXjj7qWh10=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e2d404a7ea599a013189aa42947f66cede0645c8", + "rev": "127a96f49ddc377be6ba76964411bab11ae27803", "type": "github" }, "original": { @@ -591,11 +591,11 @@ ] }, "locked": { - "lastModified": 1719749022, - "narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=", + "lastModified": 1727431250, + "narHash": "sha256-uGRlRT47ecicF9iLD1G3g43jn2e+b5KaMptb59LHnvM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd", + "rev": "879b29ae9a0378904fbbefe0dadaed43c8905754", "type": "github" }, "original": { From 726954d5f5599b6893a242bce2b5038624687e2d Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sun, 29 Sep 2024 10:39:16 +0200 Subject: [PATCH 15/49] Increase keyFileTimeout --- hosts/iron/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/iron/configuration.nix b/hosts/iron/configuration.nix index d2a78b8..38d24a4 100644 --- a/hosts/iron/configuration.nix +++ b/hosts/iron/configuration.nix @@ -141,7 +141,7 @@ with lib; { allowDiscards = true; keyFileSize = 4096; keyFile = "/dev/disk/by-id/usb-jalr_RAM_Mass_Storage_DE6270431F6F342C-0:0"; - keyFileTimeout = 5; + keyFileTimeout = 60; }; }) disks From aafdcf4a469495bc8fdf733db99711e732143032 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 8 Oct 2024 21:09:58 +0200 Subject: [PATCH 16/49] Add dashboard --- hosts/aluminium/services/home-assistant.nix | 54 ++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/hosts/aluminium/services/home-assistant.nix b/hosts/aluminium/services/home-assistant.nix index 79974ef..5fc1fe8 100644 --- a/hosts/aluminium/services/home-assistant.nix +++ b/hosts/aluminium/services/home-assistant.nix @@ -5,7 +5,59 @@ in { services.home-assistant = { enable = true; - lovelaceConfig = { }; + lovelaceConfig = { + title = "Home"; + views = [ + { + path = "default_view"; + title = "Home"; + cards = [ + { + title = "Heizung"; + type = "entities"; + entities = [ + { entity = "sensor.guntamaticbiostar_betrieb"; } + { entity = "sensor.guntamaticbiostar_pufferladung"; } + { entity = "sensor.guntamaticbiostar_puffer_oben"; } + { entity = "sensor.guntamaticbiostar_puffer_unten"; } + { entity = "sensor.guntamaticbiostar_kesseltemperatur"; } + { entity = "sensor.guntamaticbiostar_vorlauf_ist_1"; } + { entity = "sensor.guntamaticbiostar_raumtemp_hk_1"; } + { entity = "sensor.guntamaticbiostar_aussentemperatur"; } + { entity = "sensor.guntamaticbiostar_co2_gehalt"; } + { entity = "select.guntamaticbiostar_program"; } + { entity = "sensor.guntamaticbiostar_programm"; } + { entity = "sensor.guntamaticbiostar_programm_hk1"; } + { entity = "sensor.guntamaticbiostar_rauchgasauslastung"; } + { entity = "sensor.guntamaticbiostar_rucklauftemperatur"; } + { entity = "sensor.guntamaticbiostar_servicezeit"; } + ]; + } + { + type = "grid"; + square = false; + columns = 1; + cards = [ + { + title = "Wasserbett"; + type = "entities"; + entities = [ + { + entity = "sensor.waterbed_temperatur"; + name = "Temperatur"; + } + ]; + } + { + type = "thermostat"; + entity = "climate.waterbed_temperatur"; + } + ]; + } + ]; + } + ]; + }; extraComponents = [ # See https://www.home-assistant.io/integrations "esphome" From 0fc2c1836318e88a1f466910b23763503ab4d0a4 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 8 Oct 2024 21:11:05 +0200 Subject: [PATCH 17/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/b709e1cc33fcde71c7db43850a55ebe6449d0959' (2024-09-28) → 'github:nix-community/disko/d39ee334984fcdae6244f5a8e6ab857479cbaefe' (2024-10-07) • Updated input 'gomod2nix': 'github:nix-community/gomod2nix/ba932692e249374e91bcbfe2e3a25ed3342a72eb' (2024-09-27) → 'github:nix-community/gomod2nix/066e0dd2afde263f547cb0905b77cea00521d86c' (2024-09-30) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/85f7a7177c678de68224af3402ab8ee1bcee25c8' (2024-09-28) → 'github:cachix/git-hooks.nix/1211305a5b237771e13fcca0c51e60ad47326a9a' (2024-10-05) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/8e8c6cbad12ef805268b4e380a7298fbc275898d' (2024-09-29) → 'github:nixos/nixos-hardware/ecfcd787f373f43307d764762e139a7cdeb9c22b' (2024-10-07) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/fbca5e745367ae7632731639de5c21f29c8744ed' (2024-09-28) → 'github:nixos/nixpkgs/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6' (2024-10-06) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/a33c9035167809d873252ac9f9f05134a05e6e16' (2024-09-29) → 'github:NixOS/nixpkgs/782c8b0451119555e47038daccf7621c5dd67950' (2024-10-08) • Updated input 'nur': 'github:nix-community/NUR/6acf80f88c3f8fbf4f95f5df7a936a488a7bca12' (2024-09-29) → 'github:nix-community/NUR/d9b924cd1b0a5e6018264e1f4c63edcfbbe97cdf' (2024-10-08) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/d8928e5929c2344704264e8447452e0f73c72497' (2024-09-28) → 'github:nix-community/poetry2nix/8e965fd42c0da4357c53d987bc62b54a954424da' (2024-10-07) • Updated input 'poetry2nix/treefmt-nix': 'github:numtide/treefmt-nix/879b29ae9a0378904fbbefe0dadaed43c8905754' (2024-09-27) → 'github:numtide/treefmt-nix/4446c7a6fc0775df028c5a3f6727945ba8400e64' (2024-10-03) • Updated input 'sops-nix': 'github:Mic92/sops-nix/127a96f49ddc377be6ba76964411bab11ae27803' (2024-09-27) → 'github:Mic92/sops-nix/06535d0e3d0201e6a8080dd32dbfde339b94f01b' (2024-10-08) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/dc454045f5b5d814e5862a6d057e7bb5c29edc05' (2024-09-08) → 'github:NixOS/nixpkgs/17ae88b569bb15590549ff478bab6494dde4a907' (2024-10-05) --- flake.lock | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 9ade965..7517b86 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1727531434, - "narHash": "sha256-b+GBgCWd2N6pkiTkRZaMFOPztPO4IVTaclYPrQl2uLk=", + "lastModified": 1728334376, + "narHash": "sha256-CTKEKPzD/j8FK6H4DO3EjyixZd3HHvgAgfnCwpGFP5c=", "owner": "nix-community", "repo": "disko", - "rev": "b709e1cc33fcde71c7db43850a55ebe6449d0959", + "rev": "d39ee334984fcdae6244f5a8e6ab857479cbaefe", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1727478263, - "narHash": "sha256-6/c82/1/Y4JRPGuhNPvVZFQltR2eXaFi3av1SZQEQ10=", + "lastModified": 1727668934, + "narHash": "sha256-nPpQ/4k6Fjaq2CHNSdO6j1ikiuWApuk/S6lU6ISp5SQ=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "ba932692e249374e91bcbfe2e3a25ed3342a72eb", + "rev": "066e0dd2afde263f547cb0905b77cea00521d86c", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1727514110, - "narHash": "sha256-0YRcOxJG12VGDFH8iS8pJ0aYQQUAgo/r3ZAL+cSh9nk=", + "lastModified": 1728092656, + "narHash": "sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8", + "rev": "1211305a5b237771e13fcca0c51e60ad47326a9a", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1727595438, - "narHash": "sha256-bAvkJYuZKeDwW/J/Ga/axplEbYbQhq6jdQBVdGcpuO8=", + "lastModified": 1728269138, + "narHash": "sha256-oKxDImsOvgUZMY4NwXVyUc/c1HiU2qInX+b5BU0yXls=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "8e8c6cbad12ef805268b4e380a7298fbc275898d", + "rev": "ecfcd787f373f43307d764762e139a7cdeb9c22b", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727540905, - "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", + "lastModified": 1728193676, + "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fbca5e745367ae7632731639de5c21f29c8744ed", + "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6", "type": "github" }, "original": { @@ -378,11 +378,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1725762081, - "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", + "lastModified": 1728156290, + "narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", + "rev": "17ae88b569bb15590549ff478bab6494dde4a907", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1727597789, - "narHash": "sha256-SW4KO6eOwb+FZMwk0aYRZajSUqVSYByNF2jj53+XTb0=", + "lastModified": 1728413927, + "narHash": "sha256-Ph8V+5JY/V6tp/tSMk0sSJnYxA9pwN9SbdX6sQQ3yuc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a33c9035167809d873252ac9f9f05134a05e6e16", + "rev": "782c8b0451119555e47038daccf7621c5dd67950", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1727596560, - "narHash": "sha256-222fcWG6s13RXuAK711nbrHs6wOb3UORXJ/vt3rCM60=", + "lastModified": 1728413295, + "narHash": "sha256-0UgpAUNLBQwAsqQKqX/ggNBvRGHrn6YggMJLBRr33V8=", "owner": "nix-community", "repo": "NUR", - "rev": "6acf80f88c3f8fbf4f95f5df7a936a488a7bca12", + "rev": "d9b924cd1b0a5e6018264e1f4c63edcfbbe97cdf", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727546745, - "narHash": "sha256-dtOOYKGcfYTf0bSPuiY+BVEKdSw/zd/u2QvNXciQ0/E=", + "lastModified": 1728266256, + "narHash": "sha256-RefXB9kqYch6uGT+mo6m3KTbNerfbDYz+EqkLb6YBbs=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "d8928e5929c2344704264e8447452e0f73c72497", + "rev": "8e965fd42c0da4357c53d987bc62b54a954424da", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1727423009, - "narHash": "sha256-+4B/dQm2EnORIk0k2wV3aHGaE0WXTBjColXjj7qWh10=", + "lastModified": 1728345710, + "narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=", "owner": "Mic92", "repo": "sops-nix", - "rev": "127a96f49ddc377be6ba76964411bab11ae27803", + "rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b", "type": "github" }, "original": { @@ -591,11 +591,11 @@ ] }, "locked": { - "lastModified": 1727431250, - "narHash": "sha256-uGRlRT47ecicF9iLD1G3g43jn2e+b5KaMptb59LHnvM=", + "lastModified": 1727984844, + "narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "879b29ae9a0378904fbbefe0dadaed43c8905754", + "rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64", "type": "github" }, "original": { From 1491636cb91f87a6b8348ccdfedcdf7caed20aaf Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:04:52 +0200 Subject: [PATCH 18/49] Add pyyaml --- users/jalr/modules/python.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/users/jalr/modules/python.nix b/users/jalr/modules/python.nix index 9a620b3..d73b0e3 100644 --- a/users/jalr/modules/python.nix +++ b/users/jalr/modules/python.nix @@ -1,8 +1,10 @@ { nixosConfig, lib, pkgs, ... }: lib.mkIf nixosConfig.jalr.workstation.enable { home.packages = with pkgs; [ - python3 - python3Packages.virtualenv - python3Packages.ipython + (python3.withPackages (pp: with pp; [ + ipython + pyyaml + virtualenv + ])) ]; } From 3b2f03e6e8f68b51a5db0fcc993cf2bba77f2b18 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:05:31 +0200 Subject: [PATCH 19/49] Add basic boot debugging instructions --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7b18909..32052e4 100644 --- a/README.md +++ b/README.md @@ -59,3 +59,8 @@ gpg --edit-key $key gpg> trust Your decision? 5 ``` + +## Debugging boot issues + +1. Add `rd.systemd.debug_shell` kernel parameter +2. Press CTRL+ALT+F9 to switch to root shell From 2207e66b6aa02e43b7ca2388f178969a42e56cf1 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:06:46 +0200 Subject: [PATCH 20/49] Change path to music directory --- hosts/iron/configuration.nix | 2 +- hosts/iron/services/navidrome.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/iron/configuration.nix b/hosts/iron/configuration.nix index 38d24a4..ab27c75 100644 --- a/hosts/iron/configuration.nix +++ b/hosts/iron/configuration.nix @@ -15,7 +15,7 @@ let "bpool/nixos/root" = "/boot"; "rpool/filebitch" = "/filebitch"; "rpool/navidrome" = "/var/lib/private/navidrome"; - "rpool/navidrome/music" = "/var/lib/private/navidrome/music"; + "rpool/navidrome/music" = "/var/lib/navidrome/music"; "rpool/nixos/home" = "/home"; "rpool/nixos/root" = "/"; "rpool/nixos/var/lib" = "/var/lib"; diff --git a/hosts/iron/services/navidrome.nix b/hosts/iron/services/navidrome.nix index 4f1044a..755f26c 100644 --- a/hosts/iron/services/navidrome.nix +++ b/hosts/iron/services/navidrome.nix @@ -7,6 +7,7 @@ let Address = "127.0.0.1"; Port = ports.navidrome.tcp; DevActivityPanel = false; + MusicFolder = "/var/lib/navidrome/music"; }; passwordEncryptionKeyFile = config.sops.secrets.navidrome-password-encryption-key.path; configFile = (pkgs.formats.json { }).generate "navidrome.json" settings; From 39ced5297f26b458bf38889b6b62d373145ab72f Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:07:53 +0200 Subject: [PATCH 21/49] Fix automatic detergent dosing --- hosts/iron/services/esphome/devices/waschmaschine.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/iron/services/esphome/devices/waschmaschine.yaml b/hosts/iron/services/esphome/devices/waschmaschine.yaml index 0e5d854..3e4babb 100644 --- a/hosts/iron/services/esphome/devices/waschmaschine.yaml +++ b/hosts/iron/services/esphome/devices/waschmaschine.yaml @@ -86,7 +86,8 @@ interval: if: condition: and: - - lambda: return id(current_operation).state == "Einw/Vorwäsche"; + #- lambda: return id(current_operation).state == "Einw/Vorwäsche"; + - lambda: return id(current_operation).state == "Waschen"; - lambda: return id(dosing_enabled); then: - lambda: &dosing |- From 5a99f3eda7d69ca53c265f229ab6cc0fe00b8cd3 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:54:45 +0200 Subject: [PATCH 22/49] Remove file completions for mycli command --- users/jalr/modules/fish.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/jalr/modules/fish.nix b/users/jalr/modules/fish.nix index 63c7692..47bc9c7 100644 --- a/users/jalr/modules/fish.nix +++ b/users/jalr/modules/fish.nix @@ -171,6 +171,7 @@ xdg.configFile."fish/completions/mycli.fish".text = '' complete -e -c mycli + complete -c mycli -f complete -c mycli -f -s h -l host -d "Host address of the database." complete -c mycli -f -s P -l port -d "Port number to use for connection." complete -c mycli -f -s u -l user -d "User name to connect to the database." From 39b7da4adcd5bf93d3bddfc9b371e5d900b4f5db Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Oct 2024 10:55:45 +0200 Subject: [PATCH 23/49] Add myssh script --- users/jalr/modules/default.nix | 2 +- users/jalr/modules/fish.nix | 4 + .../modules/{mycli.nix => mycli/default.nix} | 16 +- users/jalr/modules/mycli/myssh.py | 142 ++++++++++++++++++ 4 files changed, 160 insertions(+), 4 deletions(-) rename users/jalr/modules/{mycli.nix => mycli/default.nix} (93%) create mode 100755 users/jalr/modules/mycli/myssh.py diff --git a/users/jalr/modules/default.nix b/users/jalr/modules/default.nix index eb4a37f..eaa4602 100644 --- a/users/jalr/modules/default.nix +++ b/users/jalr/modules/default.nix @@ -21,7 +21,7 @@ ./kicad.nix ./mpv.nix ./mute-indicator.nix - ./mycli.nix + ./mycli ./neo.nix ./neovim.nix ./nix-index.nix diff --git a/users/jalr/modules/fish.nix b/users/jalr/modules/fish.nix index 47bc9c7..0ca1af4 100644 --- a/users/jalr/modules/fish.nix +++ b/users/jalr/modules/fish.nix @@ -194,6 +194,10 @@ complete -c mycli -f -s d -l dsn -r -a '(mycli --list-dsn)' ''; + xdg.configFile."fish/completions/myssh.fish".text = '' + complete -c myssh -f -a '(myssh --list)' + ''; + xdg.configFile."fish/completions/just.fish".source = pkgs.runCommand "just-fish-completions" { } '' ${pkgs.just}/bin/just --completions fish > $out ''; diff --git a/users/jalr/modules/mycli.nix b/users/jalr/modules/mycli/default.nix similarity index 93% rename from users/jalr/modules/mycli.nix rename to users/jalr/modules/mycli/default.nix index bcc9dd1..f688679 100644 --- a/users/jalr/modules/mycli.nix +++ b/users/jalr/modules/mycli/default.nix @@ -6,7 +6,7 @@ let ) ini; - solarized = import ./solarized.nix; + solarized = import ../solarized.nix; config = { main = { @@ -133,8 +133,18 @@ let }; in { - home.packages = with pkgs; [ - mycli + home.packages = [ + pkgs.mycli + (pkgs.stdenv.mkDerivation { + name = "myssh"; + propagatedBuildInputs = [ + (pkgs.python3.withPackages (pp: with pp; [ + pyyaml + ])) + ]; + dontUnpack = true; + installPhase = "install -Dm755 ${./myssh.py} $out/bin/myssh"; + }) ]; xdg.configFile = lib.attrsets.mapAttrs' diff --git a/users/jalr/modules/mycli/myssh.py b/users/jalr/modules/mycli/myssh.py new file mode 100755 index 0000000..1e25796 --- /dev/null +++ b/users/jalr/modules/mycli/myssh.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python + +import argparse +import json +import os +import subprocess +import sys +import yaml + + +def get_db_connecition_from_typo3_config(ssh_host, ssh_user, config_file): + php_code = """ + 1 + } + + +def connect(connection_name, connection): + if "t3_config" in connection: + db = get_db_connecition_from_typo3_config( + connection["ssh_host"], connection["ssh_user"], connection["t3_config"] + ) + db_host = db["host"] + db_user = db["user"] + db_password = db["password"] + db_name = db["dbname"] + elif "staging_level" in connection: + env = get_db_connection_from_env_file( + connection["ssh_host"], connection["ssh_user"], connection["staging_level"] + ) + db_host = env["TYPO3_DB_HOST"] + db_user = env["TYPO3_DB_USER"] + db_password = env["TYPO3_DB_PASSWORD"] + db_name = env["TYPO3_DB_DATABASE"] + + os.execl( + "/usr/bin/env", + "env", + "mycli", + "--prompt", + f"{connection_name}>", + "--ssh-user", + connection["ssh_user"], + "--ssh-host", + connection["ssh_host"], + "-h", + db_host, + "-u", + db_user, + "-p", + db_password, + db_name, + ) + + +def read_config(path): + with open(path, "r") as fh: + config = yaml.safe_load(fh.read()) + + return config + + +def main(): + connections = read_config(os.path.expanduser("~/.config/mycli/connections.yaml")) + + parser = argparse.ArgumentParser() + parser.add_argument("--list", action="store_true") + parser.add_argument("connection", type=str, nargs="?") + + args = vars(parser.parse_args()) + + if args["list"]: + print("\n".join(connections.keys())) + + if args["connection"] is not None: + connect(args["connection"], connections[args["connection"]]) + + +if __name__ == "__main__": + main() From 8225188ccfa9b7e29d2ce2d68f64d7f9019346e7 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 14 Oct 2024 21:36:33 +0200 Subject: [PATCH 24/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/d39ee334984fcdae6244f5a8e6ab857479cbaefe' (2024-10-07) → 'github:nix-community/disko/3b778f10eb275573da9f5c8a7a49e774200b87e5' (2024-10-14) • Updated input 'gomod2nix': 'github:nix-community/gomod2nix/066e0dd2afde263f547cb0905b77cea00521d86c' (2024-09-30) → 'github:nix-community/gomod2nix/d5547e530464c562324f171006fc8f639aa01c9f' (2024-10-09) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/1211305a5b237771e13fcca0c51e60ad47326a9a' (2024-10-05) → 'github:cachix/git-hooks.nix/ff68f91754be6f3427e4986d7949e6273659be1d' (2024-10-13) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/ecfcd787f373f43307d764762e139a7cdeb9c22b' (2024-10-07) → 'github:nixos/nixos-hardware/a8dd1b21995964b115b1e3ec639dd6ce24ab9806' (2024-10-12) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6' (2024-10-06) → 'github:nixos/nixpkgs/a3f9ad65a0bf298ed5847629a57808b97e6e8077' (2024-10-12) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/782c8b0451119555e47038daccf7621c5dd67950' (2024-10-08) → 'github:NixOS/nixpkgs/225211d8031e252e5019bcc001554f971b7d0618' (2024-10-14) • Updated input 'nur': 'github:nix-community/NUR/d9b924cd1b0a5e6018264e1f4c63edcfbbe97cdf' (2024-10-08) → 'github:nix-community/NUR/96670f5e62fc211ff06be5ed7654c44318ddf7e2' (2024-10-14) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/8e965fd42c0da4357c53d987bc62b54a954424da' (2024-10-07) → 'github:nix-community/poetry2nix/8a18db56dd62edd26458a87e4d335b7df84c3f3f' (2024-10-10) --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 7517b86..c069116 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1728334376, - "narHash": "sha256-CTKEKPzD/j8FK6H4DO3EjyixZd3HHvgAgfnCwpGFP5c=", + "lastModified": 1728922573, + "narHash": "sha256-FegyBabjV4868aJUbvFtqH0zKDEtUpeCAfnB1vWXeBg=", "owner": "nix-community", "repo": "disko", - "rev": "d39ee334984fcdae6244f5a8e6ab857479cbaefe", + "rev": "3b778f10eb275573da9f5c8a7a49e774200b87e5", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1727668934, - "narHash": "sha256-nPpQ/4k6Fjaq2CHNSdO6j1ikiuWApuk/S6lU6ISp5SQ=", + "lastModified": 1728509152, + "narHash": "sha256-tQo1rg3TlwgyI8eHnLvZSlQx9d/o2Rb4oF16TfaTOw0=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "066e0dd2afde263f547cb0905b77cea00521d86c", + "rev": "d5547e530464c562324f171006fc8f639aa01c9f", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1728092656, - "narHash": "sha256-eMeCTJZ5xBeQ0f9Os7K8DThNVSo9gy4umZLDfF5q6OM=", + "lastModified": 1728778939, + "narHash": "sha256-WybK5E3hpGxtCYtBwpRj1E9JoiVxe+8kX83snTNaFHE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "1211305a5b237771e13fcca0c51e60ad47326a9a", + "rev": "ff68f91754be6f3427e4986d7949e6273659be1d", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1728269138, - "narHash": "sha256-oKxDImsOvgUZMY4NwXVyUc/c1HiU2qInX+b5BU0yXls=", + "lastModified": 1728729581, + "narHash": "sha256-oazkQ/z7r43YkDLLQdMg8oIB3CwWNb+2ZrYOxtLEWTQ=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "ecfcd787f373f43307d764762e139a7cdeb9c22b", + "rev": "a8dd1b21995964b115b1e3ec639dd6ce24ab9806", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728193676, - "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=", + "lastModified": 1728740863, + "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6", + "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1728413927, - "narHash": "sha256-Ph8V+5JY/V6tp/tSMk0sSJnYxA9pwN9SbdX6sQQ3yuc=", + "lastModified": 1728933870, + "narHash": "sha256-QNTrtaZLyvLcnL7QwwVKINuBypNKlHa8SzM7ILkBPvQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "782c8b0451119555e47038daccf7621c5dd67950", + "rev": "225211d8031e252e5019bcc001554f971b7d0618", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1728413295, - "narHash": "sha256-0UgpAUNLBQwAsqQKqX/ggNBvRGHrn6YggMJLBRr33V8=", + "lastModified": 1728930569, + "narHash": "sha256-OvKCDKpI8sHA07Ct+f5uotGr9ATrIJ/fUfwZZnD8Tmk=", "owner": "nix-community", "repo": "NUR", - "rev": "d9b924cd1b0a5e6018264e1f4c63edcfbbe97cdf", + "rev": "96670f5e62fc211ff06be5ed7654c44318ddf7e2", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1728266256, - "narHash": "sha256-RefXB9kqYch6uGT+mo6m3KTbNerfbDYz+EqkLb6YBbs=", + "lastModified": 1728564116, + "narHash": "sha256-BkEqM5zUrYAwRKrfqi7hPOqjgD6+N0NCJvooaY8aQoE=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "8e965fd42c0da4357c53d987bc62b54a954424da", + "rev": "8a18db56dd62edd26458a87e4d335b7df84c3f3f", "type": "github" }, "original": { From 05a1b91fc4bf2fa93b790567cffc00d102c07085 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 16 Oct 2024 21:06:56 +0200 Subject: [PATCH 25/49] Improve WhatsApp setup - Implement graceful VM shutdown - Add systemd timer --- hosts/iron/configuration.nix | 2 - hosts/iron/services/default.nix | 1 + hosts/iron/services/matrix.nix | 11 ---- hosts/iron/services/whatsapp.nix | 88 ++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 hosts/iron/services/whatsapp.nix diff --git a/hosts/iron/configuration.nix b/hosts/iron/configuration.nix index ab27c75..80a60f2 100644 --- a/hosts/iron/configuration.nix +++ b/hosts/iron/configuration.nix @@ -234,7 +234,5 @@ with lib; { priority = 1; }; - - jalr.libvirt.enable = true; }; } diff --git a/hosts/iron/services/default.nix b/hosts/iron/services/default.nix index 86ff156..40087e5 100644 --- a/hosts/iron/services/default.nix +++ b/hosts/iron/services/default.nix @@ -16,5 +16,6 @@ ./remarkable.nix ./sturzbach.nix ./unifi-controller.nix + ./whatsapp.nix ]; } diff --git a/hosts/iron/services/matrix.nix b/hosts/iron/services/matrix.nix index 79a184d..93e413d 100644 --- a/hosts/iron/services/matrix.nix +++ b/hosts/iron/services/matrix.nix @@ -28,17 +28,6 @@ in host = "turn.jalr.de"; sharedSecretFile = config.sops.secrets.synapse-turn-shared-secret.path; }; - mautrix-whatsapp = { - enable = true; - port = ports.mautrix-whatsapp.tcp; - settings.bridge.permissions = { - # Only one user since using the name from the address book does not - # work with multiple users - #"@jalr:jalr.de" = 100; - "@jalr:jalr.de" = "admin"; - "jalr.de" = "user"; - }; - }; mautrix-signal = { enable = true; port = ports.mautrix-signal.tcp; diff --git a/hosts/iron/services/whatsapp.nix b/hosts/iron/services/whatsapp.nix new file mode 100644 index 0000000..ae88ae2 --- /dev/null +++ b/hosts/iron/services/whatsapp.nix @@ -0,0 +1,88 @@ +args@{ config, pkgs, custom-utils, ... }: + +let + ports = import ../ports.nix args; + shutdownAndroidVm = pkgs.writeShellScript "shutdown-android-vm" '' + set -e + export PATH=${pkgs.lib.makeBinPath [pkgs.libvirt pkgs.gnused pkgs.android-tools]} + + if [ "$(virsh domstate "$1")" = "running" ]; then + host="$(virsh -q domifaddr --domain "$1" | sed -n -r 's#.*ipv4\s*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/[0-9]+$#\1#p')" + port=5555 + adb connect "$host:$port" + adb -s "$host:$port" shell -- reboot -p + fi + ''; + vmName = "Bliss-v16"; +in +{ + jalr.matrix.mautrix-whatsapp = { + enable = true; + port = ports.mautrix-whatsapp.tcp; + settings.bridge.permissions = { + # Only one user since using the name from the address book does not + # work with multiple users + #"@jalr:jalr.de" = 100; + "@jalr:jalr.de" = "admin"; + "jalr.de" = "user"; + }; + }; + + jalr.libvirt.enable = true; + + systemd.services.libvirt-guests.serviceConfig.ExecStop = [ + "" + "${shutdownAndroidVm} ${vmName}" + "${pkgs.libvirt}/libexec/libvirt-guests.sh stop" + ]; + + systemd.services."whatsapp@" = { + description = "Start Android VM, wait for WhatsApp and shut down VM."; + serviceConfig = { + Type = "oneshot"; + }; + environment.VM = "%i"; + script = '' + export PATH=${pkgs.lib.makeBinPath [pkgs.libvirt pkgs.gnused pkgs.android-tools pkgs.coreutils]} + + domstate="$(virsh domstate "$VM")" + + if [ "$domstate" != "running" ]; then + virsh start "$VM" + fi + + echo "Wait until IP of Android VM is known" + while :; do + host="$(virsh -q domifaddr --domain "$VM" | sed -n -r 's#.*ipv4\s*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/[0-9]+$#\1#p')" + if [ "$host" ]; then + break + fi + sleep 1 + done + + port=5555 + adb connect "$host:$port" + + echo "Waiting for WhatsApp" + while ! adb -s "$host:$port" shell -- pgrep com.whatsapp > /dev/null; do + sleep 1 + done + + echo "Sleeping..." + sleep 5m + + echo "Shutting down Android" + adb -s "$host:$port" shell -- reboot -p + ''; + }; + systemd.timers."whatsapp-${vmName}" = { + description = "Start Android VM to run WhatsApp"; + after = [ "network.target" ]; + wantedBy = [ "timers.target" ]; + timerConfig = { + Persistent = true; + OnCalendar = "*-*-* 2:00:00"; + Unit = "whatsapp@${vmName}.service"; + }; + }; +} From e0363dee0fe0fef9ea203db7882febd99670f06f Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 16 Oct 2024 21:08:53 +0200 Subject: [PATCH 26/49] Use stable esphome package --- hosts/iron/services/esphome/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/iron/services/esphome/default.nix b/hosts/iron/services/esphome/default.nix index 53a3c0f..6b08885 100644 --- a/hosts/iron/services/esphome/default.nix +++ b/hosts/iron/services/esphome/default.nix @@ -28,7 +28,7 @@ in enable = true; address = "127.0.0.1"; port = ports.esphome.tcp; - package = pkgs.master.esphome; + package = pkgs.esphome; #package = pkgs.esphome.overrideAttrs (attrs: { # makeWrapperArgs = attrs.makeWrapperArgs ++ [ # "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ]}" From aba21934dcb89548900f494149ebabd2b82f7330 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 16 Oct 2024 21:45:47 +0200 Subject: [PATCH 27/49] Add bathroom thermostat --- .../esphome/devices/fussbodenheizung.yaml | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml index 30ff9ce..1b1eff0 100644 --- a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml +++ b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml @@ -72,26 +72,34 @@ sensor: - platform: homeassistant id: humidity_kitchen entity_id: sensor.kueche_leiste_feuchtigkeit + - platform: homeassistant + id: temperature_bathroom + entity_id: sensor.badspiegel_temperatur + - platform: homeassistant + id: humidity_bathroom + entity_id: sensor.badspiegel_feuchtigkeit climate: - #- platform: thermostat - # name: "Bad" - # #sensor: heating_livingroom - # #humidity_sensor: - # min_heating_off_time: 300s - # min_heating_run_time: 300s - # min_idle_time: 30s - # heat_action: - # - switch.turn_on: relay_1 - # idle_action: - # - switch.turn_off: relay_1 - # default_preset: zuhause - # on_boot_restore_from: memory - # preset: - # - name: zuhause - # default_target_temperature_low: 22 °C - # - name: abwesend - # default_target_temperature_low: 16 °C + - platform: thermostat + name: "Bad" + sensor: temperature_bathroom + humidity_sensor: humidity_bathroom + min_heating_off_time: 300s + min_heating_run_time: 300s + min_idle_time: 30s + heat_action: + - switch.turn_on: relay_1 + idle_action: + - switch.turn_off: relay_1 + default_preset: zuhause + on_boot_restore_from: memory + preset: + - name: morgens + default_target_temperature_low: 23 °C + - name: zuhause + default_target_temperature_low: 20 °C + - name: abwesend + default_target_temperature_low: 16 °C #- platform: thermostat # name: "Schlafzimmer" # #sensor: heating_livingroom From c5d7c0e916cba73da1fb776859eb50e72ee8026f Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 21 Oct 2024 09:18:06 +0200 Subject: [PATCH 28/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/3b778f10eb275573da9f5c8a7a49e774200b87e5' (2024-10-14) → 'github:nix-community/disko/a6a3179ddf396dfc28a078e2f169354d0c137125' (2024-10-18) • Updated input 'gomod2nix': 'github:nix-community/gomod2nix/d5547e530464c562324f171006fc8f639aa01c9f' (2024-10-09) → 'github:nix-community/gomod2nix/5d387097aa716f35dd99d848dc26d8d5b62a104c' (2024-10-20) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/ff68f91754be6f3427e4986d7949e6273659be1d' (2024-10-13) → 'github:cachix/git-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6' (2024-10-16) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/a8dd1b21995964b115b1e3ec639dd6ce24ab9806' (2024-10-12) → 'github:nixos/nixos-hardware/9fcf30fccf8435f6390efec4a4d38e69c2268a36' (2024-10-20) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/a3f9ad65a0bf298ed5847629a57808b97e6e8077' (2024-10-12) → 'github:nixos/nixpkgs/4eb33fe664af7b41a4c446f87d20c9a0a6321fa3' (2024-10-17) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/225211d8031e252e5019bcc001554f971b7d0618' (2024-10-14) → 'github:NixOS/nixpkgs/47626c904b01b31ba104247714ae4700a3cb240e' (2024-10-21) • Updated input 'nur': 'github:nix-community/NUR/96670f5e62fc211ff06be5ed7654c44318ddf7e2' (2024-10-14) → 'github:nix-community/NUR/41ca6cfe238fdfab2831386c5a65f5c0a01e1cfd' (2024-10-21) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/8a18db56dd62edd26458a87e4d335b7df84c3f3f' (2024-10-10) → 'github:nix-community/poetry2nix/e67cc181b5bdf5aa46f1340fa9acd3910f6fb122' (2024-10-17) • Updated input 'sops-nix': 'github:Mic92/sops-nix/06535d0e3d0201e6a8080dd32dbfde339b94f01b' (2024-10-08) → 'github:Mic92/sops-nix/c504fd7ac946d7a1b17944d73b261ca0a0b226a5' (2024-10-20) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/17ae88b569bb15590549ff478bab6494dde4a907' (2024-10-05) → 'github:NixOS/nixpkgs/bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22' (2024-10-19) --- flake.lock | 60 +++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index c069116..aaa92a7 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1728922573, - "narHash": "sha256-FegyBabjV4868aJUbvFtqH0zKDEtUpeCAfnB1vWXeBg=", + "lastModified": 1729281548, + "narHash": "sha256-MuojlSnwAJAwfhgmW8ZtZrwm2Sko4fqubCvReqbUzYw=", "owner": "nix-community", "repo": "disko", - "rev": "3b778f10eb275573da9f5c8a7a49e774200b87e5", + "rev": "a6a3179ddf396dfc28a078e2f169354d0c137125", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1728509152, - "narHash": "sha256-tQo1rg3TlwgyI8eHnLvZSlQx9d/o2Rb4oF16TfaTOw0=", + "lastModified": 1729448365, + "narHash": "sha256-oquZeWTYWTr5IxfwEzgsxjtD8SSFZYLdO9DaQb70vNU=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "d5547e530464c562324f171006fc8f639aa01c9f", + "rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1728778939, - "narHash": "sha256-WybK5E3hpGxtCYtBwpRj1E9JoiVxe+8kX83snTNaFHE=", + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "ff68f91754be6f3427e4986d7949e6273659be1d", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1728729581, - "narHash": "sha256-oazkQ/z7r43YkDLLQdMg8oIB3CwWNb+2ZrYOxtLEWTQ=", + "lastModified": 1729455275, + "narHash": "sha256-THqzn/7um3oMHUEGXyq+1CJQE7EogwR3HjLMNOlhFBE=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "a8dd1b21995964b115b1e3ec639dd6ce24ab9806", + "rev": "9fcf30fccf8435f6390efec4a4d38e69c2268a36", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728740863, - "narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=", + "lastModified": 1729181673, + "narHash": "sha256-LDiPhQ3l+fBjRATNtnuDZsBS7hqoBtPkKBkhpoBHv3I=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077", + "rev": "4eb33fe664af7b41a4c446f87d20c9a0a6321fa3", "type": "github" }, "original": { @@ -378,11 +378,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1728156290, - "narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=", + "lastModified": 1729357638, + "narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "17ae88b569bb15590549ff478bab6494dde4a907", + "rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1728933870, - "narHash": "sha256-QNTrtaZLyvLcnL7QwwVKINuBypNKlHa8SzM7ILkBPvQ=", + "lastModified": 1729494546, + "narHash": "sha256-7EQfszYNnqugacMrfOkLK8QynBOIB0y9t/1vIMzXqhc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "225211d8031e252e5019bcc001554f971b7d0618", + "rev": "47626c904b01b31ba104247714ae4700a3cb240e", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1728930569, - "narHash": "sha256-OvKCDKpI8sHA07Ct+f5uotGr9ATrIJ/fUfwZZnD8Tmk=", + "lastModified": 1729491640, + "narHash": "sha256-k2mR4w+yvko/JsWaH+1fIqjWRFixEs+jv/lNw8qnfkQ=", "owner": "nix-community", "repo": "NUR", - "rev": "96670f5e62fc211ff06be5ed7654c44318ddf7e2", + "rev": "41ca6cfe238fdfab2831386c5a65f5c0a01e1cfd", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1728564116, - "narHash": "sha256-BkEqM5zUrYAwRKrfqi7hPOqjgD6+N0NCJvooaY8aQoE=", + "lastModified": 1729173771, + "narHash": "sha256-rT2Vz1kFSj+NKHetVY7PJUACX+qBETdnuPSklzFKCsc=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "8a18db56dd62edd26458a87e4d335b7df84c3f3f", + "rev": "e67cc181b5bdf5aa46f1340fa9acd3910f6fb122", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1728345710, - "narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=", + "lastModified": 1729394972, + "narHash": "sha256-fADlzOzcSaGsrO+THUZ8SgckMMc7bMQftztKFCLVcFI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b", + "rev": "c504fd7ac946d7a1b17944d73b261ca0a0b226a5", "type": "github" }, "original": { From aa79e9a295eb4639d8286afac1fa72aa84fc14ca Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 23 Oct 2024 10:28:41 +0200 Subject: [PATCH 29/49] Fix JSON parse error on PHP warnings Redirect PHP warnings to stderr instead of stdout so that the JSON doesn't become invalid if there are PHP warnings. --- users/jalr/modules/mycli/myssh.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/users/jalr/modules/mycli/myssh.py b/users/jalr/modules/mycli/myssh.py index 1e25796..c79b430 100755 --- a/users/jalr/modules/mycli/myssh.py +++ b/users/jalr/modules/mycli/myssh.py @@ -28,20 +28,19 @@ def get_db_connecition_from_typo3_config(ssh_host, ssh_user, config_file): "--", "php", "-d", - "display_errors=1", + "display_errors=stderr", "--", config_file, ], check=True, input=php_code, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stderr=sys.stderr, text=True, ) except subprocess.CalledProcessError as e: print(f"Error: Command failed with return code {e.returncode}") print(f"stdout: {e.stdout}") - print(f"stderr: {e.stderr}") raise return json.loads(proc.stdout) From a2d776548c2c4d136763250257c3ca3598dea80e Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 23 Oct 2024 13:56:32 +0200 Subject: [PATCH 30/49] Enable periodic dumps --- hosts/magnesium/services/forgejo.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/magnesium/services/forgejo.nix b/hosts/magnesium/services/forgejo.nix index 98042a7..9eef90f 100644 --- a/hosts/magnesium/services/forgejo.nix +++ b/hosts/magnesium/services/forgejo.nix @@ -49,6 +49,10 @@ in }; log.level = "Warn"; }; + dump = { + enable = true; + type = "tar.zst"; + }; }; networking.firewall.allowedTCPPorts = [ cfg.settings.server.SSH_PORT ]; From 6cbfa3e4dabdbc62655ced68b5a80dfaa4e037be Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 23 Oct 2024 13:57:49 +0200 Subject: [PATCH 31/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/a6a3179ddf396dfc28a078e2f169354d0c137125' (2024-10-18) → 'github:nix-community/disko/4be2aadf13b67ffbb993deb73adff77c46b728fc' (2024-10-22) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/9fcf30fccf8435f6390efec4a4d38e69c2268a36' (2024-10-20) → 'github:nixos/nixos-hardware/22e8de2729f40d29a445c8baeaf22740b8b25daf' (2024-10-22) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/4eb33fe664af7b41a4c446f87d20c9a0a6321fa3' (2024-10-17) → 'github:nixos/nixpkgs/89172919243df199fe237ba0f776c3e3e3d72367' (2024-10-20) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/47626c904b01b31ba104247714ae4700a3cb240e' (2024-10-21) → 'github:NixOS/nixpkgs/148aa178a9ab4c98b55b85d2935f3e1722130c51' (2024-10-23) • Updated input 'nur': 'github:nix-community/NUR/41ca6cfe238fdfab2831386c5a65f5c0a01e1cfd' (2024-10-21) → 'github:nix-community/NUR/b79837253f7eb49c14d8665b656202ef0d78845a' (2024-10-23) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/e67cc181b5bdf5aa46f1340fa9acd3910f6fb122' (2024-10-17) → 'github:nix-community/poetry2nix/f7f9446455084a6333c428371afe23229379cf62' (2024-10-22) • Updated input 'sops-nix': 'github:Mic92/sops-nix/c504fd7ac946d7a1b17944d73b261ca0a0b226a5' (2024-10-20) → 'github:Mic92/sops-nix/a4c33bfecb93458d90f9eb26f1cf695b47285243' (2024-10-23) --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index aaa92a7..59cff38 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1729281548, - "narHash": "sha256-MuojlSnwAJAwfhgmW8ZtZrwm2Sko4fqubCvReqbUzYw=", + "lastModified": 1729588208, + "narHash": "sha256-PNONdMd+sG7JWzNIDerX7oVZXL8FTVlSAZ1BmUo2HjE=", "owner": "nix-community", "repo": "disko", - "rev": "a6a3179ddf396dfc28a078e2f169354d0c137125", + "rev": "4be2aadf13b67ffbb993deb73adff77c46b728fc", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1729455275, - "narHash": "sha256-THqzn/7um3oMHUEGXyq+1CJQE7EogwR3HjLMNOlhFBE=", + "lastModified": 1729624485, + "narHash": "sha256-iEffyT68tEU5kHQuyP05QRH+JhWNNLAwHfgZAzXFS7o=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "9fcf30fccf8435f6390efec4a4d38e69c2268a36", + "rev": "22e8de2729f40d29a445c8baeaf22740b8b25daf", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729181673, - "narHash": "sha256-LDiPhQ3l+fBjRATNtnuDZsBS7hqoBtPkKBkhpoBHv3I=", + "lastModified": 1729449015, + "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4eb33fe664af7b41a4c446f87d20c9a0a6321fa3", + "rev": "89172919243df199fe237ba0f776c3e3e3d72367", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1729494546, - "narHash": "sha256-7EQfszYNnqugacMrfOkLK8QynBOIB0y9t/1vIMzXqhc=", + "lastModified": 1729684406, + "narHash": "sha256-ogE0sFjMltcKiuLnP/yBhRfQhw00LE69E1ARgAV18Kg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "47626c904b01b31ba104247714ae4700a3cb240e", + "rev": "148aa178a9ab4c98b55b85d2935f3e1722130c51", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1729491640, - "narHash": "sha256-k2mR4w+yvko/JsWaH+1fIqjWRFixEs+jv/lNw8qnfkQ=", + "lastModified": 1729683741, + "narHash": "sha256-IvsiJRTO5+BUAN3+jkWnZZ1h6LbgguHgtTgHGJia2VM=", "owner": "nix-community", "repo": "NUR", - "rev": "41ca6cfe238fdfab2831386c5a65f5c0a01e1cfd", + "rev": "b79837253f7eb49c14d8665b656202ef0d78845a", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1729173771, - "narHash": "sha256-rT2Vz1kFSj+NKHetVY7PJUACX+qBETdnuPSklzFKCsc=", + "lastModified": 1729621708, + "narHash": "sha256-NEagK4dENd9Riu8Gc1JHOnrKL/3TmiAINDCAvXqWkL4=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "e67cc181b5bdf5aa46f1340fa9acd3910f6fb122", + "rev": "f7f9446455084a6333c428371afe23229379cf62", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1729394972, - "narHash": "sha256-fADlzOzcSaGsrO+THUZ8SgckMMc7bMQftztKFCLVcFI=", + "lastModified": 1729669122, + "narHash": "sha256-SpS3rSwYcskdOpx+jeCv1lcZDdkT/K5qT8dlenCBQ8c=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c504fd7ac946d7a1b17944d73b261ca0a0b226a5", + "rev": "a4c33bfecb93458d90f9eb26f1cf695b47285243", "type": "github" }, "original": { From 540e720874ed38de2636ac2e7d3e923b3e749817 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 28 Oct 2024 15:02:53 +0100 Subject: [PATCH 32/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/4be2aadf13b67ffbb993deb73adff77c46b728fc' (2024-10-22) → 'github:nix-community/disko/89e458a3bb3693e769bfb2b2447c3fe72092d498' (2024-10-27) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/22e8de2729f40d29a445c8baeaf22740b8b25daf' (2024-10-22) → 'github:nixos/nixos-hardware/6906ac67a1078cf950b8527341e229eeecb5bc30' (2024-10-27) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/89172919243df199fe237ba0f776c3e3e3d72367' (2024-10-20) → 'github:nixos/nixpkgs/cd3e8833d70618c4eea8df06f95b364b016d4950' (2024-10-26) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/148aa178a9ab4c98b55b85d2935f3e1722130c51' (2024-10-23) → 'github:NixOS/nixpkgs/9b2bdcc99abfd60ccac074cc63541f757d21ec43' (2024-10-28) • Updated input 'nur': 'github:nix-community/NUR/b79837253f7eb49c14d8665b656202ef0d78845a' (2024-10-23) → 'github:nix-community/NUR/eeb8fce4d316d67fc9baf0169e626f9cb590c4b7' (2024-10-28) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/f7f9446455084a6333c428371afe23229379cf62' (2024-10-22) → 'github:nix-community/poetry2nix/caddf1463524201e73b201fa3fc51b5233bf7d5b' (2024-10-28) • Updated input 'sops-nix': 'github:Mic92/sops-nix/a4c33bfecb93458d90f9eb26f1cf695b47285243' (2024-10-23) → 'github:Mic92/sops-nix/1666d16426abe79af5c47b7c0efa82fd31bf4c56' (2024-10-27) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22' (2024-10-19) → 'github:NixOS/nixpkgs/cd3e8833d70618c4eea8df06f95b364b016d4950' (2024-10-26) --- flake.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 59cff38..b0dc780 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1729588208, - "narHash": "sha256-PNONdMd+sG7JWzNIDerX7oVZXL8FTVlSAZ1BmUo2HjE=", + "lastModified": 1730045523, + "narHash": "sha256-W5Avk1THhZALXITHGazKfZbIZ5+Bc4nSYvAYHUn96EU=", "owner": "nix-community", "repo": "disko", - "rev": "4be2aadf13b67ffbb993deb73adff77c46b728fc", + "rev": "89e458a3bb3693e769bfb2b2447c3fe72092d498", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1729624485, - "narHash": "sha256-iEffyT68tEU5kHQuyP05QRH+JhWNNLAwHfgZAzXFS7o=", + "lastModified": 1730068391, + "narHash": "sha256-jlAGtfMuI8pUUoUmNkm2P/38pOtHZdcAf3Az8XQLAf4=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "22e8de2729f40d29a445c8baeaf22740b8b25daf", + "rev": "6906ac67a1078cf950b8527341e229eeecb5bc30", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729449015, - "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=", + "lastModified": 1729973466, + "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "89172919243df199fe237ba0f776c3e3e3d72367", + "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", "type": "github" }, "original": { @@ -378,11 +378,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1729357638, - "narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=", + "lastModified": 1729973466, + "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22", + "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1729684406, - "narHash": "sha256-ogE0sFjMltcKiuLnP/yBhRfQhw00LE69E1ARgAV18Kg=", + "lastModified": 1730123274, + "narHash": "sha256-kj/6VN+3i7Pwx/TzHTliUNBK0qAFg88mwVjkrBegydg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "148aa178a9ab4c98b55b85d2935f3e1722130c51", + "rev": "9b2bdcc99abfd60ccac074cc63541f757d21ec43", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1729683741, - "narHash": "sha256-IvsiJRTO5+BUAN3+jkWnZZ1h6LbgguHgtTgHGJia2VM=", + "lastModified": 1730123330, + "narHash": "sha256-FiSuH3xb9Yh/3I8x0rz8TXhCHIsNGmZxwLIvQCW2qic=", "owner": "nix-community", "repo": "NUR", - "rev": "b79837253f7eb49c14d8665b656202ef0d78845a", + "rev": "eeb8fce4d316d67fc9baf0169e626f9cb590c4b7", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1729621708, - "narHash": "sha256-NEagK4dENd9Riu8Gc1JHOnrKL/3TmiAINDCAvXqWkL4=", + "lastModified": 1730121131, + "narHash": "sha256-cRRa09+BhJ3L/0HoKR6V9bho6dUQKS5rIjlQp2oYktU=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "f7f9446455084a6333c428371afe23229379cf62", + "rev": "caddf1463524201e73b201fa3fc51b5233bf7d5b", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1729669122, - "narHash": "sha256-SpS3rSwYcskdOpx+jeCv1lcZDdkT/K5qT8dlenCBQ8c=", + "lastModified": 1729999681, + "narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "a4c33bfecb93458d90f9eb26f1cf695b47285243", + "rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56", "type": "github" }, "original": { From dd1210bceb1839a76a0c79fae60ade374caf1b9a Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Tue, 29 Oct 2024 19:53:24 +0100 Subject: [PATCH 33/49] Add ntfy service --- hosts/magnesium/ports.nix | 3 ++- hosts/magnesium/services/default.nix | 1 + hosts/magnesium/services/ntfy.nix | 34 ++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 hosts/magnesium/services/ntfy.nix diff --git a/hosts/magnesium/ports.nix b/hosts/magnesium/ports.nix index 0fa666e..7401906 100644 --- a/hosts/magnesium/ports.nix +++ b/hosts/magnesium/ports.nix @@ -5,9 +5,10 @@ custom-utils.validatePortAttrset { coturn-plain = { tcp = [ 3478 3479 ]; udp = [ 3478 3479 ]; }; coturn-relay.udp.range = [ 49160 49200 ]; coturn-tls = { tcp = [ 5349 5350 ]; udp = [ 5349 5350 ]; }; + forgejo-ssh.tcp = 2022; mosquitto.tcp = 1883; nginx-http.tcp = 80; nginx-https.tcp = 443; + ntfy.tcp = 12474; wireguard-public-ip-tunnel.udp = 51000; - forgejo-ssh.tcp = 2022; } diff --git a/hosts/magnesium/services/default.nix b/hosts/magnesium/services/default.nix index 9737c6c..ab5d185 100644 --- a/hosts/magnesium/services/default.nix +++ b/hosts/magnesium/services/default.nix @@ -4,6 +4,7 @@ ./forgejo.nix ./gitlab-runner.nix ./mosquitto.nix + ./ntfy.nix ./public-ip-tunnel.nix ./webserver.nix ]; diff --git a/hosts/magnesium/services/ntfy.nix b/hosts/magnesium/services/ntfy.nix new file mode 100644 index 0000000..4533c26 --- /dev/null +++ b/hosts/magnesium/services/ntfy.nix @@ -0,0 +1,34 @@ +args@{ lib, pkgs, config, custom-utils, ... }: +let + cfg = config.services.ntfy-sh; + ports = import ../ports.nix args; + domain = "ntfy.jalr.de"; + datadir = "/var/lib/ntfy-sh"; +in +{ + # ntfy access --auth-file /var/lib/private/ntfy-sh/user.db '*' 'up*' write-only + + services.ntfy-sh = { + enable = true; + settings = { + listen-http = "127.0.0.1:${toString ports.ntfy.tcp}"; + base-url = "https://${domain}"; + behind-proxy = true; + #web-root = "disable"; + #auth-default-access = "read-only"; + attachment-cache-dir = "${datadir}/attachments"; + auth-file = "${datadir}/user.db"; + cache-file = "${datadir}/cache-file.db"; + }; + }; + services.nginx.virtualHosts."${domain}" = { + enableACME = true; + forceSSL = true; + kTLS = true; + locations."/" = { + proxyPass = "http://${cfg.settings.listen-http}/"; + recommendedProxySettings = true; + proxyWebsockets = true; + }; + }; +} From 2d07256518c63de5195658c0342cd7780bd8cbaa Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 4 Nov 2024 09:43:51 +0100 Subject: [PATCH 34/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/89e458a3bb3693e769bfb2b2447c3fe72092d498' (2024-10-27) → 'github:nix-community/disko/380847d94ff0fedee8b50ee4baddb162c06678df' (2024-11-03) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/3c3e88f0f544d6bb54329832616af7eb971b6be6' (2024-10-16) → 'github:cachix/git-hooks.nix/af8a16fe5c264f5e9e18bcee2859b40a656876cf' (2024-10-30) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/6906ac67a1078cf950b8527341e229eeecb5bc30' (2024-10-27) → 'github:nixos/nixos-hardware/f6e0cd5c47d150c4718199084e5764f968f1b560' (2024-11-02) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/cd3e8833d70618c4eea8df06f95b364b016d4950' (2024-10-26) → 'github:nixos/nixpkgs/080166c15633801df010977d9d7474b4a6c549d7' (2024-10-30) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/9b2bdcc99abfd60ccac074cc63541f757d21ec43' (2024-10-28) → 'github:NixOS/nixpkgs/fe21dd5ab593b2cd974161e462b2e2b0c8e24bae' (2024-11-04) • Updated input 'nur': 'github:nix-community/NUR/eeb8fce4d316d67fc9baf0169e626f9cb590c4b7' (2024-10-28) → 'github:nix-community/NUR/6720812cce88e6bcd4fd20a081d2c48303e0388c' (2024-11-04) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/caddf1463524201e73b201fa3fc51b5233bf7d5b' (2024-10-28) → 'github:nix-community/poetry2nix/43a898b4d76f7f3f70df77a2cc2d40096bc9d75e' (2024-10-30) • Updated input 'poetry2nix/nix-github-actions': 'github:nix-community/nix-github-actions/622f829f5fe69310a866c8a6cd07e747c44ef820' (2024-07-04) → 'github:nix-community/nix-github-actions/e04df33f62cdcf93d73e9a04142464753a16db67' (2024-10-24) • Updated input 'poetry2nix/treefmt-nix': 'github:numtide/treefmt-nix/4446c7a6fc0775df028c5a3f6727945ba8400e64' (2024-10-03) → 'github:numtide/treefmt-nix/9ef337e492a5555d8e17a51c911ff1f02635be15' (2024-10-28) • Updated input 'sops-nix': 'github:Mic92/sops-nix/1666d16426abe79af5c47b7c0efa82fd31bf4c56' (2024-10-27) → 'github:Mic92/sops-nix/e9b5eef9b51cdf966c76143e13a9476725b2f760' (2024-11-03) • Updated input 'sops-nix/nixpkgs-stable': 'github:NixOS/nixpkgs/cd3e8833d70618c4eea8df06f95b364b016d4950' (2024-10-26) → 'github:NixOS/nixpkgs/3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c' (2024-11-03) --- flake.lock | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index b0dc780..66023b5 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1730045523, - "narHash": "sha256-W5Avk1THhZALXITHGazKfZbIZ5+Bc4nSYvAYHUn96EU=", + "lastModified": 1730675461, + "narHash": "sha256-Mhqz3p/HEiI/zxBJWO57LYQf6gGlJB0tci6fiVXLjd8=", "owner": "nix-community", "repo": "disko", - "rev": "89e458a3bb3693e769bfb2b2447c3fe72092d498", + "rev": "380847d94ff0fedee8b50ee4baddb162c06678df", "type": "github" }, "original": { @@ -275,11 +275,11 @@ ] }, "locked": { - "lastModified": 1720066371, - "narHash": "sha256-uPlLYH2S0ACj0IcgaK9Lsf4spmJoGejR9DotXiXSBZQ=", + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", "owner": "nix-community", "repo": "nix-github-actions", - "rev": "622f829f5fe69310a866c8a6cd07e747c44ef820", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1729104314, - "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "lastModified": 1730302582, + "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1730068391, - "narHash": "sha256-jlAGtfMuI8pUUoUmNkm2P/38pOtHZdcAf3Az8XQLAf4=", + "lastModified": 1730537918, + "narHash": "sha256-GJB1/aaTnAtt9sso/EQ77TAGJ/rt6uvlP0RqZFnWue8=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "6906ac67a1078cf950b8527341e229eeecb5bc30", + "rev": "f6e0cd5c47d150c4718199084e5764f968f1b560", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729973466, - "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", + "lastModified": 1730327045, + "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", + "rev": "080166c15633801df010977d9d7474b4a6c549d7", "type": "github" }, "original": { @@ -378,11 +378,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1729973466, - "narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", + "lastModified": 1730602179, + "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", + "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1730123274, - "narHash": "sha256-kj/6VN+3i7Pwx/TzHTliUNBK0qAFg88mwVjkrBegydg=", + "lastModified": 1730707924, + "narHash": "sha256-B1VgouTS2j2pFsYPSAQWGees242Gp4iyCdapjK3lPpg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b2bdcc99abfd60ccac074cc63541f757d21ec43", + "rev": "fe21dd5ab593b2cd974161e462b2e2b0c8e24bae", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1730123330, - "narHash": "sha256-FiSuH3xb9Yh/3I8x0rz8TXhCHIsNGmZxwLIvQCW2qic=", + "lastModified": 1730708002, + "narHash": "sha256-I57tjJe+Yo2xLW1jSmOFFCf8Wk8Wr0hpoFGfPMTjhTs=", "owner": "nix-community", "repo": "NUR", - "rev": "eeb8fce4d316d67fc9baf0169e626f9cb590c4b7", + "rev": "6720812cce88e6bcd4fd20a081d2c48303e0388c", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1730121131, - "narHash": "sha256-cRRa09+BhJ3L/0HoKR6V9bho6dUQKS5rIjlQp2oYktU=", + "lastModified": 1730284601, + "narHash": "sha256-eHYcKVLIRRv3J1vjmxurS6HVdGphB53qxUeAkylYrZY=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "caddf1463524201e73b201fa3fc51b5233bf7d5b", + "rev": "43a898b4d76f7f3f70df77a2cc2d40096bc9d75e", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1729999681, - "narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=", + "lastModified": 1730605784, + "narHash": "sha256-1NveNAMLHbxOg0BpBMSVuZ2yW2PpDnZLbZ25wV50PMc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56", + "rev": "e9b5eef9b51cdf966c76143e13a9476725b2f760", "type": "github" }, "original": { @@ -591,11 +591,11 @@ ] }, "locked": { - "lastModified": 1727984844, - "narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=", + "lastModified": 1730120726, + "narHash": "sha256-LqHYIxMrl/1p3/kvm2ir925tZ8DkI0KA10djk8wecSk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64", + "rev": "9ef337e492a5555d8e17a51c911ff1f02635be15", "type": "github" }, "original": { From 7f03078b584d96dea7b44a0879d1a3d5648db8e4 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 7 Nov 2024 16:41:02 +0100 Subject: [PATCH 35/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/380847d94ff0fedee8b50ee4baddb162c06678df' (2024-11-03) → 'github:nix-community/disko/856a2902156ba304efebd4c1096dbf7465569454' (2024-11-04) • Updated input 'nix-pre-commit-hooks': 'github:cachix/git-hooks.nix/af8a16fe5c264f5e9e18bcee2859b40a656876cf' (2024-10-30) → 'github:cachix/git-hooks.nix/d70155fdc00df4628446352fc58adc640cd705c2' (2024-11-05) • Updated input 'nix-pre-commit-hooks/nixpkgs-stable': 'github:NixOS/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07) → 'github:NixOS/nixpkgs/d063c1dd113c91ab27959ba540c0d9753409edf3' (2024-11-04) • Updated input 'nixos-hardware': 'github:nixos/nixos-hardware/f6e0cd5c47d150c4718199084e5764f968f1b560' (2024-11-02) → 'github:nixos/nixos-hardware/e1cc1f6483393634aee94514186d21a4871e78d7' (2024-11-06) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/080166c15633801df010977d9d7474b4a6c549d7' (2024-10-30) → 'github:nixos/nixpkgs/dba414932936fde69f0606b4f1d87c5bc0003ede' (2024-11-06) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/fe21dd5ab593b2cd974161e462b2e2b0c8e24bae' (2024-11-04) → 'github:NixOS/nixpkgs/a46925097143c5535a814c0d9ca53b29fb2a5d1d' (2024-11-07) • Updated input 'nur': 'github:nix-community/NUR/6720812cce88e6bcd4fd20a081d2c48303e0388c' (2024-11-04) → 'github:nix-community/NUR/bfd50d178dff545abb87dbf0663a3bd7abfad92d' (2024-11-07) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/43a898b4d76f7f3f70df77a2cc2d40096bc9d75e' (2024-10-30) → 'github:nix-community/poetry2nix/a1925e0848c62ab542b0b93b1b22875ee6efcb3d' (2024-11-07) • Updated input 'sops-nix': 'github:Mic92/sops-nix/e9b5eef9b51cdf966c76143e13a9476725b2f760' (2024-11-03) → 'github:Mic92/sops-nix/c5ae1e214ff935f2d3593187a131becb289ea639' (2024-11-06) --- flake.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 66023b5..20d9f7f 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1730675461, - "narHash": "sha256-Mhqz3p/HEiI/zxBJWO57LYQf6gGlJB0tci6fiVXLjd8=", + "lastModified": 1730751873, + "narHash": "sha256-sdY29RWz0S7VbaoTwSy6RummdHKf0wUTaBlqPxrtvmQ=", "owner": "nix-community", "repo": "disko", - "rev": "380847d94ff0fedee8b50ee4baddb162c06678df", + "rev": "856a2902156ba304efebd4c1096dbf7465569454", "type": "github" }, "original": { @@ -298,11 +298,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1730302582, - "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1730537918, - "narHash": "sha256-GJB1/aaTnAtt9sso/EQ77TAGJ/rt6uvlP0RqZFnWue8=", + "lastModified": 1730919458, + "narHash": "sha256-yMO0T0QJlmT/x4HEyvrCyigGrdYfIXX3e5gWqB64wLg=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "f6e0cd5c47d150c4718199084e5764f968f1b560", + "rev": "e1cc1f6483393634aee94514186d21a4871e78d7", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730327045, - "narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=", + "lastModified": 1730883749, + "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "080166c15633801df010977d9d7474b4a6c549d7", + "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", "type": "github" }, "original": { @@ -362,11 +362,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1730707924, - "narHash": "sha256-B1VgouTS2j2pFsYPSAQWGees242Gp4iyCdapjK3lPpg=", + "lastModified": 1730994033, + "narHash": "sha256-UL/aB8nufAq7tLPJAuyT380IqiZXAdnp4t+BrNUxWYo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fe21dd5ab593b2cd974161e462b2e2b0c8e24bae", + "rev": "a46925097143c5535a814c0d9ca53b29fb2a5d1d", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1730708002, - "narHash": "sha256-I57tjJe+Yo2xLW1jSmOFFCf8Wk8Wr0hpoFGfPMTjhTs=", + "lastModified": 1730990741, + "narHash": "sha256-lfp3sBCEWsj/L83WjUvsBwusU0YX+BhajdC4VDdwknE=", "owner": "nix-community", "repo": "NUR", - "rev": "6720812cce88e6bcd4fd20a081d2c48303e0388c", + "rev": "bfd50d178dff545abb87dbf0663a3bd7abfad92d", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1730284601, - "narHash": "sha256-eHYcKVLIRRv3J1vjmxurS6HVdGphB53qxUeAkylYrZY=", + "lastModified": 1730961552, + "narHash": "sha256-TjfCllZmU8U2Bs/ENsrii7GCHBDkorPsmZ0d97DcaAQ=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "43a898b4d76f7f3f70df77a2cc2d40096bc9d75e", + "rev": "a1925e0848c62ab542b0b93b1b22875ee6efcb3d", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1730605784, - "narHash": "sha256-1NveNAMLHbxOg0BpBMSVuZ2yW2PpDnZLbZ25wV50PMc=", + "lastModified": 1730883027, + "narHash": "sha256-pvXMOJIqRW0trsW+FzRMl6d5PbsM4rWfD5lcKCOrrwI=", "owner": "Mic92", "repo": "sops-nix", - "rev": "e9b5eef9b51cdf966c76143e13a9476725b2f760", + "rev": "c5ae1e214ff935f2d3593187a131becb289ea639", "type": "github" }, "original": { From 525be5d0d0e74fa8412538151b0eae6d560cdeec Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 7 Nov 2024 21:28:23 +0100 Subject: [PATCH 36/49] Add wshowkeys --- modules/sway.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sway.nix b/modules/sway.nix index a35ca05..181f95d 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -28,4 +28,6 @@ lib.mkIf (config.jalr.gui.enable && config.jalr.gui.desktop == "sway") { }; icons.enable = true; }; + + programs.wshowkeys.enable = true; } From 27309cea2c4023163f2a3b7d92dd66ee8d962ec9 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 14:42:26 +0100 Subject: [PATCH 37/49] Make tree-style-tabs close confirmation floating --- users/jalr/modules/sway/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/users/jalr/modules/sway/default.nix b/users/jalr/modules/sway/default.nix index b53f2fb..e878052 100644 --- a/users/jalr/modules/sway/default.nix +++ b/users/jalr/modules/sway/default.nix @@ -286,6 +286,13 @@ in criteria = { app_id = "firefox"; title = "Firefox — Sharing Indicator"; }; command = "kill"; } + { + criteria = { + app_id = "firefox-esr"; + title = "Extension: \\\\(Tree Style Tab\\\\) - Close tabs\\\\? — Mozilla Firefox"; + }; + command = "floating enable"; + } ]; window.border = 2; From e573cde83fda041d7d1f68bf8770827eeed72b02 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 18:11:29 +0100 Subject: [PATCH 38/49] Fix handling of secrets --- hosts/iron/services/esphome/default.nix | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/hosts/iron/services/esphome/default.nix b/hosts/iron/services/esphome/default.nix index 6b08885..0e81496 100644 --- a/hosts/iron/services/esphome/default.nix +++ b/hosts/iron/services/esphome/default.nix @@ -2,9 +2,6 @@ args@{ lib, pkgs, config, custom-utils, ... }: let ports = import ../../ports.nix args; cfg = config.services.esphome; - devices = [ - ./yeelight-meteorite.yaml - ]; cfgdir = pkgs.stdenvNoCC.mkDerivation { name = "esphome-config"; src = ./devices; @@ -22,6 +19,7 @@ in { sops.secrets.esphome = { sopsFile = ../../secrets.yaml; + restartUnits = [ config.systemd.services.esphome.name ]; }; services.esphome = { @@ -29,11 +27,6 @@ in address = "127.0.0.1"; port = ports.esphome.tcp; package = pkgs.esphome; - #package = pkgs.esphome.overrideAttrs (attrs: { - # makeWrapperArgs = attrs.makeWrapperArgs ++ [ - # "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ]}" - # ]; - #}); }; systemd.services.esphome = { @@ -41,13 +34,13 @@ in "PLATFORMIO_CORE_DIR" = lib.mkForce "/tmp/.platformio"; }; serviceConfig = { - BindPaths = [ - "/var/lib/esphome" - "/var/lib/private/esphome" - ]; BindReadOnlyPaths = [ "/nix/store" - "${cfgdir}" + cfgdir + "%d/secrets.yaml:/var/lib/esphome/secrets.yaml" + ]; + BindPaths = [ + "/var/lib/esphome" ]; DeviceAllow = [ "char-ttyACM rw" @@ -55,8 +48,7 @@ in "char-ttyUSB rw" ]; ExecStartPre = [ - "${pkgs.rsync}/bin/rsync -a --delete --exclude=.esphome --exclude=.platformio --exclude=.gitignore '${cfgdir}/' '/var/lib/esphome/'" - "${pkgs.coreutils}/bin/ln -snf '%d/secrets.yaml' '/var/lib/esphome/secrets.yaml'" + "${pkgs.rsync}/bin/rsync -a --delete --checksum --exclude secrets.yaml --exclude=.esphome --exclude=.platformio --exclude=.gitignore '${cfgdir}/' '/var/lib/esphome/'" ]; LoadCredential = "secrets.yaml:${config.sops.secrets.esphome.path}"; PrivateTmp = true; From a7f19adb605f0e6d63a57eaa66feeb83f5375c4d Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 20:27:30 +0100 Subject: [PATCH 39/49] Implement staircase lighting --- .../esphome/devices/tuersprechanlage.yaml | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/hosts/iron/services/esphome/devices/tuersprechanlage.yaml b/hosts/iron/services/esphome/devices/tuersprechanlage.yaml index cb676ad..80a1843 100644 --- a/hosts/iron/services/esphome/devices/tuersprechanlage.yaml +++ b/hosts/iron/services/esphome/devices/tuersprechanlage.yaml @@ -32,7 +32,7 @@ wifi: binary_sensor: - platform: gpio name: Etagenklingel - id: etagenklingel + id: floor_bell pin: number: GPIO16 mode: @@ -43,7 +43,7 @@ binary_sensor: - platform: gpio name: Treppenlicht - id: treppenlicht + id: staircase_light pin: number: GPIO18 mode: @@ -52,19 +52,39 @@ binary_sensor: filters: - invert - delayed_off: 10s + on_press: + then: + - output.turn_on: output_staircase_light_ssr + - delay: 200ms + - output.turn_off: output_staircase_light_ssr output: - platform: gpio pin: GPIO15 - id: btn_door + id: output_door_opener + - platform: ledc + pin: + number: GPIO33 + inverted: true + id: output_staircase_light_ssr + frequency: 50000 + min_power: 0 + max_power: 0.12 button: - platform: template name: "Türöffner" - id: tueroeffner + id: btn_tueroeffner icon: mdi:lock-open on_press: - - logger.log: "Button pressed" - - output.turn_on: btn_door + - output.turn_on: output_door_opener - delay: 500ms - - output.turn_off: btn_door + - output.turn_off: output_door_opener + - platform: template + name: "Treppenlicht" + id: btn_staircase_light + icon: mdi:stairs + on_press: + - output.turn_on: output_staircase_light_ssr + - delay: 200ms + - output.turn_off: output_staircase_light_ssr From 8c30072409515440926ef6acfc480b73e4be4724 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 20:28:16 +0100 Subject: [PATCH 40/49] Add wifi signal sensor --- hosts/iron/services/esphome/devices/badspiegel.yaml | 3 +++ .../services/esphome/devices/chinafrickeldeckenleuchte.yaml | 5 +++++ hosts/iron/services/esphome/devices/fussbodenheizung.yaml | 3 +++ hosts/iron/services/esphome/devices/kueche-leiste.yaml | 3 +++ .../services/esphome/devices/led-panel-schreibtisch.yaml | 5 +++++ hosts/iron/services/esphome/devices/pflanzenleuchte.yaml | 5 +++++ hosts/iron/services/esphome/devices/tuerschloss.yaml | 5 +++++ hosts/iron/services/esphome/devices/tuersprechanlage.yaml | 5 +++++ hosts/iron/services/esphome/devices/waschmaschine.yaml | 3 +++ hosts/iron/services/esphome/devices/yeelight-meteorite.yaml | 5 +++++ 10 files changed, 42 insertions(+) diff --git a/hosts/iron/services/esphome/devices/badspiegel.yaml b/hosts/iron/services/esphome/devices/badspiegel.yaml index 8041d2e..2ee052b 100644 --- a/hosts/iron/services/esphome/devices/badspiegel.yaml +++ b/hosts/iron/services/esphome/devices/badspiegel.yaml @@ -90,6 +90,9 @@ esp32_touch: sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s - platform: dht pin: GPIO22 temperature: diff --git a/hosts/iron/services/esphome/devices/chinafrickeldeckenleuchte.yaml b/hosts/iron/services/esphome/devices/chinafrickeldeckenleuchte.yaml index 0edcf9f..802e77f 100644 --- a/hosts/iron/services/esphome/devices/chinafrickeldeckenleuchte.yaml +++ b/hosts/iron/services/esphome/devices/chinafrickeldeckenleuchte.yaml @@ -5,6 +5,11 @@ esp8266: logger: +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + bp5758d: data_pin: GPIO4 clock_pin: GPIO5 diff --git a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml index 1b1eff0..ac114f4 100644 --- a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml +++ b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml @@ -56,6 +56,9 @@ switch: icon: "mdi:electric-switch" sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s - platform: dht pin: GPIO2 temperature: diff --git a/hosts/iron/services/esphome/devices/kueche-leiste.yaml b/hosts/iron/services/esphome/devices/kueche-leiste.yaml index de9d8cb..3b8f396 100644 --- a/hosts/iron/services/esphome/devices/kueche-leiste.yaml +++ b/hosts/iron/services/esphome/devices/kueche-leiste.yaml @@ -62,6 +62,9 @@ light: gamma_correct: 0 sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s - platform: dht pin: GPIO5 temperature: diff --git a/hosts/iron/services/esphome/devices/led-panel-schreibtisch.yaml b/hosts/iron/services/esphome/devices/led-panel-schreibtisch.yaml index 0141c46..737d62e 100644 --- a/hosts/iron/services/esphome/devices/led-panel-schreibtisch.yaml +++ b/hosts/iron/services/esphome/devices/led-panel-schreibtisch.yaml @@ -39,6 +39,11 @@ esp32: logger: +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + output: - platform: ledc pin: GPIO1 diff --git a/hosts/iron/services/esphome/devices/pflanzenleuchte.yaml b/hosts/iron/services/esphome/devices/pflanzenleuchte.yaml index d961943..d66b2b2 100644 --- a/hosts/iron/services/esphome/devices/pflanzenleuchte.yaml +++ b/hosts/iron/services/esphome/devices/pflanzenleuchte.yaml @@ -27,6 +27,11 @@ wifi: fast_connect: On output_power: 8.5 +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + output: - platform: ledc pin: GPIO0 diff --git a/hosts/iron/services/esphome/devices/tuerschloss.yaml b/hosts/iron/services/esphome/devices/tuerschloss.yaml index b662b56..71863cf 100644 --- a/hosts/iron/services/esphome/devices/tuerschloss.yaml +++ b/hosts/iron/services/esphome/devices/tuerschloss.yaml @@ -27,6 +27,11 @@ wifi: fast_connect: On output_power: 8.5 +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + output: - platform: gpio pin: diff --git a/hosts/iron/services/esphome/devices/tuersprechanlage.yaml b/hosts/iron/services/esphome/devices/tuersprechanlage.yaml index 80a1843..cc0ede7 100644 --- a/hosts/iron/services/esphome/devices/tuersprechanlage.yaml +++ b/hosts/iron/services/esphome/devices/tuersprechanlage.yaml @@ -29,6 +29,11 @@ wifi: power_save_mode: none output_power: 10 +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + binary_sensor: - platform: gpio name: Etagenklingel diff --git a/hosts/iron/services/esphome/devices/waschmaschine.yaml b/hosts/iron/services/esphome/devices/waschmaschine.yaml index 3e4babb..82e25a3 100644 --- a/hosts/iron/services/esphome/devices/waschmaschine.yaml +++ b/hosts/iron/services/esphome/devices/waschmaschine.yaml @@ -27,6 +27,9 @@ external_components: components: [ miele_w433 ] sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s - platform: miele_w433 enable_7segment_pin: 27 clock_pin: 14 diff --git a/hosts/iron/services/esphome/devices/yeelight-meteorite.yaml b/hosts/iron/services/esphome/devices/yeelight-meteorite.yaml index 842fceb..e6b1a4b 100644 --- a/hosts/iron/services/esphome/devices/yeelight-meteorite.yaml +++ b/hosts/iron/services/esphome/devices/yeelight-meteorite.yaml @@ -36,6 +36,11 @@ wifi: gateway: 10.20.0.1 subnet: 255.255.240.0 +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + output: - platform: ledc pin: GPIO19 From 64dff5397b1995839a97bd10372bedd8ce66b863 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 20:29:14 +0100 Subject: [PATCH 41/49] Reduce on/off times --- .../esphome/devices/fussbodenheizung.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml index ac114f4..7ad5cef 100644 --- a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml +++ b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml @@ -87,8 +87,8 @@ climate: name: "Bad" sensor: temperature_bathroom humidity_sensor: humidity_bathroom - min_heating_off_time: 300s - min_heating_run_time: 300s + min_heating_off_time: 1s + min_heating_run_time: 1s min_idle_time: 30s heat_action: - switch.turn_on: relay_1 @@ -125,8 +125,8 @@ climate: name: "West" sensor: temperature_kitchen humidity_sensor: humidity_kitchen - min_heating_off_time: 300s - min_heating_run_time: 300s + min_heating_off_time: 1s + min_heating_run_time: 1s min_idle_time: 30s heat_action: - switch.turn_on: relay_3 @@ -143,8 +143,8 @@ climate: name: "Mitte" sensor: temperature_local humidity_sensor: humidity - min_heating_off_time: 300s - min_heating_run_time: 300s + min_heating_off_time: 1s + min_heating_run_time: 1s min_idle_time: 30s heat_action: - switch.turn_on: relay_4 @@ -161,8 +161,8 @@ climate: name: "Ost" sensor: temperature_local # FIXME #humidity_sensor: - min_heating_off_time: 300s - min_heating_run_time: 300s + min_heating_off_time: 1s + min_heating_run_time: 1s min_idle_time: 30s heat_action: - switch.turn_on: relay_5 From 15b3b572ff444cabba3fb3b466ac5ed63089efbf Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 20:30:03 +0100 Subject: [PATCH 42/49] Add bedroom --- .../esphome/devices/fussbodenheizung.yaml | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml index 7ad5cef..616f5a5 100644 --- a/hosts/iron/services/esphome/devices/fussbodenheizung.yaml +++ b/hosts/iron/services/esphome/devices/fussbodenheizung.yaml @@ -103,24 +103,26 @@ climate: default_target_temperature_low: 20 °C - name: abwesend default_target_temperature_low: 16 °C - #- platform: thermostat - # name: "Schlafzimmer" - # #sensor: heating_livingroom - # #humidity_sensor: - # min_heating_off_time: 300s - # min_heating_run_time: 300s - # min_idle_time: 30s - # heat_action: - # - switch.turn_on: relay_2 - # idle_action: - # - switch.turn_off: relay_2 - # default_preset: zuhause - # on_boot_restore_from: memory - # preset: - # - name: zuhause - # default_target_temperature_low: 16 °C - # - name: abwesend - # default_target_temperature_low: 15 °C + - platform: thermostat + name: "Schlafzimmer" + #sensor: heating_livingroom + #humidity_sensor: + sensor: temperature_local # FIXME + humidity_sensor: humidity # FIXME + min_heating_off_time: 1s + min_heating_run_time: 1s + min_idle_time: 30s + heat_action: + - switch.turn_on: relay_2 + idle_action: + - switch.turn_off: relay_2 + default_preset: zuhause + on_boot_restore_from: memory + preset: + - name: zuhause + default_target_temperature_low: 16 °C + - name: abwesend + default_target_temperature_low: 15 °C - platform: thermostat name: "West" sensor: temperature_kitchen From 798d68b0f70ecc69ebc582ef813c07d97a750ecc Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 21:53:12 +0100 Subject: [PATCH 43/49] Add pinspot --- hosts/iron/secrets.yaml | 6 +-- .../services/esphome/devices/pinspot.yaml | 52 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 hosts/iron/services/esphome/devices/pinspot.yaml diff --git a/hosts/iron/secrets.yaml b/hosts/iron/secrets.yaml index 4e19154..cfc9d5a 100644 --- a/hosts/iron/secrets.yaml +++ b/hosts/iron/secrets.yaml @@ -10,7 +10,7 @@ dkim-keys: synapse-turn-shared-secret: ENC[AES256_GCM,data:Q1XRds3Zud1kYkvD6s9WUzP+kNDNsxB5SHd6oCAaLCHhHhYENSAYTZOF+rGjCPNyKFL0e/A=,iv:zScRQrz+pXHNUh/BGOaV+TVnDR3wu1Z/UO1zXarKwtA=,tag:ckpVziE+yb0FjctcT7tAkg==,type:str] matrix-sliding-sync: ENC[AES256_GCM,data:CmR8Q5NL1m+eixenK4u1n3MfVh49/Q3ZIRmWfSbuFMr3u79rIGrtFf2EjaThCwBHQyXdYw1wyTouxhGZql1Fcp/HYma8u4w5nJOaJa1TXg==,iv:/kFqA/+kpCkhHZKJdhadjH11pZwh4MFiQPjY96t8M5k=,tag:aZkDCcbtonHMTv4TdBv1sQ==,type:str] rmfakecloud: ENC[AES256_GCM,data:ktKBKb6cRv1VF8tRvXIpxIy9hPinVPKK05mgvYzz18PEdcrCLpldm5xf7ffHtY5XzDOAMXDCiz6x4xyv7071frrF0spOEPnIzVhxwG8H2Ck=,iv:qJdHjv0RziAs4G9UGeRwGQ4GE5kaObJWpIYWpRKhr9c=,tag:PXgvU1hZK/gvWGyFJaHekg==,type:str] -esphome: ENC[AES256_GCM,data:ufIZkZo1aP/Th/8a+9srkJBqLqPQI/ymElIEBmTKzqsJ3HE/mx9QJ1aH0vGVed9W/wSJ+7+huFpB+pNAebJMohK/fAmAVG3lzgT0wKWw8g4u33VHb6X8FIW6q1+CYRnOCQsocgM4EX26YfzaxVpw9P4PF/abwB1bVzr9xnEL2JdJfstzxnR70dKO88WTolykysc443iDW80i0scH+sCh8JIfDrV+V0l3jT+woAeTw1VA0hFa5x9i3tdfrHpzc/sN1/OW6F1CsMVS2pwUTkr7pKp5nfjxhEPi94iLMmakm0XWPZpay2213FQEUYiRqCIGmD1Oiyq0nSVcOAkc66TNwsqrdPCkCL8OPTXuTd+yIfAuU3267kUMNcN2A9kqGMx4Inj8JGlmvxuoQueuXIA4gvVFhJFBdovpl10HY/YkG/cGM0gazfF2+5xG93RgD9Uryq1g61XTFOkOaH7XtGs8Q13xnnXVwfq2pK/vnx9kQkgXJJQRU1Ng8PAg+Rw1VK6bzVz5ugj6q1ei56orNy4A8FU1z1aGyChfPT3XPaDwLr0pEXvc2Vz/6CxAosSpNHIQ6fO0XBM7nvIs/2jHZssXSVo2iwYRZsgZft60cg0FfBmDyc3QH6pVjYhoQGsBlfQt5CtW7XX3rJjQTcDLfzUlO8Ykax7TXZKnDcvtNonRm45bmV+1CqS9KLrBHouWN0axtweabAVW8dld9EnL3CrclE/RbTI0nPOR00S+Ip7wNuBto30yTACxaPHYF79izHu4rQjmm2N5Jt+nI8maEVva6IbAog16NUw6fYDaMwBDeSszBZm0BwNMf36EP/Mcp+MXrBfP1kOYe6HGjftMRDky83XYvP6Cx7FJcPXIZdsMQydxsXB3LKroFqoS2HsHBnCgQbbraQ5UWi40vKXANlKbgFcutqkATvoPW6Hbh07vfiLVfDeuHU9DUCFlgK7KHPWk/g+Uo+TUmgTVKNhbGU/vFu/9h4kIrbf/ocqL/tyMjwA5Yp9e0rQCez8w5Zqfbtqm4N1WB518Q7p52r8C+yLBAua7yB0gAc7SENXWFafkbHClchZXi3c0hY64YvuweDp8G/bPFT/yLuY/yBvA3F2G3CxZXzCMvhMVQfm2yzJeOL20vWumZ8LuIaXJ/13AzLp+lUrc8RmJvU/Hrp6xsEqzXz34qMiBNUR1BKjNAS86WJ1rzD3QtejeETGDwsw016jNbyIMcShgxiEMHnD6HXzWnfTv2fO5xICiAG/VMm5h+vC3MweW2XO01P3O0/Rq/OSy3R8ZlEFErlhR1HiXhc2CdxuuxqDySi0/rP/Jpxf25Zi8mY9YBTFlV0T9ApzJoTwlobMmmxHmqq+vQSKAxLq0lJ/bpO+8utchHbnQNUICveCkX4w+rK9Vnls3zbiLTBnsf+J4y5zpLZ5HkDCUNcEnD29ZR30IYoBTLUG3PlfyH++rLl5ynW5QKUWLnUdjvf9ZwS2veFAZw6tfHelzjkZ5tps5BkjS8YAi/x70Jw4qs3fzZudq6Lej4fsMdkBnYSSN2s7Sc3A1,iv:jSR/M4KS+cZMQgtTZWtPcpmKFD5QNr7s8ClAbXzpR2s=,tag:sp3BnZi+b9WuIiCPapG6Bw==,type:str] +esphome: ENC[AES256_GCM,data:QyPrVPhqvaCfx7oRmJ14EFpEIpQRwlLwTABK9qTP/wYcoflFsorNAmIoTiX/4KziQl050ByztnjIhrsxFx2dN6dv+RiLVWP+k0G63rfeS5gxe8QSgzsEtWWaUk3DE87i20DUusj1/B6yUsMApMohjaufuVzReL2MtVSVgtDUS6nVqGnRubrdujAxyRWvjQtamWBa1fjz39U876F10KMUYB+iGtObfNJGH18lAQ1arKEUQQSl8u1vNJuZiKqFhzxcu/IF6AhJgcKmCi2nrcEgbrv4ZwOcJ7+VG29qY7C4LCeAU4wOWJmtnCSf9osSwzR5hFco46L3Y8k0XXEOiEAJl+8ZLNKqQJpShh9wioMrj9XNpX/PvGCpBLTHsXTCGktDdbK/RLEGZnnL0s6If7Qs0XTwWZEe0q4IsltfdWJdZQWbvlY58ooUkK55wml/SlpuHgSdY6pOp/bOnBwvIrh/962DWtSXDxNnvps4Qy0eRUtpS2G6+rLIXXkq7KlSUg/A5XRNWbLGX5u7pJuvJ5xlldFW+tb1rqyrKXGIGra3Y6Ib4Z17znmajMSIeQItChj8UsOqlcHaCI5s8kDFjafJfpTTtAm0mj2cBFYmWHC/WR1YAtd2mrffr258CShtO+eeAqhSSTopIL637udKaY1Vto1dVReTmK24ANopQOaxnTtFjBdQaeluP4PAWrAGADBio1iwjsWIQlr0vnMjSBd0JcnW0Q3i+/5zhQfaEzZ6FQXOs05+l7ryLrGgBbyM2FRLTuAWBsv5yv3lz8FiSGVNaLMW5rofZpFvX0oa7P9HyU/RIpUzx307VBsIJlzrW2NgWvc9iLHLHWJDa7xcemGTvZDp/0BujYHeYYfVViPtVcCicLvDLikgtJRlkdPmyRoMSx0o3taoPsYoVZielo5EZpLiaLwuCNnCk2fRxAgPUa4+zGhZc2Z/BrOvK7sxcyIXEYRrZ8Ti2iNQJthNNb1CzSUXpdpSZtFi1jjiC45V0dlg/lSqrkRjyA9DpGbegt3WpO/6X+uc9vSAgR4f/0xNngTKzCfFV+fyUJXffpje9fQhQnecsTDjjc3aLiESqc3mx8MP6gHI9fS8z8PU72t+4tJxe8hjo7VWlInOVKV9zp9Tn+P4Ez1MebPJRlrwHGSVFsPhKct+CgzE+Q0B3vvcWyQfdJHeFCPWsTWmcCUoJf61fQO/3JwZI8YE3HET+NsRoxVHTl099LzWWCbrfT4uN3+O3VQbceLM+KxKCLVGNEHKlF8NHCIk4KCWhKNwhXvuMjf4GgtYbENFn1QbmiQFpYfIl8FA8PZVk7x+dzuROL4NpIKaBfrg34LQnxFpc2YCBnEsmsJVPybR5ZHC8eDL7JdVSg+FhvOxzBkvCeQjG8746/t0HJYPucisFCmP1isGpcn8Eku+BT/2XocHsUwpyo+RQoruWKwkLtnCHeaGSszqWzugSGXU4b4T2HB2yU9ORpt6uP+wbtc49GeMHrUGiO+w6BQm3TzPEZ0XMh4+8iayGhbd8T213C72sHpo5eCbv7C2zE/3dxHr2/+xtfstQFRuMPhq/r/4aqkeGKTwWEBcOwD1knlnbXo5OZsdvX9SeqF+mno/uDxZW00QqaWiQz89SWLGHtC4gjbE2wU2IpiGZMTOtNieOrjjCfdX3ZkrhA==,iv:Qn0nDrXRCOJaTJJBK6/PEGbhS1pbB0dTZYakgha5wJQ=,tag:8GeYWlsxgAGfFL61V5CwXg==,type:str] home-assistant: ENC[AES256_GCM,data:wcFMxDdRCHf/shO9v2WaGgrsa9J2WP62xFs=,iv:9ckeIO62cFZUo8fPyQj445CrJVTooNlwLapM/oTsrkk=,tag:mlfxtXDPsB3T79P9BX9oJQ==,type:str] sops: kms: [] @@ -27,8 +27,8 @@ sops: SU1USkxFUUY2NVhmUHBhZkdrNDR1Q0kKiXIicInELRjDR3tuyA+lnXeCcd9lYvbV GnBRGPM7BNO/6AA7HhAei48Kt+XE6+jQX66yTXyviKhK7Lpjrlb2YQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-09-11T16:10:31Z" - mac: ENC[AES256_GCM,data:7STJaln+9X6xZFAyLSoMCw2PKNiRr4GNhxGbZRPRf+nKfkFh7wJRS3YWVrxd9iOonSPsuHfPnBrAPiq7ILXqwfjNcyf2HtOIPxHz0utE6b0X7KvEwmLSRMOQG9rpsETE5UBQ+DgtU9IwZzTXgh9CGZpHWQAPeOI+lK4OKLlXvkk=,iv:E++ECn4SJy43lW5RWxjSDc7dj0LWDXIuO+5fVFE3+zU=,tag:QFvao9PWSllzXXhGwFQgrw==,type:str] + lastmodified: "2024-11-08T17:10:15Z" + mac: ENC[AES256_GCM,data:bCkqwd22O4K1Ivix4JWEY+RAiPB+8NP3y2KrDEeGXR3R03t6Xi2S+tXLKh9MBp0/jatUS2COs1tY0+hL2quC7rjpv25hufA+7oHA+jASgglD+5lKnc1OGpvBt4eMCszYorIKOP55glLLMn8WmYAPQm5PDPnfNtwZwEs1zmwffjA=,iv:YR38y2za5FrTr+t7hminVStO9/Z9zFbKoBRtuzrl+rI=,tag:ci5MZ2cjRjc8HYKJy11Jbg==,type:str] pgp: - created_at: "2024-01-31T01:20:30Z" enc: |- diff --git a/hosts/iron/services/esphome/devices/pinspot.yaml b/hosts/iron/services/esphome/devices/pinspot.yaml new file mode 100644 index 0000000..98fc572 --- /dev/null +++ b/hosts/iron/services/esphome/devices/pinspot.yaml @@ -0,0 +1,52 @@ +esphome: + name: "pinspot" + friendly_name: "Pinspot" + platformio_options: + board_build.flash_mode: dio + +esp32: + board: esp32-c3-devkitm-1 + variant: ESP32C3 + framework: + type: esp-idf + +logger: + +api: + encryption: + key: !secret apikey_pinspot + +ota: + password: !secret otapass_pinspot + +wifi: + ssid: !secret wifi_ssid_bw + password: !secret wifi_password_bw + domain: .iot.bw.jalr.de + enable_on_boot: True + fast_connect: On + output_power: 8.5 + +sensor: + - platform: wifi_signal + name: "WiFi Signal Sensor" + update_interval: 60s + +output: + - platform: ledc + pin: GPIO1 + id: output_led_brightness + min_power: 0.028 + zero_means_zero: true + - platform: ledc + pin: GPIO4 + inverted: true + id: output_led_colortemp + +light: + - platform: color_temperature + name: "Pinspot" + color_temperature: output_led_colortemp + brightness: output_led_brightness + cold_white_color_temperature: 6000 K + warm_white_color_temperature: 2700 K From 715276f7c7c2cb39bdd89be84286b5439d652f99 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 22:16:19 +0100 Subject: [PATCH 44/49] Reduce opacity --- users/jalr/modules/alacritty.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/jalr/modules/alacritty.nix b/users/jalr/modules/alacritty.nix index 3c82e32..77f3b5b 100644 --- a/users/jalr/modules/alacritty.nix +++ b/users/jalr/modules/alacritty.nix @@ -114,7 +114,7 @@ let scrolling.history = 100000; - window.opacity = 0.95; + window.opacity = 0.9; }; settings = { dark = commonSettings // { From bae82fdec30933a80324455b83ecec7a89006565 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Fri, 8 Nov 2024 22:17:18 +0100 Subject: [PATCH 45/49] Install qbittorrent from master as the package on 24.05 channel has a vulnerability --- modules/qbittorrent/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/qbittorrent/default.nix b/modules/qbittorrent/default.nix index 810685b..6065479 100644 --- a/modules/qbittorrent/default.nix +++ b/modules/qbittorrent/default.nix @@ -59,7 +59,7 @@ in serviceConfig = { Restart = "always"; - ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox --profile=${cfg.configDir} --webui-port=${toString cfg.webuiPort}"; + ExecStart = "${pkgs.master.qbittorrent-nox}/bin/qbittorrent-nox --profile=${cfg.configDir} --webui-port=${toString cfg.webuiPort}"; User = "qbittorrent"; Group = "qbittorrent"; From f881e0c22d6952d43de4e9f86d85878527e7363e Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sun, 10 Nov 2024 18:31:36 +0100 Subject: [PATCH 46/49] Remove raumtemp_hk_1 and rauchgasauslastung --- hosts/aluminium/services/home-assistant.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/hosts/aluminium/services/home-assistant.nix b/hosts/aluminium/services/home-assistant.nix index 5fc1fe8..2b19ab4 100644 --- a/hosts/aluminium/services/home-assistant.nix +++ b/hosts/aluminium/services/home-assistant.nix @@ -22,13 +22,11 @@ in { entity = "sensor.guntamaticbiostar_puffer_unten"; } { entity = "sensor.guntamaticbiostar_kesseltemperatur"; } { entity = "sensor.guntamaticbiostar_vorlauf_ist_1"; } - { entity = "sensor.guntamaticbiostar_raumtemp_hk_1"; } { entity = "sensor.guntamaticbiostar_aussentemperatur"; } { entity = "sensor.guntamaticbiostar_co2_gehalt"; } { entity = "select.guntamaticbiostar_program"; } { entity = "sensor.guntamaticbiostar_programm"; } { entity = "sensor.guntamaticbiostar_programm_hk1"; } - { entity = "sensor.guntamaticbiostar_rauchgasauslastung"; } { entity = "sensor.guntamaticbiostar_rucklauftemperatur"; } { entity = "sensor.guntamaticbiostar_servicezeit"; } ]; From 22bdf86a86691d0874ae93ace18e346b43dd911f Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sun, 10 Nov 2024 18:42:11 +0100 Subject: [PATCH 47/49] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/856a2902156ba304efebd4c1096dbf7465569454' (2024-11-04) → 'github:nix-community/disko/5e40e02978e3bd63c2a6a9fa6fa8ba0e310e747f' (2024-11-08) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/dba414932936fde69f0606b4f1d87c5bc0003ede' (2024-11-06) → 'github:nixos/nixpkgs/83fb6c028368e465cd19bb127b86f971a5e41ebc' (2024-11-07) • Updated input 'nixpkgsMaster': 'github:NixOS/nixpkgs/a46925097143c5535a814c0d9ca53b29fb2a5d1d' (2024-11-07) → 'github:NixOS/nixpkgs/44bbe5ddad08599cb6556157c1e20242b5d9a0b2' (2024-11-10) • Updated input 'nur': 'github:nix-community/NUR/bfd50d178dff545abb87dbf0663a3bd7abfad92d' (2024-11-07) → 'github:nix-community/NUR/5b5350f16cefe83e1a3ed3f30d69b6af654f0d52' (2024-11-10) • Updated input 'poetry2nix': 'github:nix-community/poetry2nix/a1925e0848c62ab542b0b93b1b22875ee6efcb3d' (2024-11-07) → 'github:nix-community/poetry2nix/f554d27c1544d9c56e5f1f8e2b8aff399803674e' (2024-11-10) • Updated input 'sops-nix': 'github:Mic92/sops-nix/c5ae1e214ff935f2d3593187a131becb289ea639' (2024-11-06) → 'github:Mic92/sops-nix/f1675e3b0e1e663a4af49be67ecbc9e749f85eb7' (2024-11-10) --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 20d9f7f..0525c8c 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1730751873, - "narHash": "sha256-sdY29RWz0S7VbaoTwSy6RummdHKf0wUTaBlqPxrtvmQ=", + "lastModified": 1731060864, + "narHash": "sha256-aYE7oAYZ+gPU1mPNhM0JwLAQNgjf0/JK1BF1ln2KBgk=", "owner": "nix-community", "repo": "disko", - "rev": "856a2902156ba304efebd4c1096dbf7465569454", + "rev": "5e40e02978e3bd63c2a6a9fa6fa8ba0e310e747f", "type": "github" }, "original": { @@ -330,11 +330,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730883749, - "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", + "lastModified": 1730963269, + "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", + "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", "type": "github" }, "original": { @@ -394,11 +394,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1730994033, - "narHash": "sha256-UL/aB8nufAq7tLPJAuyT380IqiZXAdnp4t+BrNUxWYo=", + "lastModified": 1731260124, + "narHash": "sha256-BEOxhi+NnklFH0J+Zcar4p8iOzj/Qvm216JXYAvAreA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a46925097143c5535a814c0d9ca53b29fb2a5d1d", + "rev": "44bbe5ddad08599cb6556157c1e20242b5d9a0b2", "type": "github" }, "original": { @@ -410,11 +410,11 @@ }, "nur": { "locked": { - "lastModified": 1730990741, - "narHash": "sha256-lfp3sBCEWsj/L83WjUvsBwusU0YX+BhajdC4VDdwknE=", + "lastModified": 1731258665, + "narHash": "sha256-DVFTn7Ol69nWLSFwnBj/2T3wptOC97MH4i5NHlkQrzk=", "owner": "nix-community", "repo": "NUR", - "rev": "bfd50d178dff545abb87dbf0663a3bd7abfad92d", + "rev": "5b5350f16cefe83e1a3ed3f30d69b6af654f0d52", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1730961552, - "narHash": "sha256-TjfCllZmU8U2Bs/ENsrii7GCHBDkorPsmZ0d97DcaAQ=", + "lastModified": 1731205797, + "narHash": "sha256-F7N1mxH1VrkVNHR3JGNMRvp9+98KYO4b832KS8Gl2xI=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "a1925e0848c62ab542b0b93b1b22875ee6efcb3d", + "rev": "f554d27c1544d9c56e5f1f8e2b8aff399803674e", "type": "github" }, "original": { @@ -526,11 +526,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1730883027, - "narHash": "sha256-pvXMOJIqRW0trsW+FzRMl6d5PbsM4rWfD5lcKCOrrwI=", + "lastModified": 1731213149, + "narHash": "sha256-jR8i6nFLmSmm0cIoeRQ8Q4EBARa3oGaAtEER/OMMxus=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c5ae1e214ff935f2d3593187a131becb289ea639", + "rev": "f1675e3b0e1e663a4af49be67ecbc9e749f85eb7", "type": "github" }, "original": { From 3ceac436b938d04606e9bdb48834ac67bf2aa180 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Sun, 10 Nov 2024 18:50:16 +0100 Subject: [PATCH 48/49] Add notification to stoke up --- hosts/aluminium/services/home-assistant.nix | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hosts/aluminium/services/home-assistant.nix b/hosts/aluminium/services/home-assistant.nix index 2b19ab4..2395ff9 100644 --- a/hosts/aluminium/services/home-assistant.nix +++ b/hosts/aluminium/services/home-assistant.nix @@ -83,6 +83,38 @@ in }; default_config = { }; "automation nix" = [ + { + alias = "Nachschüren"; + description = "Benachrichtigung auf iPad bei Wechsel auf Teillast"; + mode = "single"; + trigger = [ + { + platform = "state"; + entity_id = [ "sensor.guntamaticbiostar_betrieb" ]; + from = "VOLLLAST"; + to = "TEILLAST"; + } + ]; + condition = [ + { + condition = "numeric_state"; + entity_id = "sensor.guntamaticbiostar_pufferladung"; + below = "80"; + } + ]; + action = [ + { + device_id = "5612874405fa2ee539ad4518a1bb8e34"; + domain = "mobile_app"; + type = "notify"; + message = '' + Kessel läuft auf Teillast und Puffer ist unter 80%. Vielleicht willst du + nachschüren. + ''; + title = "Nachschüren?"; + } + ]; + } ]; "automation ui" = "!include automations.yaml"; "scene nix" = [ From 008269cdbafaaf4019a2b9b13f08a6c982756cd5 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Mon, 11 Nov 2024 11:42:58 +0100 Subject: [PATCH 49/49] Update README --- README.md | 8 +------- users/README.md | 9 +++++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 32052e4..5d6c327 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,4 @@ -## home-manager -https://github.com/nix-community/home-manager - -For a systematic overview of Home Manager and its available options, please see -- the [Home Manager manual](https://nix-community.github.io/home-manager/index.html) and -- the [Home Manager configuration options](https://nix-community.github.io/home-manager/options.html). - +# jalr's NixOS Configuration ## Install a new host diff --git a/users/README.md b/users/README.md index e245e64..50675ba 100644 --- a/users/README.md +++ b/users/README.md @@ -1,2 +1,7 @@ -# Documentation -[Home Manager Manual](https://rycee.gitlab.io/home-manager/) +# Home Manager +The user configuration is managed by [Home Manager](https://github.com/nix-community/home-manager) + +For a systematic overview of Home Manager and its available options, please see +- the [Home Manager manual](https://nix-community.github.io/home-manager/index.html) and +- the [Home Manager configuration options](https://nix-community.github.io/home-manager/options.html). +