From 7837a236e728988fcd501917444828b790c367f9 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 01:48:55 +0000 Subject: populate: lock files rewritten in place change only if they differ A file or git source whose lock file the flakes step rewrites in place gets the original back from delivering it, on every run, from rsync, or from git reset, which also printed HEAD is now at, and Nix printed that it updates the lock file, so the record said the source changed on every run. Populate keeps a copy of the rewritten lock file in .populate/locks/, and the flakes step compares with it, printing what Nix says about the lock file, and changed, only if it differs. Delivering such a source doesn't count bringing back the lock file: rsync returns the paths of what it changed, and the git source's script takes the lock file's path, and resets quietly if that's all that differs. relock also checks that the second, unchanged, run prints nothing about lock files, and says nothing changed, now for rewriting in place too. --- pkgs/populate/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pkgs/populate/README.md') diff --git a/pkgs/populate/README.md b/pkgs/populate/README.md index b53fb07..a947c60 100644 --- a/pkgs/populate/README.md +++ b/pkgs/populate/README.md @@ -264,9 +264,7 @@ wasn't locked throughout doesn't get recorded. Until a run finishes, populate keeps a journal in `.populate/journal` of what it began changing, and what that changed, which the next run that -finishes sums up in its record. A `file` or `git` source whose lock file -populate rewrites in place gets its original lock file back, and rewritten -again, on every run, so it counts as changed every time. +finishes sums up in its record. ## Source Types @@ -623,7 +621,11 @@ much like `NIX_PATH` does for Nix expressions. Populate rewrites the lock file of the flake in each source that draws inputs from other sources, using `nix flake lock --override-input`, so the flake in the source itself uses the other sources. `file` and `git` sources -get their lock file rewritten in place. `flake` and `flake-input` sources +get their lock file rewritten in place. Delivering them brings back the +original lock file on every run, so populate keeps a copy of the rewritten +one in `.populate/locks/`, and only prints what Nix says about the +lock file, and records a change, if it differs from that. `flake` and +`flake-input` sources get delivered as a copy with the rewritten lock file, which gets added to the store, unless materialized, so the target path links to that instead of the delivered store path, as it does for patched ones. A source drawing an input -- cgit v1.3.1