forked from DGNum/infrastructure
feat(lib): Separate rootKeys
This commit is contained in:
parent
c5aebedd7b
commit
396cb86c4d
1 changed files with 10 additions and 7 deletions
|
@ -3,24 +3,27 @@ _:
|
|||
let
|
||||
sources = import ../npins;
|
||||
|
||||
nix-lib =
|
||||
lib =
|
||||
(import sources.nix-lib {
|
||||
inherit ((import sources.nixpkgs { })) lib;
|
||||
|
||||
keysRoot = ../keys;
|
||||
}).extra;
|
||||
|
||||
meta = import ../meta;
|
||||
in
|
||||
nix-lib
|
||||
// (with nix-lib; {
|
||||
lib
|
||||
// rec {
|
||||
# Get publickeys associated to a node
|
||||
getNodeKeys =
|
||||
node:
|
||||
let
|
||||
meta = import ../meta;
|
||||
names =
|
||||
builtins.foldl' (names: group: names ++ meta.members.groups.${group})
|
||||
(meta.nodes.${node}.admins ++ [ "/machines/${node}" ])
|
||||
(meta.nodes.${node}.adminGroups ++ [ "root" ]);
|
||||
meta.nodes.${node}.adminGroups;
|
||||
in
|
||||
getAllKeys names;
|
||||
})
|
||||
rootKeys ++ (lib.getAllKeys names);
|
||||
|
||||
rootKeys = lib.getAllKeys meta.members.groups.root;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue