mononix/Mononix/Nix Monorepos.md

24 lines
1.5 KiB
Markdown
Raw Normal View History

- [Experiment in cross-compiling](https://github.com/jraygauthier/jrg-rust-cross-experiment/blob/master/simple-static-rustup-target-windows/shell.nix)
- [Building Nix flakes from Rust workspaces - Tweag](https://www.tweag.io/blog/2022-09-22-rust-nix/)
# Rust
## Tools
I am building this table to evaluate tools from the perspective that I would want to use Nix as a replacement for Make in a monorepo environment. "Monorepo" in this case is a shorthand for "many crates being developed in parallel with the clients that depend upon them."
| | Dependency cache strategy | Cross-compilation | Acceptable for Nixpkgs |
| -------------------- | ----------------------------------- | ----------------- | ---------------------- |
| [[Crane]] | One derivation for all dependencies | | |
| [[buildRustPackage]] | | | |
| [[buildRustCrate]] | | | |
| [[cargo2nix]] | | | no |
| [[crate2nix]] | | | no |
| [[naersk]] | | | |
Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development.
# A strategy
- Each crate needs to be treated as a separate