exo
exo copied to clipboard
nix: add Rust builds with crane and fenix
The Rust workspace lacked Nix build support, making it difficult to build packages reproducibly or run checks in CI.
Added a flake-parts module at rust/parts.nix that uses crane for Rust builds and fenix for the nightly toolchain. The source filter isolates rust/ and root Cargo files to prevent Python/docs changes from triggering Rust rebuilds. Exports packages (system_custodian, exo_pyo3_bindings wheel, exo-rust-workspace) and checks (cargo-nextest, cargo-doc) for all three target platforms.
The devShell now uses inputsFrom to inherit build dependencies from the workspace package, removing the need for manual pkg-config/openssl setup.
Test plan:
- Ran
nix flake checksuccessfully - Built
nix build ".#checks.x86_64-linux.cargo-nextest"and tests pass - Built
nix build ".#exo_pyo3_bindings"and wheel is produced