cluster/containers/zigbee2mqtt.nix
Magic_RB 15f505a6fd
Stop using localhost, it seems to not be reliable, use IP
Signed-off-by: Magic_RB <magic_rb@redalder.org>
2022-09-18 18:33:28 +02:00

59 lines
1.6 KiB
Nix

{ nglib, nixpkgs }:
nglib.makeSystem {
system = "x86_64-linux";
name = "nixng-zigbee2mqtt";
inherit nixpkgs;
config = ({ pkgs, config, nglib, ... }:
let
ids = config.ids;
in
{
config = {
dumb-init = {
enable = true;
type.services = { };
};
init.services.zigbee2mqtt = {
shutdownOnExit = true;
};
services.zigbee2mqtt = {
enable = true;
user = "root";
envsubst = true;
package = (import (pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "0c408a087b4751c887e463e3848512c12017be25";
sha256 = "sha256-vBVwv3+kPrxbNyfo48cB5cc5/4tq5zlJGas/qw8XNBE=";
}) { inherit (pkgs.stdenv.hostPlatform) system; }).zigbee2mqtt;
config =
{ homeassistant = true;
permit_join = true;
mqtt = {
base_topic = "zigbee2mqtt";
server = "mqtt://127.0.0.1:1883";
user = "\${MQTT_USER}";
password = "\${MQTT_PASSWORD}";
};
frontend =
{ port = 8456;
host = "0.0.0.0";
};
advanced =
{ pan_id = 15408;
};
serial.port = "/dev/ttyUSB0";
devices = "devices.yaml";
groups = "groups.yaml";
log_level = "debug";
};
};
};
});
}