Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins service depends on 2 versions of JDK #308053

Open
SamLukeYes opened this issue Apr 30, 2024 · 2 comments
Open

Jenkins service depends on 2 versions of JDK #308053

SamLukeYes opened this issue Apr 30, 2024 · 2 comments

Comments

@SamLukeYes
Copy link
Member

Describe the bug

jenkins depends on the default jdk package, but the NixOS module is hard-coded to use jdk17

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set services.jenkins.enable = true
  2. Run nix-tree and search openjdk

Expected behavior

Only 1 JDK version should be used. Would be better if it can be configured by user.

Screenshots

图片

Notify maintainers

@coreyoconnor @earldouglas @NeQuissimus

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.28-xanmod1, NixOS, 24.05 (Uakari), 24.05pre-git
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.2
  • nixpkgs: /etc/nix/inputs/nixpkgs

Add a 👍 reaction to issues you find important.

@Shawn8901
Copy link
Contributor

Shawn8901 commented May 1, 2024

The module defines an option that enables you to add additional software to the path with services.jenkins.packages (https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.jenkins.packages)

default = [ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ];

you could set that option to your desired packages so remove the "additional" jdk. if you dont like it.

If its reasonable to set a different jdk than which jenkins is running on is a questionable default tho on my opinion.

@SamLukeYes
Copy link
Member Author

SamLukeYes commented May 1, 2024

The module defines an option that enables you to add additional software to the path with services.jenkins.packages (https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=services.jenkins.packages)

default = [ pkgs.stdenv pkgs.git pkgs.jdk17 config.programs.ssh.package pkgs.nix ];

you could set that option to your desired packages so remove the "additional" jdk. if you dont like it.

If its reasonable to set a different jdk than which jenkins is running on is a questionable default tho on my opinion.

Even with services.jenkins.packages set to an empty list, the start script still runs Jenkins on jdk17 instead of the JDK version used to build jenkins package.

script = ''
${pkgs.jdk17}/bin/java ${concatStringsSep " " cfg.extraJavaOptions} -jar ${cfg.package}/webapps/jenkins.war --httpListenAddress=${cfg.listenAddress} \
--httpPort=${toString cfg.port} \
--prefix=${cfg.prefix} \
-Djava.awt.headless=true \
${concatStringsSep " " cfg.extraOptions}
'';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants