diff options
Diffstat (limited to 'users.nix')
-rw-r--r-- | users.nix | 33 |
1 files changed, 10 insertions, 23 deletions
@@ -1,30 +1,17 @@ | |||
1 | {config, ...}: | 1 | { config, lib, ...}: |
2 | |||
3 | with lib; | ||
2 | 4 | ||
3 | let | 5 | let |
4 | baseUsers = { | 6 | genUsersList = dirPath: concatLists (let contents = builtins.readDir dirPath; in map (name: (dirEntryToList."${contents."${name}"}" or (x: [])) "${dirPath}/${name}") (attrNames contents)); |
5 | "gkleen" = import ./users/gkleen.nix; | 7 | dirEntryToList = { |
6 | }; | 8 | "regular" = path: [(import (builtins.toPath path))]; |
7 | extraUsers = { | ||
8 | ymir = { | ||
9 | "mherold" = import ./users/mherold.nix; | ||
10 | "some" = import ./users/some.nix; | ||
11 | "llovisa" = import ./users/llovisa.nix; | ||
12 | "vkleen" = import ./users/vkleen.nix; | ||
13 | "tkleen" = import ./users/tkleen.nix; | ||
14 | "mkleen" = import ./users/mkleen.nix; | ||
15 | "lkellers" = import ./users/lkellers.nix; | ||
16 | "mwgnr" = import ./users/mwagner.nix; | ||
17 | "ineumann" = import ./users/ineumann.nix; | ||
18 | "sselle" = import ./users/sselle.nix; | ||
19 | "sgoebels" = import ./users/sgoebels.nix; | ||
20 | "mtrinh" = import ./users/mtrinh.nix; | ||
21 | }; | ||
22 | odin = { | ||
23 | "mherold" = import ./users/mherold.nix; | ||
24 | }; | ||
25 | }; | 9 | }; |
10 | |||
11 | users = genUsersList ./users; | ||
26 | host = config.networking.hostName; | 12 | host = config.networking.hostName; |
27 | in { | 13 | in { |
28 | users.mutableUsers = false; | 14 | users.mutableUsers = false; |
29 | users.extraUsers = baseUsers // (if builtins.hasAttr host extraUsers then builtins.getAttr host extraUsers else {}); | 15 | users.extraUsers = listToAttrs |
16 | (map (user: nameValuePair (user.name) (removeAttrs user ["hosts" "allHosts"])) (filter (user: elem host (user.hosts or []) || (user.allHosts or false)) users)); | ||
30 | } | 17 | } |