mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
nixos/unifi: Switch command line args to a list
There's no functionality change here, but this makes it a bit more convenient to add more args.
This commit is contained in:
parent
2bc02c0383
commit
50ff8ff3f9
@ -2,16 +2,17 @@
|
|||||||
let
|
let
|
||||||
cfg = config.services.unifi;
|
cfg = config.services.unifi;
|
||||||
stateDir = "/var/lib/unifi";
|
stateDir = "/var/lib/unifi";
|
||||||
cmd = ''
|
cmd = lib.escapeShellArgs ([ "@${cfg.jrePackage}/bin/java" "java" ]
|
||||||
@${cfg.jrePackage}/bin/java java \
|
++ lib.optionals (lib.versionAtLeast (lib.getVersion cfg.jrePackage) "16") [
|
||||||
${lib.optionalString (lib.versionAtLeast (lib.getVersion cfg.jrePackage) "16")
|
"--add-opens=java.base/java.lang=ALL-UNNAMED"
|
||||||
("--add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.time=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.base/sun.security.util=ALL-UNNAMED"
|
||||||
+ "--add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED")} \
|
"--add-opens=java.base/java.io=ALL-UNNAMED"
|
||||||
${lib.optionalString (cfg.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m"} \
|
"--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
|
||||||
${lib.optionalString (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m"} \
|
]
|
||||||
-jar ${stateDir}/lib/ace.jar
|
++ (lib.optional (cfg.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m")
|
||||||
'';
|
++ (lib.optional (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m")
|
||||||
|
++ [ "-jar" "${stateDir}/lib/ace.jar" ]);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -122,8 +123,8 @@ in
|
|||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart = "${(lib.removeSuffix "\n" cmd)} start";
|
ExecStart = "${cmd} start";
|
||||||
ExecStop = "${(lib.removeSuffix "\n" cmd)} stop";
|
ExecStop = "${cmd} stop";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
TimeoutSec = "5min";
|
TimeoutSec = "5min";
|
||||||
User = "unifi";
|
User = "unifi";
|
||||||
|
Loading…
Reference in New Issue
Block a user