nixos/user: Use impermanence's users options

This commit is contained in:
Jack O'Sullivan 2023-12-09 15:22:15 +00:00
parent 88b6e00f93
commit ca3547b27a

View File

@ -58,33 +58,17 @@ in
"/home/${user'.name}/.config/fish/fish_variables" "/home/${user'.name}/.config/fish/fish_variables"
]; ];
persistence.config = persistence.config.users."${user'.name}" = {
let files = [
perms = { ".bash_history"
mode = "0700"; ".lesshst"
user = user.name;
group = user.group;
};
in
{
files = (map (file: {
inherit file;
parentDirectory = perms;
}) [
"/home/${user'.name}/.bash_history"
"/home/${user'.name}/.lesshst"
]) ++ [
# Just to make sure we get correct default perms
"/home/.tmproot.dummy"
]; ];
directories = map (directory: { directories = [
inherit directory;
} // perms) [
# Persist all of fish; it's not easy to persist just the history fish won't let you move it to a different # Persist all of fish; it's not easy to persist just the history fish won't let you move it to a different
# directory. Also it does some funny stuff and can't really be a symlink it seems. # directory. Also it does some funny stuff and can't really be a symlink it seems.
"/home/${user'.name}/.local/share/fish" ".local/share/fish"
"/home/${user'.name}/.cache/nix" ".cache/nix"
]; ];
}; };
}; };