chore(z2m): shared data

This commit is contained in:
arcnmx 2024-04-08 11:33:04 -07:00
parent 38996b3e0c
commit 9a65b1c8dc
2 changed files with 11 additions and 2 deletions

View file

@ -9,10 +9,10 @@
inherit (lib.modules) mkIf mkDefault;
cfg = config.services.zigbee2mqtt;
in {
sops.secrets.z2m-secret = {
sops.secrets.z2m-secret = mkIf cfg.enable {
sopsFile = mkDefault ./secrets/zigbee2mqtt.yaml;
owner = "zigbee2mqtt";
path = "${cfg.dataDir}/secret.yaml";
path = "${config.systemd.services.zigbee2mqtt.gensokyo-zone.sharedMounts.zigbee2mqtt.path}/secret.yaml";
};
services.zigbee2mqtt = {
@ -48,6 +48,14 @@ in {
};
};
};
systemd.services.zigbee2mqtt = mkIf cfg.enable {
gensokyo-zone = {
sharedMounts.zigbee2mqtt.path = cfg.dataDir;
cacheMounts."zigbee2mqtt/log" = {
path = "${cfg.dataDir}/log";
};
};
};
services.udev.extraRules = mkIf cfg.enable ''
SUBSYSTEM=="tty", ATTRS{interface}=="Sonoff Zigbee 3.0 USB Dongle Plus", OWNER="zigbee2mqtt", SYMLINK+="ttyZigbee"

View file

@ -138,6 +138,7 @@ chown 100000:30000 /rpool/shared/nix/store
chmod 1775 /rpool/shared/nix/store
chown 100000:100000 /rpool/shared/nix/var
mkcache zigbee2mqtt 100317 100317 0700
mkcache plex 0 0 0755
if [[ ! -d /rpool/caches/plex/Cache ]]; then
mkdir /rpool/caches/plex/Cache