feat(lib): Declare instance specific function here instead of nix-lib
This commit is contained in:
parent
df8c11180b
commit
18c1fa1ddd
1 changed files with 18 additions and 4 deletions
|
@ -1,9 +1,23 @@
|
|||
_:
|
||||
|
||||
let
|
||||
inherit ((import sources.nixpkgs { })) lib;
|
||||
|
||||
sources = import ../npins;
|
||||
in
|
||||
|
||||
import sources.nix-lib { inherit lib; keysRoot = ../keys; metaRoot = ../meta; }
|
||||
nix-lib = import sources.nix-lib {
|
||||
inherit ((import sources.nixpkgs { })) lib;
|
||||
|
||||
keysRoot = ../keys;
|
||||
metaRoot = ../meta;
|
||||
};
|
||||
|
||||
in nix-lib // (with nix-lib; {
|
||||
# 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" ]);
|
||||
in getAllKeys names;
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue