2023-07-24 09:10:34 +02:00
|
|
|
_:
|
2023-05-22 15:05:20 +02:00
|
|
|
|
|
|
|
let
|
2023-07-23 22:16:59 +02:00
|
|
|
sources = import ../npins;
|
2023-05-22 15:05:20 +02:00
|
|
|
|
2023-12-04 09:17:05 +01:00
|
|
|
nix-lib = (import sources.nix-lib {
|
2023-10-02 21:48:57 +02:00
|
|
|
inherit ((import sources.nixpkgs { })) lib;
|
|
|
|
|
|
|
|
keysRoot = ../keys;
|
2023-12-04 09:17:05 +01:00
|
|
|
}).extra;
|
2023-10-02 21:48:57 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
})
|