Day 75 — CA derivations awareness
Day 75 — CA derivations awareness
Stage VII · ~4h
Goal: Explain input-addressed vs content-addressed derivations, know the experimental status and feature flags, run a tiny optional experiment or produce a documented status memo with primary-source links—without putting production Capstone (or 26.05 lab hosts) on CA.
Content-addressed (CA) derivations remain an experimental path. This day is literacy and a sandbox experiment—not a mandate to migrate your host. Capstone A stays on default store semantics.
Why this day exists
Default Nix paths are input-addressed: the store hash fingerprints the build plan (derivations + inputs), not only the output bytes. Two builds that produce identical bytes can still get different paths if input metadata differs. CA aims at output-hash identity—powerful for early cutoff / better sharing—but the feature surface, UX, and nixpkgs readiness evolve. Experts need an honest mental model before blog hype.
You will hear CA in RFCs, release notes, and conference talks. Literacy prevents cargo-cult experimental-features on prod builders.
Theory 1 — Input-addressed world (today’s default)
inputs + build recipe → hash → /nix/store/<hash>-name
Consequences you already rely on:
| Property | Implication |
|---|---|
| Rebuild with same inputs | Same path (reproducible address) |
| Different compiler flags | Different path even if binary identical |
| FODs | Special: output hash fixed; may network |
| Substitutes | Trust signatures of builders/caches |
Trust is “did we run this recipe (or accept a signed substitute for it)?”
FODs vs CA (do not conflate)
| Fixed-output derivation | CA derivations (experimental) | |
|---|---|---|
| Classic use | fetches, vendoring | general builds |
| Hash of | declared output | content-addressed store model |
| Maturity | Everyday | Experimental |
FODs already teach “hash the result” for a class of builds. CA generalizes the idea; it is not “FODs for everything tomorrow.”
Theory 2 — Content-addressed idea
build → output bytes → hash → /nix/store/<hash>-name
Aspirations:
| Goal | Intuition |
|---|---|
| Early cutoff | If output already exists with same content hash, skip dependent rebuilds more aggressively |
| Better dedup | Same bytes converge to same path across “recipes” that don’t matter |
| FODs generalized | More builds behave like “hash the result” |
Challenges:
- Self-references in outputs (files embedding their own store path) need rewriting schemes
- Granularity (per-output CA, etc.)
- Cache/protocol/nixpkgs compatibility
- Debugging mental model shift
- Tooling and UX still moving
Theory 3 — Experimental feature surface
Exact names and defaults change across Nix versions. Always check:
nix --version
nix config show | grep -i experimental
man nix.conf | less # search ca-derivations / content-addressHistorically you will see flags in the family of:
ca-derivations
- related:
dynamic-derivations,cgroups, etc. (orthogonal but often discussed together)
Enable only on a lab profile:
# ephemeral lab — not Capstone default
nix.settings.experimental-features = [
"nix-command"
"flakes"
"ca-derivations" # if supported by your Nix
];Or local:
# illustrative — confirm flag name for your version
nix build --experimental-features 'nix-command flakes ca-derivations' ...Reading status (primary sources)
Prefer in this order:
- Nix release notes for your exact version
- Official Nix manual sections on store / experimental features
- nixpkgs issues/PRs tagged CA (for package readiness)
- RFCs / discourse RFCs (design intent)
Blogs are optional commentary after primary sources. Version-skew blogs are how people enable the wrong flag.
Theory 4 — What CA does not magically fix
| Claim | Reality |
|---|---|
| “CA = perfect reproducibility” | Reproducibility is about determinism of builds; CA is about addressing |
| “CA replaces sandbox” | Isolation still required |
| “Turn on CA, everything faster tomorrow” | Needs package + toolchain readiness; may slow or break |
| “Signatures no longer matter” | You still decide trust for substitutes |
| “Capstone should adopt CA” | No for this volume’s Capstone A |
Theory 5 — Relationship to Capstone and 26.05
Capstone A (Days 83–88) should stay on stable, default derivation mode unless you explicitly document a lab-only branch. DR wipe/rebuild proofs should not depend on experimental store semantics.
Your nixos-26.05 pin is about module and package stability. CA is a Nix daemon / store feature layer—orthogonal but coupled in operational risk if enabled fleet-wide.
Optional: track CA as a 26.11 roadmap item (Day 90)—revisit when your Nix pin upgrades and primary sources look greener.
Theory 6 — Trust and substitutes under CA thinking
Even with CA aspirations, operations still answer:
| Question | Still true? |
|---|---|
| Who is allowed to write to my store? | Yes |
| Which substituters do I trust? | Yes |
| Do I verify signatures? | Yes (policy) |
| Can a malicious builder hurt me? | Yes |
CA is not a substitute for Day 53 cache trust discipline or Day 54 builder trust.
Worked example — Conceptual comparison card
| Dimension | Input-addressed | Content-addressed (experimental) |
|---|---|---|
| Path hash from | Recipe/inputs | Output content (design) |
| Same bytes, different flags | Different paths | May converge |
| Ecosystem maturity | Default everywhere | Experimental / partial |
| Debugging familiarity | High (this book) | Lower; fewer blog runbooks |
| Prod recommendation (this volume) | Yes | Not yet for Capstone |
Lab 0 — Workspace
mkdir -p ~/lab/90daysofx/02-nixos/day75
cd ~/lab/90daysofx/02-nixos/day75Lab 1 — Version & feature inventory (required)
nix --version | tee nix-version.txt
nix config show > nix-config.txt
grep -iE 'experimental|ca-|content' nix-config.txt || trueOpen official docs for your version; save URLs in SOURCES.md (at least 2 primary links).
Write a 10–15 line status summary: what CA means, whether your Nix binary advertises the feature, and any warnings in the manual.
Lab 2 — Choose a track
Track A — Optional tiny experiment (if feature available)
- Enable
ca-derivations(or current equivalent) only in a disposable VM or usernix.confoverlay you can revert.
- Build a trivial derivation twice with intentional non-semantic input noise if docs show how CA modes are requested for derivations (API differs by version—follow current manual).
- Compare store paths and
nix path-infooutput.
- Capture logs in
experiment/.
- Disable experimental CA for daily lab work if it complicates Capstone.
If the manual’s API is unclear or broken on your pin, stop and switch to Track B—do not thrash for hours.
Track B — Status memo without enabling (always acceptable)
Write CA-MEMO.md (≥1 page) covering:
- Input- vs content-addressed definitions
- Problems CA wants to solve
- Current experimental flags for your Nix version
- Known limitations (self-refs, ecosystem)
- Decision: not enabling on Capstone host, with revisit date (e.g. after 26.11 notes)
- Primary source links
- Difference from FODs in your own words
Lab 3 — Teach-back diagram
In NOTES.md, draw (ASCII is fine):
[user config] → eval → derivations → (IA path | CA path?) → substitute/build → store
Annotate where trust/signatures apply.
Lab 4 — Nixpkgs awareness scan
Search your local nixpkgs (or GitHub) for mentions:
# if you have nixpkgs checkout
rg -n "contentAddressed|__contentAddressed|ca-derivations" -g '*.nix' | headNote whether anything in your critical path packages advertises CA—likely little for a lab host. Record findings.
Lab 5 — Explicit non-adoption
Add to Capstone docs (or day75 notes):
## Store semantics
- Mode: input-addressed (default)
- CA: deferred until <date/criteria>
- Owner: <you>This prevents a well-meaning future PR from flipping experimental flags mid-freeze.
Lab 6 — Analogy card (teach others)
Write three sentences max for a teammate:
- Input-addressed: “The address is the recipe’s fingerprint.”
- Content-addressed: “The address wants to be the loaf’s fingerprint.”
- Why Capstone waits: “Experimental + ecosystem partial; DR should not depend on it.”
If you cannot explain without jargon, revise CA-MEMO.md until you can.
Interaction with other Stage VII days
| Day | Link to CA literacy |
|---|---|
| 71 evaluator | Eval still produces plans; addressing is store-side |
| 73 store/daemon | Feature flags live with daemon policy |
| 74 performance | Early cutoff is the performance story—measure before enabling |
| 79 release notes | Watch Nix + nixpkgs notes for CA maturity signals |
Do not enable CA “for speed” without a benchmark and a rollback plan for the builder.
Common gotchas
| Symptom / mistake | What to do |
|---|---|
| Blog for Nix 2.X vs your 2.Y | Trust nix --version + matching manual |
| Enabled CA on shared prod builder | Revert; isolate experiments |
| Assuming path equality ⇒ bit equality always | Still verify; trust model differs |
| Spending the whole day debugging experimental UX | Fall back to Track B memo |
| Mixing CA talk with FOD confusion | FODs already hash outputs for fetch class |
| Capstone depends on CA | Redesign; default store only |
Checkpoint
nix-version.txt+ feature inventory
SOURCES.mdwith primary links
- Track A experiment notes or Track B
CA-MEMO.md
- Explicit Capstone decision: stay input-addressed
- Three personal gotchas
Commit
git add .
git commit -m "day75: CA derivations experimental awareness"Write three personal gotchas before continuing.
Tomorrow
Day 76 — nixosTest mastery: harden flaky VM tests, replace sleep-only waits, multi-node interaction patterns.