git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #104268 from mvnetbiz/ha-allowpaths

home-assistant: add allowlist_external_dirs to systemd unit ReadWritePaths

commit62ef710b54ef2f9ba83228582432f7af018f4090 authorMartin Weinelt <mweinelt@users.noreply.github.com> dateSun 29 Nov 2020, 00:25 (6 years ago) parent11b7553746efad
1 file changed+5−1
nixos/modules/services/misc/home-assistant.nix+5−1
nixos/modules/services/misc/home-assistant.nix+5−1
@@ -245,7 +245,11 @@ in {
245245 Group = "hass";
246246 Restart = "on-failure";
247247 ProtectSystem = "strict";
248− ReadWritePaths = "${cfg.configDir}";
248+ ReadWritePaths = let
249+ cfgPath = [ "config" "homeassistant" "allowlist_external_dirs" ];
250+ value = attrByPath cfgPath [] cfg;
251+ allowPaths = if isList value then value else singleton value;
252+ in [ "${cfg.configDir}" ] ++ allowPaths;
249253 KillSignal = "SIGINT";
250254 PrivateTmp = true;
251255 RemoveIPC = true;