Can't package rust app using `frida`

Hello, I’m clearly stuck and thought would ask here for help. I’m trying to package mirrord rust app that’s using frida-gum-sys as one of it’s dependencies. If I’m not mistaken this crate is trying to access rustc-link-search, which would normally be fine, but Nix cannot put predownloaded binaries into /usr/local/lib and as the issue is coming from dependency of Mirrord I don’t think setting rustc-link-search with RUSTFLAGS works (for me it doesn’t matter what RUSTFLAGS env I use, the search path is always /build/cargo-vendor-dir/frida-gum-sys-0.8.1).
Now, if frida devkits cannot be found, build tries to download them from the internet (illegal in Nix), and then build fails with the following error:

warning: frida-gum-sys@0.8.1: Frida gum devkit not found, downloading from

error: failed to run custom build command for frida-gum-sys v0.8.1 (

Caused by:
process didn’t exit successfully: /build/source/target/release/build/frida-gum-sys-0c7609d54d7b85d4/build-script-build (exit status: 101)
— stdout
cargo:warning=Frida gum devkit not found, downloading from

— stderr
thread ‘main’ panicked at /build/cargo-vendor-dir/frida-build-0.2.1/src/
devkit download request failed: reqwest::Error { kind: Request, url: Url { scheme: “https”, cannot_be_a_base: false, username: “”, password: None, host: Some(Domain(“”)), port: None>
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Any ideas what I can do to make the build succeed? My attempts at packaging it are available at GitHub - nxy7/mirrord-nix, should be easy to reproduce error with nix run . --impure.

Looking at the file, the library will only be searched when auto-download feature is not enabled:

Checking other other crates in the repo, the feature should be disabled by default.

According to Cargo.lock file of the project you are packaging, frida-gum is required by mirrord-layer and looking at its Cargo.toml, it is here that the download is forced:

So you will need to patch that.

Thanks a lot for guidance, hopefully I’ll manage to package it now.