about summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems
diff options
context:
space:
mode:
authorVarun Madiath <madiath@amazon.com>2023-07-13 14:06:44 -0400
committerVarun Madiath <madiath@amazon.com>2023-07-17 10:22:43 -0400
commitd237a7318c3613b55469e80ae2c0d7ded901fca2 (patch)
tree286fc93568b7aaa2c53f7268a961f1aa7e638464 /nixos/modules/services/network-filesystems
parent2de8efefb6ce7f5e4e75bdf57376a96555986841 (diff)
downloadnixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar.gz
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar.bz2
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar.lz
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar.xz
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.tar.zst
nixlib-d237a7318c3613b55469e80ae2c0d7ded901fca2.zip
nixos/samba-wsdd: add openFirewall option
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r--nixos/modules/services/network-filesystems/samba-wsdd.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/nixos/modules/services/network-filesystems/samba-wsdd.nix b/nixos/modules/services/network-filesystems/samba-wsdd.nix
index 24407f05de6a..ad600796217b 100644
--- a/nixos/modules/services/network-filesystems/samba-wsdd.nix
+++ b/nixos/modules/services/network-filesystems/samba-wsdd.nix
@@ -11,13 +11,6 @@ in {
       enable = mkEnableOption (lib.mdDoc ''
         Web Services Dynamic Discovery host daemon. This enables (Samba) hosts, like your local NAS device,
         to be found by Web Service Discovery Clients like Windows.
-
-        ::: {.note}
-        If you use the firewall consider adding the following:
-
-            networking.firewall.allowedTCPPorts = [ 5357 ];
-            networking.firewall.allowedUDPPorts = [ 3702 ];
-        :::
       '');
       interface = mkOption {
         type = types.nullOr types.str;
@@ -31,6 +24,13 @@ in {
         example = 2;
         description = lib.mdDoc "Hop limit for multicast packets (default = 1).";
       };
+      openFirewall = mkOption {
+        description = lib.mdDoc ''
+          Whether to open the required firewall ports in the firewall.
+        '';
+        default = false;
+        type = lib.types.bool;
+      };
       workgroup = mkOption {
         type = types.nullOr types.str;
         default = null;
@@ -120,5 +120,10 @@ in {
         SystemCallFilter = "~@cpu-emulation @debug @mount @obsolete @privileged @resources";
       };
     };
+
+    networking.firewall = mkIf cfg.openFirewall {
+      allowedTCPPorts = [ 5357 ];
+      allowedUDPPorts = [ 3702 ];
+    };
   };
 }