nix icon indicating copy to clipboard operation
nix copied to clipboard

Make `nix flake metadata|update|lock` lazy

Open edolstra opened this issue 11 months ago • 4 comments

Motivation

These don't need to evaluate anything (except for the flake metadata in flake.nix) so we can make these commands operate on lazy trees (i.e. without having to copy the inputs to the store) without risk of any semantic change in the evaluator.

However, as a result, nix flake metadata now no longer prints the store path, which is a breaking change (but unavoidable if we want lazy trees). So calls like nix flake metadata --json | jq .path should be replaced by nix flake prefetch --json | jq .storePath.

Depends on #12421.

TODO: add release note.

Context


Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

edolstra avatar Feb 06 '25 21:02 edolstra

:+1:

no longer prints the store path, which is a breaking change (but unavoidable if we want lazy trees)

This could still be done by hashing without copying, but that behavior is still slower than ideal, so it should be removed (as you did) or be put behind a flag perhaps if it is needed. I feel like it's not "metadata" though.

roberth avatar Feb 07 '25 10:02 roberth

:tada: All dependencies have been resolved !

dpulls[bot] avatar Feb 10 '25 16:02 dpulls[bot]

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/minimize-download-of-dependency-flakes-on-demand/62064/5

nixos-discourse avatar Mar 23 '25 16:03 nixos-discourse

Still seems useful if we want to make progress on lazy paths.

xokdvium avatar Nov 29 '25 00:11 xokdvium