diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2020-11-29 00:25:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-29 00:25:35 +0100 |
commit | 62ef710b54ef2f9ba83228582432f7af018f4090 (patch) | |
tree | 1ddbea89809ea9bce8121d759c3063a9405f9d17 /nixos/modules | |
parent | 11b75530a1fff2ef44c2d6dab55c9fdbfb1263fc (diff) | |
parent | 746efadcce6ce729225c9a6e51f6721bc52ae340 (diff) |
Merge pull request #104268 from mvnetbiz/ha-allowpaths
home-assistant: add allowlist_external_dirs to systemd unit ReadWritePaths
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/misc/home-assistant.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 0477254e7c18..1f2e13f37325 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -245,7 +245,11 @@ in { Group = "hass"; Restart = "on-failure"; ProtectSystem = "strict"; - ReadWritePaths = "${cfg.configDir}"; + ReadWritePaths = let + cfgPath = [ "config" "homeassistant" "allowlist_external_dirs" ]; + value = attrByPath cfgPath [] cfg; + allowPaths = if isList value then value else singleton value; + in [ "${cfg.configDir}" ] ++ allowPaths; KillSignal = "SIGINT"; PrivateTmp = true; RemoveIPC = true; |