26 lines
841 B
Nix
26 lines
841 B
Nix
{ config, inputs, lib, ... }:
|
|
|
|
let
|
|
users = lib.attrsets.filterAttrs (name: config: config.isNormalUser) config.users.users;
|
|
in {
|
|
programs.fuse.userAllowOther = lib.mkIf (users != [ ]) true;
|
|
|
|
systemd.tmpfiles.rules = lib.mkIf (users != [ ]) (
|
|
[
|
|
"d /persist/home 0755 root root -"
|
|
"d /cache/home 0755 root root -"
|
|
] ++
|
|
lib.attrsets.mapAttrsToList (user: config: "d /persist${config.home} 0700 ${user} users -") users ++
|
|
lib.attrsets.mapAttrsToList (user: config: "d /cache${config.home} 0700 ${user} users -") users
|
|
);
|
|
|
|
home-manager.users = lib.attrsets.mapAttrs (user: config: ({
|
|
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
|
|
|
|
home.persistence = {
|
|
"/persist${config.home}".allowOther = true;
|
|
"/cache${config.home}".allowOther = true;
|
|
};
|
|
})) users;
|
|
}
|