Fix invalid ${rust-jni.out} in Nix flake on non-Linux systems (#11264)

`fenix.packages.${system}.minimal` is a `toolchain` not a `derivation`, so Nix `devShell`s are broken on non-linux systems because the `devShell` expects `${rust-jni.out}` to evaluate to a path. Replacing `fenix.packages.${system}.minimal` with `fenix.packages.${system}.minimal.toolchain` fixes this because `.toolchain` is a `derivation` which has an `.out` field.

Also formats the `flake.nix` since it contains a mixture of tabs and spaces. The two commits are separated for ease-of-review.

cc @somebody1234
This commit is contained in:
Nikita Pekin 2024-10-07 18:50:13 +03:00 committed by GitHub
parent 47bf591b5a
commit 6e11e6ab9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,11 +19,12 @@
sha256 = "sha256-IeUO263mdpDxBzWTY7upaZqX+ODkuK1JLTHdR3ItlkY=";
};
isOnLinux = pkgs.lib.hasInfix "linux" system;
rust-jni = if isOnLinux then with fenix.packages.${system}; combine [
rust-jni =
if isOnLinux then with fenix.packages.${system}; combine [
minimal.cargo
minimal.rustc
targets.x86_64-unknown-linux-musl.latest.rust-std
] else fenix.packages.${system}.minimal;
] else fenix.packages.${system}.minimal.toolchain;
in
pkgs.mkShell rec {
buildInputs = with pkgs; [