2022-01-18 00:23:43 +01:00
|
|
|
{ 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://localhost:1883";
|
|
|
|
user = "\${MQTT_USER}";
|
|
|
|
password = "\${MQTT_PASSWORD}";
|
|
|
|
};
|
|
|
|
|
|
|
|
frontend =
|
|
|
|
{ port = 8456;
|
|
|
|
host = "0.0.0.0";
|
|
|
|
};
|
|
|
|
|
|
|
|
advanced =
|
|
|
|
{ pan_id = 15408;
|
|
|
|
};
|
|
|
|
|
2022-05-31 22:04:00 +02:00
|
|
|
serial.port = "/dev/ttyUSB0";
|
2022-01-18 00:23:43 +01:00
|
|
|
|
|
|
|
devices = "devices.yaml";
|
|
|
|
groups = "groups.yaml";
|
|
|
|
log_level = "debug";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|