blob: 5beb859aac56daaa7d356b211b03b824bf0a8f59 (
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
|
with import <stockholm/lib>;
{ config, pkgs, ... }: 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"];
};
};
}
|