nix-dotfiles/nixosModules/services/ssh/service.nix
Julia Lange f373f2f743
Sshd, added port as option
Primarily so that it can be used in other modules since I default to a
non-standard port for obsecurity reasons.
2025-03-24 11:16:45 -07:00

22 lines
424 B
Nix

{ config, lib, ... }:
{
options.sshd = {
enable = lib.mkEnableOption "Enables ssh daemon";
port = lib.mkOption {
default = 922;
type = lib.types.port;
};
};
config = lib.mkIf config.sshd.enable {
services.openssh = {
enable = true;
ports = [ config.sshd.port ];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
}