per-user module: create profiles only when needed
Refs https://github.com/NixOS/nixpkgs/pull/25712
This commit is contained in:
parent
9c8680981f
commit
7393d245d6
@ -15,16 +15,19 @@ in {
|
||||
};
|
||||
config = {
|
||||
environment = {
|
||||
etc = flip mapAttrs' cfg (name: { packages, ... }: {
|
||||
name = "per-user/${name}";
|
||||
value.source = pkgs.buildEnv {
|
||||
name = "per-user.${name}";
|
||||
paths = packages;
|
||||
pathsToLink = [
|
||||
"/bin"
|
||||
];
|
||||
};
|
||||
});
|
||||
etc =
|
||||
mapAttrs'
|
||||
(name: per-user: {
|
||||
name = "per-user/${name}";
|
||||
value.source = pkgs.buildEnv {
|
||||
name = "per-user.${name}";
|
||||
paths = per-user.packages;
|
||||
pathsToLink = [
|
||||
"/bin"
|
||||
];
|
||||
};
|
||||
})
|
||||
(filterAttrs (_: per-user: per-user.packages != []) cfg);
|
||||
profiles = ["/etc/per-user/$LOGNAME"];
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user