Skip to content

Commit c61a9df

Browse files
Leon Schuermannadisbladis
Leon Schuermann
authored andcommittedJan 18, 2018
sshd: provide option to disable firewall altering
1 parent 0b559ed commit c61a9df

File tree

1 file changed

+10
-2
lines changed
  • nixos/modules/services/networking/ssh

1 file changed

+10
-2
lines changed
 

‎nixos/modules/services/networking/ssh/sshd.nix

+10-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let
2121
daemon reads in addition to the the user's authorized_keys file.
2222
You can combine the <literal>keys</literal> and
2323
<literal>keyFiles</literal> options.
24-
Warning: If you are using <literal>NixOps</literal> then don't use this
24+
Warning: If you are using <literal>NixOps</literal> then don't use this
2525
option since it will replace the key required for deployment via ssh.
2626
'';
2727
};
@@ -137,6 +137,14 @@ in
137137
'';
138138
};
139139

140+
openFirewall = mkOption {
141+
type = types.bool;
142+
default = true;
143+
description = ''
144+
Whether to automatically open the specified ports in the firewall.
145+
'';
146+
};
147+
140148
listenAddresses = mkOption {
141149
type = with types; listOf (submodule {
142150
options = {
@@ -302,7 +310,7 @@ in
302310

303311
};
304312

305-
networking.firewall.allowedTCPPorts = cfg.ports;
313+
networking.firewall.allowedTCPPorts = if cfg.openFirewall then cfg.ports else [];
306314

307315
security.pam.services.sshd =
308316
{ startSession = true;

0 commit comments

Comments
 (0)
Please sign in to comment.