Nix dynamic derivations turn build graphs from fixed plans into runtime decisions
A blog post examines how Nix's dynamic derivations feature fundamentally changes the nature of its build graph, shifting Nix from an 'applicative' system—where every build step is known in advance—to a 'monadic' one, where the graph can be constructed as the build itself progresses. The author revisits earlier writing on the topic after noticing renewed interest, including talks at NixCon 2026 and a new tool called cargo-dyndrv.
Nix's core appeal has long been that builds are fully predictable and inspectable before anything runs, letting tools like nix-diff and dry-run analyze changes without executing code. Moving toward a monadic model where the graph unfolds dynamically could unlock more flexible build patterns, such as replacing rigid language-specific code generation, but it also threatens the static reasoning guarantees that many existing Nix tools depend on.
- Dynamic derivations let Nix build graphs be defined as builds run rather than fully upfront.
- This shifts Nix from an 'applicative' to a 'monadic' build system in functional programming terms.
- The change could impact tools like nix-diff and dry-run that rely on static, predictable build graphs.
Source: news.ycombinator.com, 2026-09-21
Published there as: “A build graph that rolls dice”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.