diff options
author | makefu <github@syntax-fehler.de> | 2015-11-06 22:38:44 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-11-06 22:38:44 +0100 |
commit | 9a0e67cf65c5a827df7fca7573f47f3a43474df6 (patch) | |
tree | 72058c48138b25e5a0397d21d27ea4cb2a6cca2e /krebs/3modules/per-user.nix | |
parent | 736e1426d5a7ec76d0987840552d56c6b4f0248e (diff) | |
parent | 4d93a8215f08cbea0bbcb8c668f2bbc9600016da (diff) |
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules/per-user.nix')
-rw-r--r-- | krebs/3modules/per-user.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix new file mode 100644 index 000000000..ee213deda --- /dev/null +++ b/krebs/3modules/per-user.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.krebs.per-user; + + out = { + options.krebs.per-user = api; + config = imp; + }; + + api = mkOption { + type = with types; attrsOf (submodule { + options = { + packages = mkOption { + type = listOf path; + default = []; + }; + }; + }); + default = {}; + }; + + imp = { + environment = { + etc = flip mapAttrs' cfg (name: { packages, ... }: { + name = "per-user/${name}"; + value.source = pkgs.symlinkJoin "per-user.${name}" packages; + }); + profiles = ["/etc/per-user/$LOGNAME"]; + }; + }; + +in out |