blob: c0368ee85d7321a0d0e1a2b9f3a739149f167f53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
{ config, pkgs, lib, ... }:
with lib; let
cfg = config.krebs.per-user;
in {
options.krebs.per-user = mkOption {
type = types.attrsOf (types.submodule {
options = {
packages = mkOption {
type = types.listOf types.path;
default = [];
};
};
});
default = {};
};
config = mkIf (cfg != {}) {
environment = {
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"];
};
};
}
|