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 = {
|
config = {
|
||||||
environment = {
|
environment = {
|
||||||
etc = flip mapAttrs' cfg (name: { packages, ... }: {
|
etc =
|
||||||
name = "per-user/${name}";
|
mapAttrs'
|
||||||
value.source = pkgs.buildEnv {
|
(name: per-user: {
|
||||||
name = "per-user.${name}";
|
name = "per-user/${name}";
|
||||||
paths = packages;
|
value.source = pkgs.buildEnv {
|
||||||
pathsToLink = [
|
name = "per-user.${name}";
|
||||||
"/bin"
|
paths = per-user.packages;
|
||||||
];
|
pathsToLink = [
|
||||||
};
|
"/bin"
|
||||||
});
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(filterAttrs (_: per-user: per-user.packages != []) cfg);
|
||||||
profiles = ["/etc/per-user/$LOGNAME"];
|
profiles = ["/etc/per-user/$LOGNAME"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user