about summary refs log tree commit diff
path: root/nixos/modules/services/misc/taskserver/default.nix
diff options
context:
space:
mode:
authorpacien <pacien.trangirard@pacien.net>2022-02-11 02:30:44 +0100
committerpacien <pacien.trangirard@pacien.net>2022-03-05 15:15:50 +0100
commit0091e3198a81cfc5cd867f676f3711a63979b938 (patch)
tree2a26eddb99c41cea5a716dd0b65159169577d208 /nixos/modules/services/misc/taskserver/default.nix
parent9013352e3f1941f6ee4430baaa69b0b0927adb15 (diff)
nixos/taskserver: do not open firewall port implicitly
This adds an option `services.taskserver.openFirewall` to allow the user
to choose whether or not the firewall port should be opened for the
service. This is no longer the case by default.

See also https://github.com/NixOS/nixpkgs/issues/19504.
Diffstat (limited to 'nixos/modules/services/misc/taskserver/default.nix')
-rw-r--r--nixos/modules/services/misc/taskserver/default.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/nixos/modules/services/misc/taskserver/default.nix b/nixos/modules/services/misc/taskserver/default.nix
index 33f4d0c103ac3..e20804929981f 100644
--- a/nixos/modules/services/misc/taskserver/default.nix
+++ b/nixos/modules/services/misc/taskserver/default.nix
@@ -277,10 +277,6 @@ in {
         example = "::";
         description = ''
           The address (IPv4, IPv6 or DNS) to listen on.
-
-          If the value is something else than <literal>localhost</literal> the
-          port defined by <option>listenPort</option> is automatically added to
-          <option>networking.firewall.allowedTCPPorts</option>.
         '';
       };
 
@@ -292,6 +288,14 @@ in {
         '';
       };
 
+      openFirewall = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to open the firewall for the specified Taskserver port.
+        '';
+      };
+
       fqdn = mkOption {
         type = types.str;
         default = "localhost";
@@ -560,7 +564,7 @@ in {
         '';
       };
     })
-    (mkIf (cfg.enable && cfg.listenHost != "localhost") {
+    (mkIf (cfg.enable && cfg.openFirewall) {
       networking.firewall.allowedTCPPorts = [ cfg.listenPort ];
     })
   ];