99# (you can also replace `cargo apk build` with `cargo apk run` to launch it,
1010# via `adb`, into either the Android Emulator, or a physical Android device)
1111
12- let
13- pkgs = import <nixpkgs> { } ;
14- in with pkgs ; mkShell rec {
12+ { pkgs , rustToolchain , ... } :
13+
14+ with pkgs ; mkShell rec {
1515 # Workaround for https://github.com/NixOS/nixpkgs/issues/60919.
1616 # NOTE(eddyb) needed only in debug mode (warnings about needing optimizations
1717 # turn into errors due to `-Werror`, for at least `spirv-tools-sys`).
@@ -20,15 +20,17 @@ in with pkgs; mkShell rec {
2020 # Allow cargo to download crates (even inside `nix-shell --pure`).
2121 SSL_CERT_FILE = "${ cacert } /etc/ssl/certs/ca-bundle.crt" ;
2222
23- nativeBuildInputs = [ rustup cargo-apk jdk ] ;
23+ nativeBuildInputs = [ rustToolchain cargo-apk jdk ] ;
2424
25- ANDROID_SDK_ROOT = let
26- androidComposition = androidenv . composeAndroidPackages {
27- abiVersions = [ "arm64-v8a" "x86_64" ] ;
28- includeNDK = true ;
29- platformVersions = [ "30" ] ;
30- } ;
31- in "${ androidComposition . androidsdk } /libexec/android-sdk" ;
25+ ANDROID_SDK_ROOT =
26+ let
27+ androidComposition = androidenv . composeAndroidPackages {
28+ abiVersions = [ "arm64-v8a" "x86_64" ] ;
29+ includeNDK = true ;
30+ platformVersions = [ "30" ] ;
31+ } ;
32+ in
33+ "${ androidComposition . androidsdk } /libexec/android-sdk" ;
3234
3335 ANDROID_NDK_ROOT = "${ ANDROID_SDK_ROOT } /ndk-bundle" ;
3436}
0 commit comments