unifi7: 7.4.156 -> 7.5.176

This commit is contained in:
Adrian Pistol 2023-09-23 13:40:15 +02:00 committed by Adrian Pistol
parent 32663cfc65
commit 191131077b
2 changed files with 9 additions and 4 deletions

View file

@ -5,6 +5,10 @@ let
stateDir = "/var/lib/unifi"; stateDir = "/var/lib/unifi";
cmd = '' cmd = ''
@${cfg.jrePackage}/bin/java java \ @${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.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m"} \
${optionalString (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m"} \ ${optionalString (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m"} \
-jar ${stateDir}/lib/ace.jar -jar ${stateDir}/lib/ace.jar
@ -24,8 +28,8 @@ in
services.unifi.jrePackage = mkOption { services.unifi.jrePackage = mkOption {
type = types.package; type = types.package;
default = 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.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 '' description = lib.mdDoc ''
The JRE package to use. Check the release notes to ensure it is supported. The JRE package to use. Check the release notes to ensure it is supported.
''; '';

View file

@ -66,7 +66,8 @@ in rec {
}; };
unifi7 = generic { unifi7 = generic {
version = "7.4.156"; version = "7.5.176";
sha256 = "sha256-UJjzSC2qKi2ABwH5p0s/5fXfB3NVfYBb3wBfE/8NlK4="; suffix = "-1136930355";
sha256 = "sha256-prsFq09zYrB74p/MGKjwvZftw78k9wbIva5xFdk+Ztw=";
}; };
} }