nixos-config/system/security/sshd.nix

15 lines
322 B
Nix

{ userSettings, authorizedKeys ? [], ... }:
{
# Enable incoming ssh
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
users.users.${userSettings.username}.openssh.authorizedKeys.keys = authorizedKeys;
}