# Determinate Nix 3.5: introducing lazy trees

**URL:** https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350
**Category:** Links
**Created:** [May 16, 2025, 6:40pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350 "2025-05-16T18:40:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [May 16, 2025, 6:40pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/1 "2025-05-16T18:40:03Z")

</div>

> **[Changelog: introducing lazy trees](https://determinate.systems/posts/changelog-determinate-nix-352/)**
>
> This long-awaited feature makes Nix and flakes dramatically more efficient in a wide range of scenarios

---

<div class="post-metadata">

### Author: ![paperdigits](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/74df32/32.png) [@paperdigits](https://discourse.nixos.org/u/paperdigits)
#### Post date: [May 16, 2025, 6:56pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/2 "2025-05-16T18:56:12Z")

</div>

wow you guys are so fast, 3.0 to 3.5 already?

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [May 16, 2025, 7:04pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/3 "2025-05-16T19:04:59Z")

</div>

Yep! A lot of hard work and substantial changes 😄

---

<div class="post-metadata">

### Author: ![paperdigits](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/p/74df32/32.png) [@paperdigits](https://discourse.nixos.org/u/paperdigits)
#### Post date: [May 16, 2025, 7:16pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/4 "2025-05-16T19:16:42Z")

</div>

I am sure! Is all this hard work for the cooperate version of nix or is there hope of seeing it in the canonical version of nix as well?

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [May 16, 2025, 7:22pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/5 "2025-05-16T19:22:39Z")

</div>

As always, we’d love to see this in upstream Nix! There will be more PRs soon. Right now, we’re getting lots of useful feedback and, as always, the code is right here: [GitHub - DeterminateSystems/nix-src: Nix, the purely functional package manager](https://github.com/determinatesystems/nix-src).

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [May 18, 2025, 1:10pm UTC](https://discourse.nixos.org/t/determinate-nix-3-5-introducing-lazy-trees/64350/7 "2025-05-18T13:10:07Z")

</div>

> <https://github.com/NixOS/nix/pull/13225>
>
> \## Motivation
> 
> This adds a setting \`lazy-trees\` that causes flake inputs to be… "mounted" as virtual filesystems on top of /nix/store as random "virtual" store paths. Only when the store path is actually used as a dependency of a store derivation do we materialize ("devirtualize") the input by copying it to its content-addressed location in the store.
> 
> String contexts determine when devirtualization happens. One wrinkle is that there are cases where we had store paths without proper contexts, in particular when the user does \`toString \<path\>\` (where \`\<path\>\` is a source tree in the Nix store) and passes the result to a derivation. This usage was always broken, since it can result in derivations that lack correct references. But to ensure that we don't change evaluation results, we introduce a new type of context that results in devirtualization but not in store references. We also now print a warning about this.
> 
> Supersedes/incorporates #12432 and #12915. It replaces #6530. The big difference with #6530 is that the latter treated each source tree as its own root filesystem, which caused a lot of backward compatibility issues that required ugly hacks. With the new approach, lazy source trees appear under \`/nix/store\`, just using a virtual store path that doesn't exist in the real filesystem.
> 
> TODO: run the test suite with \`lazy-trees = true\`.
> 
> \## Context
> 
> 
> 
> 
> 
> 
> 
> 
> 
> \---
> 
> Add :+1: to \[pull requests you find important\](https://github.com/NixOS/nix/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc).
> 
> The Nix maintainer team uses a \[GitHub project board\](https://github.com/orgs/NixOS/projects/19) to \[schedule and track reviews\](https://github.com/NixOS/nix/tree/master/maintainers#project-board-protocol).
