Skip to main content

Module derivation

Module derivation 

Source
Expand description

Typed Derivation — the renderer-side output.

Every renderer (gen-nix-incremental, gen-nix-bulk, gen-bazel, gen-buck) emits these. Cache backends key on Derivation.cache_key. Build systems consume Derivation.build.

Per theory/NIX-AST.md: the Nix renderer never format!()s nix syntax — it emits a typed AST that pretty-prints deterministically. Other build systems get their own typed AST module under their renderer crate.

Structs§

BuildScript
Typed build script — a sequence of BuildSteps + the environment they share.
BuildStep
One phase of the build script.
Derivation
One derivation in the renderer’s output graph. Build system agnostic.
DerivationRef
Reference to another derivation by its cache key. Renderers resolve these into per-build-system specific shapes (Nix store paths, Bazel targets, …).

Enums§

BuildCommand
Declarative build command — NOT raw shell. Renderers translate to the build system’s preferred shape (Nix derivation phases, Bazel genrule, …).
BuildStepKind
Typed enum of standard build phases. Adapters / renderers don’t invent new variants; they pick from this list. Pre/PostX hooks are the only place adapter-specific logic surfaces.