Skip to content

Commit 005eb59

Browse files
committed
flake.nix: use JDK 23 to run devshell Gradle
Since our current config (flake.lock) is using Gradle 8.12.1, we can (and should) use the `java` override property to install jdk23 rather than the `javaToolchains` property. (This will change when we move to Gradle 8.14 and JDK 24, but for now this is the simplest and fastest to install configuration) We are also moving from temurin-bin-23 which was a workaround for a problem that seems to have been fixed. These changes reduce the number of JDKs that need to be installed from 3 down to 1. (Nixpkgs `gradle` currently defaults to jdk21.)
1 parent e5188da commit 005eb59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

flake.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
devShells.default = pkgs.mkShell {
3232
inputsFrom = with pkgs ; [ secp256k1 ];
3333
packages = with pkgs ; [
34-
jdk23 # JDK 23 will be in $JAVA_HOME (and in javaToolchains)
34+
jdk23 # JDK 23 will be in PATH
3535
# current jextract in nixpkgs is broken, see: https://github.com/NixOS/nixpkgs/issues/354591
36-
# jextract # jextract (Nix package) contains a jlinked executable and bundles its own JDK
37-
(gradle.override { # Gradle 8.x (Nix package) depends-on and directly uses JDK XX to launch Gradle itself
38-
javaToolchains = [ temurin-bin-23 ]; # Put JDK 23 in Gradle's javaToolchain configuration
36+
# jextract # jextract (Nix package) contains a jlinked executable and bundles its own JDK
37+
(gradle.override { # Gradle 8.x (Nix package) runs using an internally-linked JDK
38+
java = jdk23; # Run Gradle with this JDK
3939
})
4040
];
4141
};

0 commit comments

Comments
 (0)