nixos-configuration/modules/disko/impermanence-home.nix
2025-03-21 02:00:29 +01:00

43 lines
850 B
Nix
Executable file

{
extraDirectories,
extraFiles,
username ? throw "need to know the username",
nixIndexEnabled ? false,
...
}: {
home.persistence."/persist/home/${username}" = {
directories =
[
# "Downloads" # no.
"Documents"
"Music"
"Pictures"
"Videos"
".gnupg"
".ssh"
".local"
".cache/mesa_shader_cache"
".cache/mesa_shader_cache_db"
# TODO: Move this shit into work user
]
++ (
if (extraDirectories == null)
then []
else extraDirectories
);
files =
[
".gitconfig"
# ".zsh_history"
]
++ (
if (extraFiles == null)
then []
else extraFiles
)
# ++ (if nixIndexEnabled then [ ".cache/nix-index" ] else [])
;
allowOther = true;
};
}