From f373f2f74399f5d4818adff479980b6f8cc66552 Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Mon, 24 Mar 2025 11:16:45 -0700 Subject: [PATCH] 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. --- nixosModules/services/ssh/service.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixosModules/services/ssh/service.nix b/nixosModules/services/ssh/service.nix index 56f7147..4537b0d 100644 --- a/nixosModules/services/ssh/service.nix +++ b/nixosModules/services/ssh/service.nix @@ -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";