From 95a3f6ad266c1a340630bbdb4787e202bf9bd883 Mon Sep 17 00:00:00 2001 From: Roland Synnestvedt Date: Sat, 26 Mar 2022 17:59:54 -0700 Subject: nixos/unifi-video: rename openPorts to openFirewall --- nixos/modules/services/video/unifi-video.nix | 24 +++++++++++++----------- 1 file 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 ]; } -- cgit 1.4.1