mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
chore(z2m): shared data
This commit is contained in:
parent
38996b3e0c
commit
9a65b1c8dc
2 changed files with 11 additions and 2 deletions
|
|
@ -9,10 +9,10 @@
|
||||||
inherit (lib.modules) mkIf mkDefault;
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
cfg = config.services.zigbee2mqtt;
|
cfg = config.services.zigbee2mqtt;
|
||||||
in {
|
in {
|
||||||
sops.secrets.z2m-secret = {
|
sops.secrets.z2m-secret = mkIf cfg.enable {
|
||||||
sopsFile = mkDefault ./secrets/zigbee2mqtt.yaml;
|
sopsFile = mkDefault ./secrets/zigbee2mqtt.yaml;
|
||||||
owner = "zigbee2mqtt";
|
owner = "zigbee2mqtt";
|
||||||
path = "${cfg.dataDir}/secret.yaml";
|
path = "${config.systemd.services.zigbee2mqtt.gensokyo-zone.sharedMounts.zigbee2mqtt.path}/secret.yaml";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.zigbee2mqtt = {
|
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 ''
|
services.udev.extraRules = mkIf cfg.enable ''
|
||||||
SUBSYSTEM=="tty", ATTRS{interface}=="Sonoff Zigbee 3.0 USB Dongle Plus", OWNER="zigbee2mqtt", SYMLINK+="ttyZigbee"
|
SUBSYSTEM=="tty", ATTRS{interface}=="Sonoff Zigbee 3.0 USB Dongle Plus", OWNER="zigbee2mqtt", SYMLINK+="ttyZigbee"
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ chown 100000:30000 /rpool/shared/nix/store
|
||||||
chmod 1775 /rpool/shared/nix/store
|
chmod 1775 /rpool/shared/nix/store
|
||||||
chown 100000:100000 /rpool/shared/nix/var
|
chown 100000:100000 /rpool/shared/nix/var
|
||||||
|
|
||||||
|
mkcache zigbee2mqtt 100317 100317 0700
|
||||||
mkcache plex 0 0 0755
|
mkcache plex 0 0 0755
|
||||||
if [[ ! -d /rpool/caches/plex/Cache ]]; then
|
if [[ ! -d /rpool/caches/plex/Cache ]]; then
|
||||||
mkdir /rpool/caches/plex/Cache
|
mkdir /rpool/caches/plex/Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue