nixos/system/core/ssh.nix
2026-06-21 14:59:38 +02:00

43 lines
1,016 B
Nix

{ ... }: {
networking.firewall.allowedTCPPorts = [ 22 ];
sops.secrets."ssh/nixremote/private" = {
sopsFile = ../../secrets/default.yaml;
path = "/root/.ssh/nixremote";
mode = "600";
};
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = true;
};
};
programs.ssh = {
extraConfig = ''
Host lilith-server-builder
HostName firelilith.org
User nixremote
IdentityFile /root/.ssh/nixremote
ConnectTimeout 5
Host lilith-pc-builder
HostName lilith-pc
User nixremote
IdentityFile /root/.ssh/nixremote
ConnectTimeout 5
Host lilith-lab-builder
HostName lilith-lab
User nixremote
IdentityFile /root/.ssh/nixremote
ConnectTimeout 5
Host lilith-pad-builder
HostName lilith-pad
User nixremote
IdentityFile /root/.ssh/nixremote
ConnectTimeout 5
'';
};
}