feat: generalize SSH key config
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user