From 4a182ff5225b5ab818cfe7159dead8bb5ab065dc Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 28 Jun 2023 12:53:29 +0200 Subject: [PATCH] fuuko: Make co2 exporter more reliable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also “fixes” a typo in the variable name. --- machines/fuuko/services/co2_exporter.nix | 5 +++++ pkgs/co2_exporter/module.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/machines/fuuko/services/co2_exporter.nix b/machines/fuuko/services/co2_exporter.nix index e0a4e51..16d9237 100644 --- a/machines/fuuko/services/co2_exporter.nix +++ b/machines/fuuko/services/co2_exporter.nix @@ -4,5 +4,10 @@ services.co2_exporter = { enable = true; listenAddress = "${config.sbruder.wireguard.home.address}:9672"; # uses port numer of unrelated co2 exporter to avoid 8080 + device = "/dev/airco2ntrol"; }; + + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", SYMLINK+="airco2ntrol" + ''; } diff --git a/pkgs/co2_exporter/module.nix b/pkgs/co2_exporter/module.nix index 23f93ba..d679fda 100644 --- a/pkgs/co2_exporter/module.nix +++ b/pkgs/co2_exporter/module.nix @@ -30,7 +30,7 @@ in environment = { CO2MONITOR_ADDRESS = cfg.listenAddress; } // (lib.optionalAttrs (!isNull cfg.device) { - CO2MONITOR_DEVICE = cfg.device; + CO2MOINITOR_DEVICE = cfg.device; # MOINITOR ✓ }); serviceConfig = { ExecStart = "${cfg.package}/bin/co2_exporter";