- Lazy trees introduction: Lazy trees have been a highly requested Nix feature for a while. They improve Nix's efficiency in large repositories and are now available in Determinate Nix version 3.5.2 based on upstream Nix 2.28.3. Currently, they are on an opt-in basis.
- Why lazy trees are important: They provide faster and less resource-intensive evaluation in standard usage scenarios. In Nixpkgs repo evaluations, there are significant reductions in wall time (3x or more) and disk usage (20x or more). With lazy trees enabled, Nix scopes file copying based on specific expressions and uses a virtual filesystem.
- CI comparisons: In a CI environment, lazy trees show substantial differences. For example, evaluating the
stdenv
attribute of Nixpkgs on GitHub Actions'ubuntu-latest
runner with lazy trees leads to a reduction in evaluation time from almost 11 seconds to 3.5 seconds and a reduction in disk usage from 433 megabytes to 11 megabytes. - New warning: When using Determinate Nix with lazy trees, you may see warnings when specifying the root of a repo as the source for a derivation. It is more efficient to use
builtins.path
orself
instead of./.
. - How to use lazy trees in GitHub Actions: Use the Determinate Nix Action and supply
lazy-trees = true
in the configuration. - How to upgrade or install Determinate Nix: If already installed, upgrade with
sudo determinate-nixd upgrade
. For installation on different platforms, use specific commands like the graphical installer on macOS or curl on Linux. On NixOS, use the dedicated NixOS module. - More to come: Determinate Nix has introduced several improvements, and lazy trees is the most significant so far. In the coming months, more improvements to Nix's evaluation performance are planned, including improving evaluation caching, bringing parallel evaluation to more operations, and providing multi-threaded unpacking of flakes.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。