Commit 07828dc0 authored by Lucas Bergman's avatar Lucas Bergman
Browse files

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.
parent 50ff8ff3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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 {