Expand description
The fenced two-file transaction behind rk devshell sync.
The tag in flake.nix and the release-kit node in flake.lock
move together or not at all. Before the first write both files are
copied under the state root and a marker names the target and this
process; a build inside the transaction is the fence, so a pin that
does not build against the consumer’s own nixpkgs never reaches the
tree. Any failure restores both files through the Drop guard, which
covers every ?, every early return, and a panic. The crate forbids
unsafe, so no signal handler exists: a terminal interrupt during
the build leaves the marker, and the next run recovers from it.
Structs§
- Finish
Failure - A marker that could be neither neutralized nor removed.
- Restore
Failure - A restore that could not put a file back; the backups stay.
- Step
Failure - One failed step: which, and the child’s last stderr line.
- Txn
- An open transaction: the backups exist and the marker names this
process. Dropping it without
commitrestores both files.
Enums§
- Abort
Failure - Why an abort did not leave the target clean.
- Recovery
- What a recovery attempt found.
Functions§
- build_
devshell nix build --no-linkof the default devshell: the fence.--no-linkkeeps a directory entry from dropping aresultsymlink.- current_
system - The concrete system attribute this host builds for, from nix itself: guessing it from the compile target would be wrong on the systems that matter.
- flake_
update nix flake update release-kit, refreshing the one node.- marker_
is_ pending - Whether a marker names a run still to recover.
- open
- Open a transaction over the target’s two files.
- recover_
pending - Recover a transaction an earlier run left open, where its owner is provably gone.