2025-05-19 21:51:12 +02:00
|
|
|
# /nix/store/<hash>/etc/ssh/ssh_config & /nix/store/<hash>/etc/ssh/authorized_keys
|
|
|
|
{
|
2025-10-14 20:03:28 +02:00
|
|
|
lib,
|
2025-05-19 21:51:12 +02:00
|
|
|
systemConfig,
|
|
|
|
systems,
|
2025-05-31 14:34:54 +02:00
|
|
|
knownSystems,
|
2025-05-19 21:51:12 +02:00
|
|
|
common,
|
|
|
|
...
|
|
|
|
}:
|
2025-05-19 21:42:29 +02:00
|
|
|
let
|
2025-10-14 20:03:28 +02:00
|
|
|
allSystems = knownSystems // systems;
|
2025-05-19 21:42:29 +02:00
|
|
|
in
|
|
|
|
{
|
2025-10-14 20:03:28 +02:00
|
|
|
programs.ssh.knownHosts = builtins.mapAttrs (hostName: system: {
|
|
|
|
extraHostNames = [
|
|
|
|
(
|
|
|
|
if (system ? address && system.address ? tailnet) then
|
|
|
|
system.address.tailnet
|
|
|
|
else
|
|
|
|
common.tailnetAddr hostName
|
|
|
|
)
|
|
|
|
];
|
|
|
|
publicKey = system.ssh.publicKey;
|
|
|
|
}) allSystems;
|
2025-05-19 21:42:29 +02:00
|
|
|
users.users.${systemConfig.username}.openssh.authorizedKeys.keys = (
|
2025-10-14 20:03:28 +02:00
|
|
|
lib.mapAttrsToList (_hostName: system: system.ssh.publicKey) allSystems
|
2025-05-19 21:42:29 +02:00
|
|
|
);
|
2025-05-15 21:14:05 +02:00
|
|
|
}
|