infra/logins/default.nix
teutat3s 2ca0bd7c3e
All checks were successful
Flake checks / Check (pull_request) Successful in 2m36s
style: run treefmt
2024-05-08 22:57:07 +02:00

26 lines
670 B
Nix

{ lib, ... }:
let
admins = import ./admins.nix;
robots = import ./robots.nix;
in
{
flake = {
logins = {
admins =
lib.lists.foldl
(logins: adminConfig: {
sshPubKeys = logins.sshPubKeys ++ (lib.attrsets.attrValues adminConfig.sshPubKeys);
wireguardDevices =
logins.wireguardDevices
++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ]);
})
{
sshPubKeys = [ ];
wireguardDevices = [ ];
}
(lib.attrsets.attrValues admins);
robots.sshPubKeys = lib.attrsets.attrValues robots;
};
};
}