2024-06-06 11:56:18 +02:00
|
|
|
{ lib, config, clanLib, ... }:
|
2024-06-06 01:48:15 +02:00
|
|
|
let
|
2024-06-06 11:56:18 +02:00
|
|
|
machines = clanLib.allMachineNames;
|
|
|
|
publicKey = clanLib.readFact "ssh.id_ed25519.pub";
|
2024-06-06 01:48:15 +02:00
|
|
|
tld = config.clan.static-hosts.topLevelDomain;
|
2024-06-06 11:56:18 +02:00
|
|
|
|
|
|
|
knownHosts = lib.genAttrs machines
|
|
|
|
(machine:
|
2024-06-06 01:48:15 +02:00
|
|
|
{
|
|
|
|
hostNames = [
|
2024-06-06 11:56:18 +02:00
|
|
|
"[${machine}]:2222"
|
|
|
|
"[${machine}.${tld}]:2222"
|
|
|
|
"[${machine}.private]:2222"
|
|
|
|
"${machine}"
|
|
|
|
"${machine}.${tld}"
|
|
|
|
"${machine}.private"
|
2024-06-06 01:48:15 +02:00
|
|
|
];
|
2024-06-06 11:56:18 +02:00
|
|
|
publicKey = publicKey machine;
|
2024-06-06 01:48:15 +02:00
|
|
|
}
|
2024-06-06 11:56:18 +02:00
|
|
|
);
|
2024-06-06 01:48:15 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
services.openssh.knownHosts = knownHosts;
|
|
|
|
}
|