diff options
| author | tv <tv@krebsco.de> | 2026-11-20 02:33:17 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 02:33:17 +0000 |
| commit | 7e4597a38a29f66fd8bbc7415973caeaa9442bde (patch) | |
| tree | d730cc0db0bb3fdb5db9e977a996dbccc5fedbfc /CHANGELOG.md | |
| parent | 7837a236e728988fcd501917444828b790c367f9 (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 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a7fe35b..c84c1f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,10 @@ of the target directory can wait for with a shared lock, and writes the record of each run that delivers everything to `.populate/run.json`: whether anything changed since the last record, for each source, and - what got delivered. The sentinel is a directory, which a sentinel file - becomes, and the target needs `flock`. + what got delivered. A `file` source's `record` setting can add the + commit of the Git work tree it's in, whether that's dirty, and a hash + of what got delivered. The sentinel is a directory, which a sentinel + file becomes, and the target needs `flock`. - `lib/with.nix` is krops' lib without nixpkgs' lib, which it takes from its caller, e.g. a flake's `nixpkgs.lib`. `pkgs.krops`, `pkgs.populate` and krops' flake use the nixpkgs lib they get, instead of |
