diff options
Diffstat (limited to 'makefu/2configs/home/ham/zigbee2mqtt/default.nix')
-rw-r--r-- | makefu/2configs/home/ham/zigbee2mqtt/default.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/makefu/2configs/home/ham/zigbee2mqtt/default.nix b/makefu/2configs/home/ham/zigbee2mqtt/default.nix new file mode 100644 index 000000000..a75075273 --- /dev/null +++ b/makefu/2configs/home/ham/zigbee2mqtt/default.nix @@ -0,0 +1,28 @@ +{config, pkgs, lib, ...}: + +let + dataDir = "/var/lib/zigbee2mqtt"; +in + { + # symlink the zigbee controller + services.udev.extraRules = '' + SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" + ''; + + services.zigbee2mqtt = { + enable = true; + inherit dataDir; + }; + + state = [ "${dataDir}/configuration.yaml" "${dataDir}/state.json" ]; + + systemd.services.zigbee2mqtt = { + # override automatic configuration.yaml deployment + serviceConfig.ExecStartPre = lib.mkForce "${pkgs.coreutils}/bin/true"; + after = [ + "home-assistant.service" + "mosquitto.service" + "network-online.target" + ]; + }; +} |