nixos/zigbee2mqtt: set StateDirectory

So that the directory is guaranteed to exist at service startup. This
fixes the scenario where the service is stopped, the state directory
removed and the service started again (for testing / starting fresh).

Set StateDirectoryMode to match the existing directory permissions.
This commit is contained in:
Bjørn Forsman 2025-02-16 15:45:20 +01:00
parent ef773b2824
commit 92ea914782

View file

@ -83,6 +83,8 @@ in
User = "zigbee2mqtt";
Group = "zigbee2mqtt";
WorkingDirectory = cfg.dataDir;
StateDirectory = "zigbee2mqtt";
StateDirectoryMode = "0700";
Restart = "on-failure";
# Hardening