nix/modules/knot: make ssh ports configurable #716

closed
opened by boltless.me targeting master from push-qrzyzsxkvpwt
Changed files
+9 -2
nix
modules
+9 -2
nix/modules/knot.nix
···
description = "User that hosts git repos and performs git operations";
};
+
sshPorts = mkOption {
+
type = types.listOf types.port;
+
default = [22];
+
description = "Specifies ports used for ssh";
+
};
+
openFirewall = mkOption {
type = types.bool;
default = true;
-
description = "Open port 22 in the firewall for ssh";
+
description = "Open ssh port in the firewall";
};
stateDir = mkOption {
···
services.openssh = {
enable = true;
+
ports = cfg.sshPorts;
extraConfig = ''
Match User ${cfg.gitUser}
AuthorizedKeysCommand /etc/ssh/keyfetch_wrapper
···
};
};
-
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [22];
+
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall cfg.sshPorts;
};
}