diff options
author | makefu <github@syntax-fehler.de> | 2017-11-15 16:43:36 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-11-15 16:43:36 +0100 |
commit | f70cfd8f1f90872e7e4b413d66f43f0eb1a3cf57 (patch) | |
tree | 4245e3c7fb93d0d33535bc885e0a3684da99d64f /krebs/3modules/per-user.nix | |
parent | 379ef615059bdda14c751bad9352504cac37f96d (diff) | |
parent | 2f183f41ca257fbe9b48b58314849175ceb2dc6b (diff) |
Merge remote-tracking branch 'tv/master'
Diffstat (limited to 'krebs/3modules/per-user.nix')
-rw-r--r-- | krebs/3modules/per-user.nix | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix index 1b8d092bb..a7a07a8e6 100644 --- a/krebs/3modules/per-user.nix +++ b/krebs/3modules/per-user.nix @@ -1,38 +1,34 @@ -{ config, lib, pkgs, ... }: - with import <stockholm/lib>; - -let +{ config, pkgs, ... }: let cfg = config.krebs.per-user; - - out = { - options.krebs.per-user = api; - config = imp; - }; - - api = mkOption { - type = with types; attrsOf (submodule { +in { + options.krebs.per-user = mkOption { + type = types.attrsOf (types.submodule { options = { packages = mkOption { - type = listOf path; + type = types.listOf types.path; default = []; }; }; }); default = {}; }; - - imp = { + config = { environment = { - etc = flip mapAttrs' cfg (name: { packages, ... }: { - name = "per-user/${name}"; - value.source = pkgs.symlinkJoin { - name = "per-user.${name}"; - paths = packages; - }; - }); + 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"]; }; }; - -in out +} |