jenkins service: Add extraJavaOptions.

This is useful for the common case of passing arguments to
the JVM that runs Jenkins.
This commit is contained in:
Niklas Hambüchen 2017-06-16 07:09:32 +00:00 committed by Franz Pletz
parent b521296a4c
commit aa645b51ba

View File

@ -125,6 +125,15 @@ in {
Additional command line arguments to pass to Jenkins.
'';
};
extraJavaOptions = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "-Xmx80m" ];
description = ''
Additional command line arguments to pass to the Java run time (as opposed to Jenkins).
'';
};
};
};
@ -185,7 +194,7 @@ in {
'';
script = ''
${pkgs.jdk}/bin/java -jar ${pkgs.jenkins}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \
${pkgs.jdk}/bin/java ${concatStringsSep " " cfg.extraJavaOptions} -jar ${pkgs.jenkins}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \
--httpPort=${toString cfg.port} \
--prefix=${cfg.prefix} \
${concatStringsSep " " cfg.extraOptions}