crate2nix
builds your cargo-based rust project
crate-by-crate with nix.
You can
- save time by only rebuilding changed crates hermetically in CI, and
- use
cargo
/rust-analyzer
locally for a fast developing loop.
➡️ Read more ⬅️
This fork of crate2nix includes various fixes and features. Many thanks to @hallettj for the first two.
- Fix references to git dependencies with inherited configuration. See nix-community#393.
- Fix incorrect resolution of aliased git dependencies. See nix-community#391.
- More robust handling of finding crates within git workspaces. See nix-community#394.
- Support target_has_atomic configuration within Cargo.toml. See https://github.com/timewave-computer/crate2nix/commit/14298635aa8e6e35bad52fdf4d7aa38ee944769b.
- Add pname and description to crates. See https://github.com/timewave-computer/crate2nix/commit/c46dbc3d15a1ccebb7e75a2bf5901dc32a8852c4.
- See commit history for the rest of the changes.
This fork also includes a crate2nix flake.parts module that handles importing Cargo.nix and exporting all the crates for you. It also has cross compilation support, where crateOverrides for crates within the repository are inspected to see if they set rust
, cargo
, pkgs
or target
and if so Cargo.nix will be re-imported with the new target/toolchain.