diff options
author | tv <tv@krebsco.de> | 2015-11-06 21:37:58 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-11-06 21:37:58 +0100 |
commit | a0c068d6ec5d1cc6b1c58fe9af379b638a346220 (patch) | |
tree | 3b7a1550829a3c9ebee76ae95258f0374c41c9b2 /krebs/3modules | |
parent | b54f00c6954a0b44abb52289332c748f95d796d3 (diff) |
{tv => krebs} per-user
Diffstat (limited to 'krebs/3modules')
-rw-r--r-- | krebs/3modules/default.nix | 1 | ||||
-rw-r--r-- | krebs/3modules/per-user.nix | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 2b5fc478c..438836f52 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -15,6 +15,7 @@ let ./git.nix ./iptables.nix ./nginx.nix + ./per-user.nix ./Reaktor.nix ./retiolum-bootstrap.nix ./realwallpaper.nix 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 |