diff --git a/lib/default.nix b/lib/default.nix index 0d05a74..6e1ef13 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -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; +}