30 lines
634 B
Nix
30 lines
634 B
Nix
# /nix/store/<hash>/etc/ssh/ssh_config & /nix/store/<hash>/etc/ssh/authorized_keys
|
|
{
|
|
systemConfig,
|
|
systems,
|
|
otherSystems,
|
|
common,
|
|
...
|
|
}:
|
|
with builtins;
|
|
let
|
|
domain = "dns.${common.domain}";
|
|
allSystems = otherSystems ++ systems;
|
|
in
|
|
{
|
|
programs.ssh.knownHosts = listToAttrs (
|
|
map (system: {
|
|
name = system.hostName;
|
|
value = {
|
|
extraHostNames = [
|
|
"${system.hostName}.${domain}"
|
|
];
|
|
publicKey = system.ssh.publicKey;
|
|
};
|
|
}) allSystems
|
|
);
|
|
users.users.${systemConfig.username}.openssh.authorizedKeys.keys = (
|
|
map (system: system.ssh.publicKey) allSystems
|
|
);
|
|
}
|