logins: fix admin login merging

This commit is contained in:
Benjamin Yule Bädorf 2024-04-03 21:47:27 +02:00 committed by b12f
parent 83125ae472
commit a795f0824f
Signed by: pub.solar gitea
GPG key ID: F0332B04B7054873

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;
};
};