mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-29 11:36:16 +01:00
60 lines
1.7 KiB
Nix
60 lines
1.7 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://localhost:1883";
|
||
|
user = "\${MQTT_USER}";
|
||
|
password = "\${MQTT_PASSWORD}";
|
||
|
};
|
||
|
|
||
|
frontend =
|
||
|
{ port = 8456;
|
||
|
host = "0.0.0.0";
|
||
|
};
|
||
|
|
||
|
advanced =
|
||
|
{ pan_id = 15408;
|
||
|
};
|
||
|
|
||
|
serial.port = "/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_4c004e9c53c9eb118a9f8b4f1d69213e-if00-port0";
|
||
|
|
||
|
devices = "devices.yaml";
|
||
|
groups = "groups.yaml";
|
||
|
log_level = "debug";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
});
|
||
|
}
|