nixos/jenkins: Introduce javaPackage option; Bump Java version to 21 (#412480)

This commit is contained in:
Thomas Gerbet 2025-06-07 15:17:23 +02:00 committed by GitHub
commit 7f7282e533
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 12 deletions

View file

@ -11,13 +11,7 @@ in
{
options = {
services.jenkins = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable the jenkins continuous integration server.
'';
};
enable = lib.mkEnableOption "Jenkins, a continuous integration server";
user = lib.mkOption {
default = "jenkins";
@ -89,11 +83,13 @@ in
package = lib.mkPackageOption pkgs "jenkins" { };
javaPackage = lib.mkPackageOption pkgs "jdk21" { };
packages = lib.mkOption {
default = [
pkgs.stdenv
pkgs.git
pkgs.jdk17
pkgs.jdk21
config.programs.ssh.package
pkgs.nix
];
@ -239,7 +235,7 @@ in
# For reference: https://wiki.jenkins.io/display/JENKINS/JenkinsLinuxStartupScript
script = ''
${pkgs.jdk17}/bin/java ${lib.concatStringsSep " " cfg.extraJavaOptions} -jar ${cfg.package}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \
${cfg.javaPackage}/bin/java ${lib.concatStringsSep " " cfg.extraJavaOptions} -jar ${cfg.package}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \
--httpPort=${toString cfg.port} \
--prefix=${cfg.prefix} \
-Djava.awt.headless=true \