Expand description
GenerationBackend over Nix and NixOS’s switch-to-configuration.
Generation ids are Planarian’s own, kept in generations.json. They map to
system store paths, because a candidate needs an id before it is in the
system profile (docs/deviations.md).
Staging (§9 step 1) copies the owner’s Nix-visible files (git-tracked files
with their working-tree contents, or the whole directory if it isn’t a git
repository) into stage/. base_source is the NAR hash of that copy with
the live override; staged_source, with the candidate override.
Evaluation and build read the staged copy as a path: flake in pure-eval
mode, never the owner’s live tree.
Live activation runs switch-to-configuration test in a transient unit
named after the OpId (planarian-op-<txn>-<epoch>-<seq>.service), so
jobs_tagged can find the work an op started even if the reply was lost.
Structs§
- Export
- The JSON a generation exports at
/etc/planarian/export.jsonand throughconfig.services.planarian.export(see nix/module.nix). - Export
Input - Nixos
- Registry
Constants§
- ACTIVATION
- NIX 🔒
- PARKING_
GRACE 🔒 - Twice §12f’s 24 h bound on parking in
Built: a remembered override or a build root is never removed while a transaction that made it can still use it. - QUICK 🔒
Functions§
- Timestamp_
now 🔒 - apply_
expr - The Nix function given to
nix eval --apply: the export, plus the current value and highest priority of each option path the overrides touch. - closure_
bytes 🔒 - The total size of the union of the closures of
paths. - closure_
bytes_ of - Sum
narSizeover the pathsnix path-info --jsonlists, in either of its shapes: an object keyed by path, or an array of objects withpath. - copy_
file 🔒 - dry_
activate_ failure - Why a dry activation gives no usable plan, if it does not (R10).
- err 🔒
- nar_
hash 🔒 - NAR hash of a directory.
- nar_
hash_ of - The
narHashofpathinnix path-info --jsonoutput, in either of its shapes. - nix 🔒
- parse_
dry_ activate - Parse
switch-to-configuration dry-activateoutput. - sha 🔒
- sri_
sha256 - A
sha256-<base64>(SRI) hash as the 32 bytes it names; None for any other algorithm or a malformed value. - store_
nar_ 🔒hash - value_
from_ 🔒json - walk 🔒