aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/src/shell.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-20 02:33:17 +0000
committertv <tv@krebsco.de>2026-11-20 02:33:17 +0000
commit7e4597a38a29f66fd8bbc7415973caeaa9442bde (patch)
treed730cc0db0bb3fdb5db9e977a996dbccc5fedbfc /pkgs/populate/src/shell.rs
parent7837a236e728988fcd501917444828b790c367f9 (diff)
populate: file sources' record setting, for provenance in the run record
A consumer recording what a build used gets the commit of git sources, and the store paths of flake, flake-input, and derivation sources, but nothing for file sources, which often hold the configuration, taken from work trees on the deploying machine. Recording nothing about them stays the default, since they may hold secrets, whose hash could give them away. file sources' record setting, with flags that default to false, adds to the source's entry in the record: - commit: if path is in a Git work tree, the commit HEAD names, and dirty, whether git status lists anything in path. Git runs on the deploying machine, without hooks, file system monitors, and writing the index, on every run, which is cheap: a new commit can change HEAD without changing any file. - digest: what nix-hash --type sha256 --sri prints for the target path, after the flakes step, which may have rewritten its lock file. That takes reading all of it, so populate only computes it if the source changed since the last record, and else takes it from that record, which the command taking the lock prints, so a run that changes nothing reads nothing more. The record's format stays version 0: the fields are optional additions. The README documents that the record tells what populate delivered, which something changing the target directory meanwhile would make it miss, and how rsync can leave out much of what Git ignores, with :- .gitignore in a .rsync-filter file, and what that misses. record-file checks the commit, dirty, and the digest, also taken from the last record.
Diffstat (limited to 'pkgs/populate/src/shell.rs')
0 files changed, 0 insertions, 0 deletions