Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
c1ca4fa5e5
|
|||
|
d728327a5c
|
|||
|
aee956cf11
|
|||
|
10021ec205
|
|||
| ff5bcf504c | |||
| 5e7b5813f4 | |||
| c9820e2166 | |||
|
5f3b4b0a07
|
|||
|
caa022dfa2
|
|||
|
82c30ea31f
|
|||
|
82bbb02b58
|
+8
-11
@@ -1,10 +1,15 @@
|
|||||||
rec {
|
rec {
|
||||||
|
users = import ./users.nix;
|
||||||
|
|
||||||
|
adminSSHKeys = builtins.concatLists (
|
||||||
|
map (user: getSSHKeys user.name) (
|
||||||
|
builtins.filter (user: user.value.admin or false) (attrsToList users)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
attrsToList = mapAttrsToList nameValuePair;
|
attrsToList = mapAttrsToList nameValuePair;
|
||||||
|
|
||||||
mapAttrsToList = f: attrs: builtins.attrValues (builtins.mapAttrs f attrs);
|
mapAttrsToList = f: attrs: builtins.attrValues (builtins.mapAttrs f attrs);
|
||||||
|
|
||||||
nameValuePair = name: value: { inherit name value; };
|
nameValuePair = name: value: { inherit name value; };
|
||||||
|
|
||||||
toList = x: if builtins.isList x then x else [ x ];
|
toList = x: if builtins.isList x then x else [ x ];
|
||||||
|
|
||||||
getSSHKeys =
|
getSSHKeys =
|
||||||
@@ -13,12 +18,4 @@ rec {
|
|||||||
toList users.${username}.ssh
|
toList users.${username}.ssh
|
||||||
else
|
else
|
||||||
builtins.warn "user ${username} declared without ssh keys" [ ];
|
builtins.warn "user ${username} declared without ssh keys" [ ];
|
||||||
|
|
||||||
users = import ./users.nix;
|
|
||||||
|
|
||||||
adminSSHKeys = builtins.concatLists (
|
|
||||||
map (user: getSSHKeys user.name) (
|
|
||||||
builtins.filter (user: user.value.admin or false) (attrsToList users)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user