summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-11-12 10:47:36 +0100
committertv <tv@krebsco.de>2017-11-12 10:47:36 +0100
commit7393d245d61eac3f0c4f9f79865f8c9e8aea4839 (patch)
tree629e18ea70ee6a79be2de7462974613f5d976472
parent9c8680981fc93c7bce3c4a5198d1d4cb36bd876a (diff)
per-user module: create profiles only when needed
Refs https://github.com/NixOS/nixpkgs/pull/25712
-rw-r--r--krebs/3modules/per-user.nix23
1 files changed, 13 insertions, 10 deletions
diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix
index 9080e3b44..a7a07a8e6 100644
--- a/krebs/3modules/per-user.nix
+++ b/krebs/3modules/per-user.nix
@@ -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"];
};
};