2025-05-19 21:51:12 +02:00
|
|
|
# /nix/store/<hash>/etc/ssh/ssh_config & /nix/store/<hash>/etc/ssh/authorized_keys
|
|
|
|
{
|
|
|
|
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
|
|
|
with builtins;
|
|
|
|
let
|
2025-05-31 14:34:54 +02:00
|
|
|
allSystems = knownSystems ++ systems;
|
2025-05-19 21:42:29 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
programs.ssh.knownHosts = listToAttrs (
|
|
|
|
map (system: {
|
|
|
|
name = system.hostName;
|
|
|
|
value = {
|
2025-05-20 22:03:58 +02:00
|
|
|
extraHostNames = [
|
2025-06-02 21:02:33 +02:00
|
|
|
(
|
|
|
|
if (system ? address && system.address ? tailnet) then
|
|
|
|
system.address.tailnet
|
|
|
|
else
|
|
|
|
common.tailnetAddr system.hostName
|
|
|
|
)
|
2025-05-20 22:03:58 +02:00
|
|
|
];
|
2025-05-19 21:42:29 +02:00
|
|
|
publicKey = system.ssh.publicKey;
|
|
|
|
};
|
2025-05-31 14:34:54 +02:00
|
|
|
}) allSystems
|
2025-05-19 21:42:29 +02:00
|
|
|
);
|
|
|
|
users.users.${systemConfig.username}.openssh.authorizedKeys.keys = (
|
2025-05-31 14:34:54 +02:00
|
|
|
map (system: system.ssh.publicKey) allSystems
|
2025-05-19 21:42:29 +02:00
|
|
|
);
|
2025-05-15 21:14:05 +02:00
|
|
|
}
|