Skip to main content

Module nixos

Module nixos 

Source
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.json and through config.services.planarian.export (see nix/module.nix).
ExportInput
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 narSize over the paths nix path-info --json lists, in either of its shapes: an object keyed by path, or an array of objects with path.
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 narHash of path in nix path-info --json output, in either of its shapes.
nix 🔒
parse_dry_activate
Parse switch-to-configuration dry-activate output.
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 🔒