summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland Synnestvedt <contact@rsynnest.com>2022-03-26 17:59:54 -0700
committerRoland Synnestvedt <contact@rsynnest.com>2022-03-26 17:59:54 -0700
commit95a3f6ad266c1a340630bbdb4787e202bf9bd883 (patch)
treed3d44341053a09de7c13c264c86ff32dfe5b78f7
parentcb1c5dbb15f1c2f0802007c7ac661d371d00babf (diff)
downloadnixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar.gz
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar.bz2
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar.lz
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar.xz
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.tar.zst
nixpkgs-95a3f6ad266c1a340630bbdb4787e202bf9bd883.zip
nixos/unifi-video: rename openPorts to openFirewall
-rw-r--r--nixos/modules/services/video/unifi-video.nix24
1 files changed, 13 insertions, 11 deletions
diff --git a/nixos/modules/services/video/unifi-video.nix b/nixos/modules/services/video/unifi-video.nix
index 366a7111fde..53acb9d79b9 100644
--- a/nixos/modules/services/video/unifi-video.nix
+++ b/nixos/modules/services/video/unifi-video.nix
@@ -145,13 +145,6 @@ in
         '';
       };
 
-      openPorts = mkOption {
-        type = types.bool;
-        default = true;
-        description = ''
-          Whether or not to open the required ports on the firewall.
-        '';
-      };
 
       maximumJavaHeapSize = mkOption {
         type = types.nullOr types.int;
@@ -168,6 +161,13 @@ in
         defaultText = literalExpression ''"''${config.${opt.dataDir}}/unifi-video.pid"'';
         description = "Location of unifi-video pid file.";
       };
+    openFirewall = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether or not to open the required ports on the firewall.
+      '';
+    };
 
 };
 
@@ -182,7 +182,7 @@ config = mkIf cfg.enable {
     groups.unifi-video = {};
   };
 
-  networking.firewall = mkIf cfg.openPorts {
+    networking.firewall = mkIf cfg.openFirewall {
       # https://help.ui.com/hc/en-us/articles/217875218-UniFi-Video-Ports-Used
       allowedTCPPorts = [
         7080 # HTTP portal
@@ -261,7 +261,9 @@ config = mkIf cfg.enable {
 
   };
 
-  meta = {
-    maintainers = with lib.maintainers; [ rsynnest ];
-  };
+  imports = [
+    (mkRenamedOptionModule [ "services" "unifi-video" "openPorts" ] [ "services" "unifi-video" "openFirewall" ])
+  ];
+
+  meta.maintainers = with lib.maintainers; [ rsynnest ];
 }