From f71eedba773cf50be2dcb03ed3e965c19ccb5d7a Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Fri, 8 Mar 2024 11:50:37 +0100 Subject: [PATCH] fix(lib): Update due to meta rework --- lib/default.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 6e1ef13..183b9b6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,27 +3,29 @@ _: let sources = import ../npins; - lib = - (import sources.nix-lib { - inherit ((import sources.nixpkgs { })) lib; + lib = import sources.nix-lib { + inherit ((import sources.nixpkgs { })) lib; - keysRoot = ../keys; - }).extra; + keysRoot = ../keys; + }; - meta = import ../meta; + meta = import ../meta lib; + + inherit (lib.extra) getAllKeys; in -lib + +lib.extra // rec { # Get publickeys associated to a node getNodeKeys = node: let names = - builtins.foldl' (names: group: names ++ meta.members.groups.${group}) + builtins.foldl' (names: group: names ++ meta.organization.groups.${group}) (meta.nodes.${node}.admins ++ [ "/machines/${node}" ]) meta.nodes.${node}.adminGroups; in - rootKeys ++ (lib.getAllKeys names); + rootKeys ++ (getAllKeys names); - rootKeys = lib.getAllKeys meta.members.groups.root; + rootKeys = getAllKeys meta.organization.groups.root; }