diff options
Diffstat (limited to 'nixos/modules/services/networking/unifi.nix')
-rw-r--r-- | nixos/modules/services/networking/unifi.nix | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix index 174e919f988..a683c537f05 100644 --- a/nixos/modules/services/networking/unifi.nix +++ b/nixos/modules/services/networking/unifi.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, utils, ... }: +{ config, options, lib, pkgs, utils, ... }: with lib; let cfg = config.services.unifi; @@ -7,7 +7,6 @@ let @${cfg.jrePackage}/bin/java java \ ${optionalString (cfg.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m"} \ ${optionalString (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m"} \ - ${optionalString (lib.versionOlder cfg.unifiPackage.version "6.5.54") "-Dlog4j2.formatMsgNoLookups=true"} \ -jar ${stateDir}/lib/ace.jar ''; in @@ -50,7 +49,7 @@ in ''; }; - services.unifi.openPorts = mkOption { + services.unifi.openFirewall = mkOption { type = types.bool; default = true; description = '' @@ -86,6 +85,10 @@ in config = mkIf cfg.enable { + warnings = optional + (options.services.unifi.openFirewall.highestPrio >= (mkOptionDefault null).priority) + "The current services.unifi.openFirewall = true default is deprecated and will change to false in 22.11. Set it explicitly to silence this warning."; + users.users.unifi = { isSystemUser = true; group = "unifi"; @@ -94,7 +97,7 @@ in }; users.groups.unifi = {}; - networking.firewall = mkIf cfg.openPorts { + networking.firewall = mkIf cfg.openFirewall { # https://help.ubnt.com/hc/en-us/articles/218506997 allowedTCPPorts = [ 8080 # Port for UAP to inform controller. @@ -192,6 +195,7 @@ in }; imports = [ (mkRemovedOptionModule [ "services" "unifi" "dataDir" ] "You should move contents of dataDir to /var/lib/unifi/data" ) + (mkRenamedOptionModule [ "services" "unifi" "openPorts" ] [ "services" "unifi" "openFirewall" ]) ]; meta.maintainers = with lib.maintainers; [ erictapen pennae ]; |