Closing the Nix Gap: From Environments to Packaged Applications for Rust
2 days ago
- #Rust
- #Nix
- #Packaging
- devenv simplifies Rust development with `languages.rust.enable`, providing tools like `cargo`, `rustc`, and `rust-analyzer` without Nix packaging knowledge.
- For deployment, devenv offers `languages.rust.import` using `crate2nix`, eliminating the need to choose between tools like `crate2nix`, `cargo2nix`, `naersk`, or `crane`.
- A unified workflow is provided for all languages: enable development tools with `languages.<lang>.enable` and package with `languages.<lang>.import`.
- Example configuration shows enabling Rust, Python, and Go, then importing applications for packaging.
- `languages.rust.import` generates Nix expressions from `Cargo.toml` and `Cargo.lock`, streamlining the packaging process.
- Similar interfaces are being developed for other languages, like Python with `uv2nix` in PR #2115.
- Community feedback is encouraged via Discord.