Files
dotfiles/system-modules/sshd.nix
Lennart J. Kurzweg (Nx2) fce5f49e57 Sops-Nix
2024-06-03 16:59:11 +02:00

23 lines
544 B
Nix

{ host, secrets, ... }:
{
environment.etc."ssh/ssh_host_ed25519_key.pub".text = if (host == "NxNORTH") then
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF1r5gUQPPS/dGB0SsvWtP6WdNWoxMwhhHRrqlO19cJt root@NxNORTH"
else if ( host == "NxXPS") then
""
else
"";
sops.secrets."ssh/${host}-ssh_host_ed25519_key" = {
mode = "0600";
path = "/etc/ssh/ssh_host_ed25519_key.shadow";
};
services.openssh = {
enable = true;
ports = secrets.ssh.ports;
settings = {
PasswordAuthentication = false;
};
};
}