diff --git a/nixos/module.nix b/nixos/module.nix index 714563f..efdd1a2 100644 --- a/nixos/module.nix +++ b/nixos/module.nix @@ -103,11 +103,15 @@ in after = [ "network-online.target" ]; wants = [ "network-online.target" ]; - environment = cfg.environment; + environment = cfg.environment // { + # Nix needs a writable cache for git flake fetching + XDG_CACHE_HOME = "/var/cache/homelab-deploy"; + }; path = [ pkgs.git config.system.build.nixos-rebuild ]; serviceConfig = { + CacheDirectory = "homelab-deploy"; Type = "simple"; ExecStart = "${cfg.package}/bin/homelab-deploy listener ${args}"; Restart = "always";