summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-25 23:43:16 +0200
committerGitHub <noreply@github.com>2023-09-25 23:43:16 +0200
commitc71554840bc54065d516e6da58f3e514bde45793 (patch)
treebd582b12fc84ccddfdd98ae74a9e62875cddfc50 /nixos/modules
parent9e821b5ae0b36d64d32be6385a36e75d3e701a27 (diff)
parent191131077b330289deb5057800a824646a741909 (diff)
downloadnixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar.gz
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar.bz2
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar.lz
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar.xz
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.tar.zst
nixpkgs-c71554840bc54065d516e6da58f3e514bde45793.zip
Merge pull request #257104 from vifino/unifi-7.5.176
unifi7: 7.4.156 -> 7.5.176
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/networking/unifi.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/unifi.nix b/nixos/modules/services/networking/unifi.nix
index 3579d67aa54..37a739f41d4 100644
--- a/nixos/modules/services/networking/unifi.nix
+++ b/nixos/modules/services/networking/unifi.nix
@@ -5,6 +5,10 @@ let
   stateDir = "/var/lib/unifi";
   cmd = ''
     @${cfg.jrePackage}/bin/java java \
+        ${optionalString (lib.versionAtLeast (lib.getVersion cfg.jrePackage) "16")
+        "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED "
+        + "--add-opens java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED "
+        + "--add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED"} \
         ${optionalString (cfg.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m"} \
         ${optionalString (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m"} \
         -jar ${stateDir}/lib/ace.jar
@@ -24,8 +28,8 @@ in
 
     services.unifi.jrePackage = mkOption {
       type = types.package;
-      default = if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.3") then pkgs.jdk11 else pkgs.jre8;
-      defaultText = literalExpression ''if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.3" then pkgs.jdk11 else pkgs.jre8'';
+      default = if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.5") then pkgs.jdk17_headless else if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.3") then pkgs.jdk11 else pkgs.jre8;
+      defaultText = literalExpression ''if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.5") then pkgs.jdk17_headless else if (lib.versionAtLeast (lib.getVersion cfg.unifiPackage) "7.3" then pkgs.jdk11 else pkgs.jre8'';
       description = lib.mdDoc ''
         The JRE package to use. Check the release notes to ensure it is supported.
       '';