24 lines
562 B
Nix
24 lines
562 B
Nix
{ lib, config, clanLib, ... }:
|
|
let
|
|
machines = clanLib.allMachineNames;
|
|
publicKey = clanLib.readFact "ssh.id_ed25519.pub";
|
|
tld = config.clan.static-hosts.topLevelDomain;
|
|
|
|
knownHosts = lib.genAttrs machines
|
|
(machine:
|
|
{
|
|
hostNames = [
|
|
"[${machine}]:2222"
|
|
"[${machine}.${tld}]:2222"
|
|
"[${machine}.private]:2222"
|
|
"${machine}"
|
|
"${machine}.${tld}"
|
|
"${machine}.private"
|
|
];
|
|
publicKey = publicKey machine;
|
|
}
|
|
);
|
|
in
|
|
{
|
|
services.openssh.knownHosts = knownHosts;
|
|
}
|