logins: fix admin login merging
All checks were successful
Flake checks / Check (pull_request) Successful in 6m36s

This commit is contained in:
Benjamin Yule Bädorf 2024-04-03 21:47:27 +02:00
parent c6a9c6a219
commit 8ac2af279d
Signed by: b12f
GPG key ID: 729956E1124F8F26

View file

@ -4,10 +4,10 @@
in {
flake = {
logins = {
admins = lib.lists.foldl (logins: adminConfig: logins // {
sshPubKeys = lib.attrsets.attrValues adminConfig.sshPubKeys;
wireguardDevices = if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [];
}) {} (lib.attrsets.attrValues admins);
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;
};
};