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
|
|
|
otherSystems,
|
2025-05-19 21:51:12 +02:00
|
|
|
common,
|
|
|
|
...
|
|
|
|
}:
|
2025-05-19 21:42:29 +02:00
|
|
|
with builtins;
|
|
|
|
let
|
2025-05-19 21:51:12 +02:00
|
|
|
domain = "dns.${common.domain}";
|
2025-05-31 14:34:54 +02:00
|
|
|
allSystems = otherSystems ++ 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 = [
|
|
|
|
"${system.hostName}.${domain}"
|
|
|
|
];
|
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
|
|
|
}
|