Skip to content

docs: correct stale API claims, add guides and case studies, move the site onto gen's stack - #695

Merged
sini merged 4 commits into
mainfrom
docs/sweep-2026-09
Sep 24, 2026
Merged

sini merged 4 commits into
mainfrom
docs/sweep-2026-09

Conversation

@sini

@sini sini commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

A documentation sweep: stale and incorrect API claims fixed, new pages answering the questions that recur in issues and discussions, a navigation reorganisation, and the docs site moved onto the same Astro/Starlight stack as gen's docs.

Corrections to existing pages

  • Batteries reference. os-class, os-user, wsl, home-manager, hjem and maid were documented as den.batteries.* values; they are classes activated by policies, and are now documented as such. Home environments activate from users.<name>.classes, not from a homeManager key on an aspect.
  • Core principles. The "host resolution pipeline" example described entity kinds and options that don't exist (hm-user, host.hm.enable, den.aspects.${host.aspect}); it now matches core.nix, home-env.nix and wsl.nix.
  • Quirks and pipes.
    • The pipe.for secrets recipe returned an attrset and threw.
    • collect's entity-kind rule was vague: a scope must have its own kind named in the predicate.
    • withProvenance has a caveat with config thunks.
    • Config thunks resolve against the producer's class config, including home-manager, and function-valued quirk entries are called with scope context, so an overlay has to be wrapped (_: [ overlay ]).
  • Diagrams. hostContext / userContext / homeContext and graph.ofHost no longer exist in den-diagram; the pages use captureFleet + projectScope / context.
  • Smaller fixes:
    • the collision-policy level count;
    • host-to-users' per-user child include;
    • resolve.shared.withIncludes;
    • the flake-parts policies' activation conditions;
    • removed APIs in examples;
    • broken examples in the parametric page;
    • the flake-scope battery also serves class modules.

New pages

  • Understand: Where Does My Config Land? (a measured scope table for class content); Choosing a Mechanism.
  • Build:
    • Standalone Home Manager;
    • nixpkgs: Overlays, Channels and Patches;
    • Flake Outputs from Aspects;
    • Cross-Scope Pipes (split out of the quirks guide);
    • Quirk Recipes;
    • Aspect Settings.
  • Examples: case studies for Kubernetes from a NixOS fleet, access control and environments, disks and impermanence, and visualising a fleet with den-diagram; plus Custom Class Examples (split out of the custom classes guide).
  • Start: Future: den on gen.
  • A section on flake inputs and specialArgs in Class Modules.

Every behavioural claim on a new page was checked against den with a throwaway CI test (removed afterwards). Where a page documents a known bug it links the issue (#694).

Site

  • Astro 7 / Starlight 0.42, with astro check and internal link validation in the build.
  • gen's typography and mermaid theming.
  • The sidebar is now a collapsible tree ordered Start, Understand, Build, Examples, Reference, Project.
  • A logo animation drawn from the den logo's geometry.
  • A tighter landing hero.
  • The ecosystem card now covers gen.

Code

  • feat(diag): captureFleet also returns scopeSourcePolicy, which den-diagram uses to label policy-map edges with the policy that created each scope (fix: diagram defects found by the den docs review den-diagram#3). It has a test cell in internal-api/fx-diag-capture.nix.
  • fix(batteries): stale names and paths in the forward and hostname battery descriptions.

Validation

  • nix develop -c just ci: exit 0, 1251/1251.
  • pnpm build in docs/: astro check 0 errors, all internal links valid, 75 pages.
  • Every new or changed mermaid diagram parses with mmdc.

Depends on

@sini
sini requested a review from vic as a code owner September 24, 2026 20:23
@github-actions github-actions Bot added the allow-ci allow all CI integration tests label Sep 24, 2026
@sini
sini requested a review from theutz September 24, 2026 20:27
sini added a commit that referenced this pull request Sep 24, 2026
## Summary

CI on PRs shows false reds when a run is cancelled by another run **for
the same commit**. If the cancel lands before a job's matrix expands,
GitHub records the job under its literal name (`Tests ${{ matrix.os }}`,
`Check template ${{ matrix.template }} ${{ matrix.os }}`) as failed. No
later run reports under those names, so the red check stays on the
commit even after a green re-run. #695 shows two such checks right now.

Two changes, in `test`, `docs` and `bogus`:

1. **Cancel in-progress runs only for new code.** `cancel-in-progress`
is now true only for `synchronize` (a new commit on the PR), or a `push`
in workflows that already cancelled on push. Same-commit events
(`labeled`, approving reviews, `opened` racing a review request) queue
behind the running build instead of killing it. If a third event
arrives, GitHub cancels the older *queued* run, which never started and
so leaves no checks. `main` builds are still never cancelled.
2. **Drop `review_requested` from the triggers.** CODEOWNERS requests a
review when a PR opens, so every PR started two runs at once, one
cancelling the other; any later review request did it again. A review
request doesn't change the code. `ready_for_review` still covers drafts,
and `labeled` stays so `allow-ci` still unlocks CI for outside
contributors.

On #695 the old behaviour produced three `test` runs for one commit:

| Time | Event | Effect |
|---|---|---|
| 20:23:59 | review requested (CODEOWNERS, on open) | run 1 |
| 20:24:01 | `opened` | run 2, cancels run 1 at 0s, leaving the two
literal-named failed checks |
| 20:27:30 | review requested (second reviewer) | run 3, cancels run 2
after 4 minutes of tests |

**Trade-off:** a label or approval arriving mid-run now costs one extra
full run after the current one, instead of a cancellation. Skipping
re-runs when the same commit already has a passing run would remove that
too, but needs more logic in `non-draft`, so it isn't done here.

## Validation

`actionlint` on all three files reports the same findings as `main` (12
pre-existing shellcheck notes in `test.yml`, none in the others).
den-diagram labels each policy-map edge with the policy that created the child scope; the pipeline already records it per scope, but the fleet capture did not return it.
den.defaults -> den.default, den.batteries.os-user -> the os-user.nix user class, and test/source paths that moved.
Astro 7 / Starlight 0.42 with astro check and link validation in the build, gen's typography and mermaid theming, a collapsible sidebar tree ordered Start, Understand, Build, Examples, Reference, Project, a programmatic logo animation drawn from the den logo, a tighter hero, and the ecosystem card covering gen.
…studies

Fixes documented batteries, policies and diagram constructors that do not exist, wrong defaults and broken examples; adds pages answering recurring GitHub questions (where config lands, choosing a mechanism, standalone home-manager, nixpkgs, flake outputs, cross-scope pipes, quirk recipes, aspect settings), case studies (Kubernetes, access control, disks and impermanence, diagrams) and a Future page on gen. Every new behavioural claim was checked against den with a throwaway CI probe.
@sini
sini force-pushed the docs/sweep-2026-09 branch from 0bcf4b3 to 155fb02 Compare September 24, 2026 20:41
@sini
sini merged commit 37eb88c into main Sep 24, 2026
17 checks passed
@sini
sini deleted the docs/sweep-2026-09 branch September 24, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant