nix-dotfiles/nixosModules/services/ssh/service.nix

23 lines
424 B
Nix
Raw Normal View History

{ config, lib, ... }:
2025-03-12 22:29:53 -07:00
{
options.sshd = {
enable = lib.mkEnableOption "Enables ssh daemon";
port = lib.mkOption {
default = 922;
type = lib.types.port;
};
2025-03-12 22:29:53 -07:00
};
config = lib.mkIf config.sshd.enable {
2025-03-17 12:31:06 -07:00
services.openssh = {
enable = true;
ports = [ config.sshd.port ];
2025-03-17 12:31:06 -07:00
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
2025-03-12 22:29:53 -07:00
};
}