anthropics / cargo-nix-plugin
PublicA Nix plugin that resolves Cargo workspaces natively and allows for crate level builds
This is a tool that helps you build Rust projects using Nix. Normally, building Rust with Nix requires generating large configuration files upfront. This plugin instead reads your project's dependency information directly from your Cargo.lock file and the package registry, resolving everything on the fly. It handles all your dependencies, optional features, platform-specific settings, and even git-based dependencies. The result is a faster, cleaner workflow where your Rust project builds reproducibly in Nix without the extra setup step.
How It Works
You've built something with Rust and Cargo, and now you want to build it reproducibly with Nix.
Instead of generating huge configuration files, this plugin reads your project's dependency information directly.
You add the plugin to your Nix configuration so it can understand your Rust project.
The plugin reads your Cargo.lock and the package registry to figure out every dependency, feature, and platform requirement.
Nix constructs each piece of your project with the right settings, linking everything together properly.
Execute your test suite with all dependencies wired up correctly.
Check your code with clippy, reusing compiled dependencies for speed.
Everything compiled successfully with all features resolved, exactly as your Cargo.toml intended.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.