Expand description
Typed transformation AST over ParsedNar trees.
StoreTransform is the substrate’s declarative authoring
surface for operating on NAR contents. Operators write
(defstore-transform :name … :match-kind … :pattern …) in
Lisp; the Rust executor applies the transforms in declared
order to any ParsedNar tree.
Three transform kinds:
- FileContents — regex match-and-replace over the bytes of every file in the tree. Used for redaction, secret-stripping, build-id rewriting.
- StorePathReference — replaces every literal
/nix/store/<from>-*occurrence (anywhere in file contents OR symlink targets) with/nix/store/<to>-*. Mirrors cppnix’s referrer-graft semantics. - EntryName — renames the top-level entries of a directory matching a regex.
Structs§
- Store
Transform - Typed transformation declaration. Authored as
(defstore-transform …)in Lisp. - Transform
Outcome - Outcome of applying one transform to one node. Aggregated by the executor.
Enums§
- Transform
Kind - Discriminator for the three transform shapes.
Constants§
Functions§
- apply_
all - Apply a sequence of transforms to a
ParsedNar. Each transform fires in declared order; outcomes are returned in the same order. The tree is mutated in place. - apply_
one - Apply one transform, returning its outcome.
- load_
canonical - Compile every authored transform.