{ lib, config, impermanence, ... }: { imports = [ impermanence.nixosModules.impermanence ]; environment.persistence."/persist" = { hideMounts = true; # TODO: Add default permissions directories = [ "/etc/nixos" # Stores auto assigned user/group ids "/var/lib/nixos" "/var/log" # User directories "/home/derped/" ] ++ lib.optional config.services.ollama.enable "/var/lib/private/ollama" ++ lib.optional config.programs.virt-manager.enable "/var/lib/libvirt" ++ lib.optional config.networking.networkmanager.enable "/etc/NetworkManager/system-connections" ++ lib.optionals config.virtualisation.podman.enable [ "/var/lib/containers/storage" "/run/containers/storage" ]; files = [ "/etc/machine-id" "/var/lib/sops-nix/key.txt" ] # remember last user and user sessions ++ lib.optional config.programs.regreet.enable "/var/cache/regreet/cache.toml" ++ lib.optional config.services.printing.enable "/etc/staticcups/printers.conf" ++ lib.optionals config.services.openssh.enable [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key.pub" "/etc/ssh/ssh_host_rsa_key" "/etc/ssh/ssh_host_rsa_key.pub" ]; }; }