puter/common/ssh.nix

31 lines
635 B
Nix
Raw Normal View History

2024-02-04 20:51:11 +00:00
{lib, ...}: {
2024-02-21 21:08:11 +00:00
environment.persistence."/persist".files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
];
age.identityPaths = ["/persist/etc/ssh/ssh_host_ed25519_key"];
services.openssh = {
enable = true;
openFirewall = true;
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
2024-02-04 20:51:11 +00:00
programs.ssh.startAgent = true;
environment.etc."ssh/ssh_config".text = lib.mkAfter ''
Compression yes
ServerAliveInterval 60
'';
}