diff options
author | makefu <github@syntax-fehler.de> | 2020-03-03 21:17:43 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2020-03-03 21:17:43 +0100 |
commit | e1d6406fbd7be66bd4a2ebd08c568a19ee09f906 (patch) | |
tree | ebbe26c1bfcc6dc9b186e1ece00608cc9ce88a7f /makefu/2configs/ham/zigbee2mqtt | |
parent | 2563c59e73dfe9df7b98d5b184785f3a5936ca17 (diff) |
ma ham/zigbee2mqtt: giving up
docker-container that shit away
Diffstat (limited to 'makefu/2configs/ham/zigbee2mqtt')
-rw-r--r-- | makefu/2configs/ham/zigbee2mqtt/default.nix | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/makefu/2configs/ham/zigbee2mqtt/default.nix b/makefu/2configs/ham/zigbee2mqtt/default.nix index cb1f80d8a..7c55326f9 100644 --- a/makefu/2configs/ham/zigbee2mqtt/default.nix +++ b/makefu/2configs/ham/zigbee2mqtt/default.nix @@ -1,31 +1,20 @@ {config, pkgs, lib, ...}: -let - pkg = pkgs.callPackage ./zigbee2mqtt.nix { }; -in { - #users.users.z2m = { - # extraGroups = [ "dialout" ]; - #}; - + # symlink the zigbee controller services.udev.extraRules = '' SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dailout" ''; - #systemd.services.zigbee2mqtt = { - # wantedBy = ["multi-user.target" ]; - # after = [ "network.target" ]; - # description = "Run zigbee2mqtt as daemon"; - # environment.ZIGBEE2MQTT_DATA = "/var/lib/zigbee2mqtt"; - # serviceConfig = { - # WorkingDirectory = ''${pkg}/lib/node_modules/zigbee2mqtt''; - # ExecStart = ''${pkgs.nodejs-12_x}/bin/node index.js''; - # StandardOutput = "inherit"; - # StandardError = "inherit"; - # Restart = "always"; - # User = "z2m"; - # StateDirectory = "zigbee2mqtt"; - # #DeviceAllow = "/dev/cc2531 rw"; - # }; - #}; + + system.activationScripts.installZigbee = '' + install -d /var/lib/zigbee2mqtt + ''; + + docker-containers.zigbee2mqtt = { + image = "koenkk/zigbee2mqtt"; + extraDockerOptions = [ "--device=/dev/cc2531:/dev/cc2531" ]; + volumes = ["/var/lib/zigbee2mqtt:/app/data"]; + }; + state = [ "/var/lib/zigbee2mqtt/configuration.yaml" "/var/lib/zigbee2mqtt/state.json" ]; } |