Pkgconfig available in dev shell but not when building

I’m trying to build the relm4 demo. If I open a shell with nix develop and build with cargo build --release like a normal rust project it works fine. If I instead try to build or run through nix with nix build or nix run it cannot find pkgconfig and fails to compile.

But pkgconfig is right there, in both buildInputs and nativeBuildInputs and the dev shell version just copies the build version of the variables.


You have nativeBuildInputs and buildInputs swapped – in short, nativeBuildInputs is for build tools and buildInputs is for runtime dependencies. buildRustPackage enables strictDeps = true; by default, so it will enforce the distinction.

Ah, perfect

Thank you