Primarily so that it can be used in other modules since I default to a non-standard port for obsecurity reasons.
22 lines
424 B
Nix
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";
|
|
};
|
|
};
|
|
};
|
|
}
|