Hello,
I’m trying to get nix-direnv to load a projects build toolchain when entering the base directory of a Java project, and have a couple of questions/issues. Firstly, my shell.nix currently looks like this:
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
temurin-bin-23 maven
];
}
- This fails with:
error: undefined variable 'temurin-bin-23'
at /home/user/javaprj/shell.nix:8:5:
7| packages = with pkgs; [
8| temurin-bin-23 maven
| ^
9| ];
…the above works if I use “temurin-bin” without “-23” specifier, installing Java 21 instead. Why is this temurin-bin-23 package failing?
- In general, I am surprised that
temurin-jdk-bin
exists without a version specifier. I installs version 21, but would it not make sense to call it “temurin-jdk-bin-21” so that one can target specific major releases?