# Cargo-dyndrv: A new way of building Cargo packages with Nix

DevFeed: [Cargo-dyndrv: A new way of building Cargo packages with Nix](<https://devfeed.tech/articles/cargo-dyndrv-a-new-way-of-building-cargo-packages-with-nix-34133.md>)

Original publisher: [Read original article](<https://discourse.nixos.org/t/cargo-dyndrv-a-new-way-of-building-cargo-packages-with-nix/80112>)

Author: Ericson2314

Published: 2026-09-16T20:13:36Z

Content type: article

Language: en

Sources: [Announcements - NixOS Discourse](<https://devfeed.tech/sources/announcements-nixos-discourse.md>)

Topics: [Nix](<https://devfeed.tech/topics/nix.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [announcements](<https://devfeed.tech/tags/announcements.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [rust](<https://devfeed.tech/tags/rust.md>)

## AI overview

The article introduces cargo-dyndrv, a new way to build Cargo projects with Nix. It uses dynamic derivations for per-crate incrementality and Cargo's unit graph to align operations with Cargo, while trading some flexibility for fidelity and forward compatibility.

## Source excerpt

Obsidian Systems - 16 Sep 26 cargo-dyndrv: A Beginning Building Rust within Nix has always been somewhat of an annoying problem. Nixpkgs includes tools like buildRustCrate to build a single crate and buildRustPackage to build an entire project with all its dependencies, but both have substantial issues:... We have a new way way of building Cargo projects! As the blog post describes, what distinguishes this from all the other ways of building Cargo project in Nix is this combination of methods: Uses dynamic derivations, so no eval time penalty for per-crate incrementality Uses Cargo's unit graph, so we automatically match to how Cargo performs operations Both cargo-dyndrv itself and this blog post about it are all @artemist's work; I am only the one posting it because she has already left for NixCon (see you all there!) and I haven't left yet, so my internet connection is better. Finally, thank you for Saronic for collaborating with us on this project. 6 posts - 5 participants Read full topic