32 lines
683 B
Nix
32 lines
683 B
Nix
{
|
|
username ? throw "username argument is required",
|
|
}:
|
|
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
userConfig = config.users.users.${username};
|
|
in
|
|
{
|
|
programs.fuse.userAllowOther = true;
|
|
|
|
systemd.tmpfiles.rules = ([
|
|
"d /persist/home 0755 root root -"
|
|
"d /cache/home 0755 root root -"
|
|
"d /persist${userConfig.home} 0700 ${username} users -"
|
|
"d /cache${userConfig.home} 0700 ${username} users -"
|
|
]);
|
|
|
|
home-manager.users.${username} = {
|
|
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
|
|
|
|
home.persistence = {
|
|
"/persist${userConfig.home}".allowOther = true;
|
|
"/cache${userConfig.home}".allowOther = true;
|
|
};
|
|
};
|
|
}
|