about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2024-02-03 03:44:36 +0100
committerGitHub <noreply@github.com>2024-02-03 03:44:36 +0100
commite1ee205a9960d9a5f213cd77124ee75af21b928f (patch)
tree704e16e504ab2a10221c73994cf5220a9e7fe09b /nixos
parent79a13f1437e149dc7be2d1290c74d378dad60814 (diff)
parentdec6392bc29e34e23f21451b58f629930c6ddc78 (diff)
downloadnixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar.gz
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar.bz2
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar.lz
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar.xz
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.tar.zst
nixlib-e1ee205a9960d9a5f213cd77124ee75af21b928f.zip
Merge pull request #285931 from mweinelt/zigbee2mqtt-1.35.2
zigbee2mqtt: 1.35.1 -> 1.35.2
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/home-automation/zigbee2mqtt.nix1
-rw-r--r--nixos/tests/zigbee2mqtt.nix13
2 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/services/home-automation/zigbee2mqtt.nix b/nixos/modules/services/home-automation/zigbee2mqtt.nix
index a653e49a09f6..570ce41aa6d4 100644
--- a/nixos/modules/services/home-automation/zigbee2mqtt.nix
+++ b/nixos/modules/services/home-automation/zigbee2mqtt.nix
@@ -71,6 +71,7 @@ in
       after = [ "network.target" ];
       environment.ZIGBEE2MQTT_DATA = cfg.dataDir;
       serviceConfig = {
+        Type = "notify";
         ExecStart = "${cfg.package}/bin/zigbee2mqtt";
         User = "zigbee2mqtt";
         Group = "zigbee2mqtt";
diff --git a/nixos/tests/zigbee2mqtt.nix b/nixos/tests/zigbee2mqtt.nix
index 1a40d175df83..9d6d03a4b9bb 100644
--- a/nixos/tests/zigbee2mqtt.nix
+++ b/nixos/tests/zigbee2mqtt.nix
@@ -3,6 +3,15 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
     name = "zigbee2mqtt";
     nodes.machine = { pkgs, ... }:
       {
+        systemd.services.dummy-serial = {
+          wantedBy = [
+            "multi-user.target"
+          ];
+          serviceConfig = {
+            ExecStart = "${pkgs.socat}/bin/socat pty,link=/dev/ttyACM0,mode=666 pty,link=/dev/ttyACM1";
+          };
+        };
+
         services.zigbee2mqtt = {
           enable = true;
         };
@@ -11,10 +20,10 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
       };
 
     testScript = ''
-      machine.wait_for_unit("zigbee2mqtt.service")
+      machine.wait_for_unit("multi-user.target")
       machine.wait_until_fails("systemctl status zigbee2mqtt.service")
       machine.succeed(
-          "journalctl -eu zigbee2mqtt | grep \"Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'\""
+          "journalctl -eu zigbee2mqtt | grep 'Failed to connect to the adapter'"
       )
 
       machine.log(machine.succeed("systemd-analyze security zigbee2mqtt.service"))