Files
nixos-configuration/shared/base/modules/security/ssh.nix

16 lines
400 B
Nix
Raw Normal View History

# /nix/store/<hash>/etc/ssh/ssh_config & /nix/store/<hash>/etc/ssh/authorized_keys
{
2025-10-14 20:03:28 +02:00
lib,
systemConfig,
systems,
...
}:
{
2025-10-14 20:03:28 +02:00
programs.ssh.knownHosts = builtins.mapAttrs (hostName: system: {
publicKey = system.ssh.publicKey;
}) systems;
users.users.${systemConfig.username}.openssh.authorizedKeys.keys = (
lib.mapAttrsToList (_hostName: system: system.ssh.publicKey) systems
);
}