mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-23 08:37:38 +01:00
15f505a6fd
Signed-off-by: Magic_RB <magic_rb@redalder.org>
60 lines
1.6 KiB
Nix
60 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";
|
|
};
|
|
};
|
|
};
|
|
});
|
|
}
|