Files
Dario LipicarandClaude Opus 4.8 f7452d980c feat(builder): nix.rust block for Rust external build dependencies (#127)
Rust cdylib modules (codegen.rust) compile their crate via buildRustPackage in
mkLogosModule's `rustStaticLib`, which received no nativeBuildInputs/buildInputs/
env and offered no metadata knob to add them — so any crate (or transitive *-sys
dep) needing a system build tool/library (pkg-config + openssl for reqwest
native-tls, libsqlite3-sys, libclang for bindgen, protoc) failed in the nix
sandbox. The only workaround was hand-rolling a buildRustPackage in the module's
own flake, discarding the trivial-flake benefit.

Add a `nix.rust` metadata block that feeds the crate compile:
  nix.rust.packages.build   -> nativeBuildInputs (host tools)
  nix.rust.packages.runtime -> buildInputs       (link libs)
  nix.rust.env              -> buildRustPackage env

Names resolve via the existing dotted-path getPkg. Empty by default, so existing
modules are unaffected. Also adds programmatic escape-hatch args
rustExtraNativeBuildInputs / rustExtraBuildInputs / rustEnv to mkLogosModule.

Verified by a new fixture + flake check (checks.<sys>.rust-native-dep): a Rust
module whose build.rs probes zlib via pkg-config builds only with the nix.rust
block, and fails without it.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 19:46:06 -03:00
..
2026-03-31 16:56:23 -04:00
2026-03-31 16:56:23 -04:00
2026-03-31 16:56:23 -04:00
2026-03-31 16:56:23 -04:00