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
|
let
|
||||||
sources = import ../npins;
|
sources = import ../npins;
|
||||||
|
|
||||||
nix-lib =
|
lib =
|
||||||
(import sources.nix-lib {
|
(import sources.nix-lib {
|
||||||
inherit ((import sources.nixpkgs { })) lib;
|
inherit ((import sources.nixpkgs { })) lib;
|
||||||
|
|
||||||
keysRoot = ../keys;
|
keysRoot = ../keys;
|
||||||
}).extra;
|
}).extra;
|
||||||
|
|
||||||
|
meta = import ../meta;
|
||||||
in
|
in
|
||||||
nix-lib
|
lib
|
||||||
// (with nix-lib; {
|
// rec {
|
||||||
# Get publickeys associated to a node
|
# Get publickeys associated to a node
|
||||||
getNodeKeys =
|
getNodeKeys =
|
||||||
node:
|
node:
|
||||||
let
|
let
|
||||||
meta = import ../meta;
|
|
||||||
names =
|
names =
|
||||||
builtins.foldl' (names: group: names ++ meta.members.groups.${group})
|
builtins.foldl' (names: group: names ++ meta.members.groups.${group})
|
||||||
(meta.nodes.${node}.admins ++ [ "/machines/${node}" ])
|
(meta.nodes.${node}.admins ++ [ "/machines/${node}" ])
|
||||||
(meta.nodes.${node}.adminGroups ++ [ "root" ]);
|
meta.nodes.${node}.adminGroups;
|
||||||
in
|
in
|
||||||
getAllKeys names;
|
rootKeys ++ (lib.getAllKeys names);
|
||||||
})
|
|
||||||
|
rootKeys = lib.getAllKeys meta.members.groups.root;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue