diff --git a/modules/environment/impermanence.nix b/modules/environment/impermanence.nix index 6c03b0d3..de0ff570 100644 --- a/modules/environment/impermanence.nix +++ b/modules/environment/impermanence.nix @@ -98,6 +98,7 @@ with lib; { directories = [ "/var/log" "/var/lib/nixos" + "/var/cache" ]; files = [ "/etc/ssh/ssh_host_ecdsa_key" @@ -108,6 +109,9 @@ with lib; { "/etc/ssh/ssh_host_rsa_key.pub" ]; }; + systemd.tmpfiles.rules = [ + "d /persistent/var/cache 1777 root root 7d -" + ]; }) ]; } diff --git a/modules/environment/user-impermanence.nix b/modules/environment/user-impermanence.nix index 519afee9..d28b2f87 100644 --- a/modules/environment/user-impermanence.nix +++ b/modules/environment/user-impermanence.nix @@ -27,10 +27,12 @@ with lib; { "Pictures" "Documents" "Videos" + ".cache" ]; }; }) config.environment.impermanence.users); + systemd.tmpfiles.rules = map (name: "d /persistent/home/${name}/.cache 700 ${name} ${name} 7d -") config.environment.impermanence.users; systemd.services = listToAttrs (flatten (map (name: let cfg = config.users.users.${name}; in [