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.
This commit is contained in:
Julia Lange 2025-03-24 11:16:45 -07:00
parent 42e9842061
commit f373f2f743
Signed by: Julia
SSH key fingerprint: SHA256:50XUMcOFYPUs9/1j7p9SPnwASZ7QnxXm7THF7HkbqzQ

View file

@ -1,14 +1,18 @@
{ config, pkgs, lib, ... }:
{ 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 = [ 922 ];
ports = [ config.sshd.port ];
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";