feat: generalize SSH key config

This commit is contained in:
2026-04-26 19:40:29 +02:00
parent 0318dd0cf6
commit 52ea09563f
6 changed files with 34 additions and 48 deletions
+8 -1
View File
@@ -1,6 +1,11 @@
{ config, ... }:
{ config, lib, ... }:
let
account = config.repo.account;
personalPublicKeys =
machines:
map (machine: machine.sshKeys.personal.publicKey) (
lib.filter (machine: machine.sshKeys ? personal) (builtins.attrValues machines)
);
in
{
flake.modules.nixos.ssh-agent-auth = {
@@ -23,5 +28,7 @@ in
AllowUsers = [ account.name ];
};
};
users.users.${account.name}.openssh.authorizedKeys.keys = personalPublicKeys config.repo.machines;
};
}