2021-03-12 19:32:34 +00:00
|
|
|
{config, pkgs, lib, ...}:
|
|
|
|
|
|
|
|
let
|
|
|
|
dataDir = "/var/lib/zigbee2mqtt";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# symlink the zigbee controller
|
|
|
|
|
|
|
|
services.zigbee2mqtt = {
|
|
|
|
enable = true;
|
|
|
|
inherit dataDir;
|
2021-12-05 13:21:19 +00:00
|
|
|
settings = {
|
2021-03-12 19:32:34 +00:00
|
|
|
permit_join = true;
|
2023-02-27 12:37:35 +00:00
|
|
|
serial.port = "/dev/zigbee";
|
2021-03-12 19:32:34 +00:00
|
|
|
homeassistant = true;
|
2023-01-11 14:16:23 +00:00
|
|
|
frontend.port = 8521;
|
2021-03-12 19:32:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
state = [ "${dataDir}/devices.yaml" "${dataDir}/state.json" ];
|
|
|
|
|
|
|
|
systemd.services.zigbee2mqtt = {
|
|
|
|
# override automatic configuration.yaml deployment
|
|
|
|
environment.ZIGBEE2MQTT_DATA = dataDir;
|
|
|
|
after = [
|
|
|
|
"home-assistant.service"
|
|
|
|
"mosquitto.service"
|
|
|
|
"network-online.target"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|