infrastructure/lib/default.nix
2023-12-04 09:17:05 +01:00

22 lines
531 B
Nix

_:
let
sources = import ../npins;
nix-lib = (import sources.nix-lib {
inherit ((import sources.nixpkgs { })) lib;
keysRoot = ../keys;
}).extra;
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;
})