nixos/unifi: Add extraJvmOptions option

This can be useful for adding extra logging, tweaking garbage collector
parameters, and for using JMX to monitor the JVM.
This commit is contained in:
Lucas Bergman 2023-11-09 19:47:39 +00:00
parent 50ff8ff3f9
commit 07828dc05b

View file

@ -12,6 +12,7 @@ let
]
++ (lib.optional (cfg.initialJavaHeapSize != null) "-Xms${(toString cfg.initialJavaHeapSize)}m")
++ (lib.optional (cfg.maximumJavaHeapSize != null) "-Xmx${(toString cfg.maximumJavaHeapSize)}m")
++ cfg.extraJvmOptions
++ [ "-jar" "${stateDir}/lib/ace.jar" ]);
in
{
@ -85,6 +86,15 @@ in
'';
};
services.unifi.extraJvmOptions = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
example = lib.literalExpression ''["-Xlog:gc"]'';
description = lib.mdDoc ''
Set extra options to pass to the JVM.
'';
};
};
config = lib.mkIf cfg.enable {