summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/per-user.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-11-14 20:21:16 +0100
committerlassulus <lassulus@lassul.us>2017-11-14 20:21:16 +0100
commit7d95a0fc450399d86a8b92a9ffe472a0839c7661 (patch)
tree2c4d906fba2477556e94a81bd5100809746fdc2c /krebs/3modules/per-user.nix
parent0bfb105194675e16626d3a2550ac970429317de2 (diff)
parent1f50c4e068294bba196695394660527963e7690b (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/3modules/per-user.nix')
-rw-r--r--krebs/3modules/per-user.nix44
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
+}