mirror of
https://github.com/logos-co/logos-module-builder.git
synced 2026-08-30 19:51:07 +00:00
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>