Commit graph hyperhive/nix/docs.nix
Author SHA1 Message Date
atlas
34f0c11936 nix/docs: update stub-eval to services.hyperhive.* namespace
Trailing #615 + #620 rebase fix: `nix/docs.nix`'s stub NixOS eval still
referenced the old `hyperhive.{forge,matrix}.enable` paths that #615
moved under `services.hyperhive.*`. Update to match + also force-disable
the new `services.hyperhive.gateway.enable` so the docs eval doesn't
spawn the gateway container as part of `nix build .#docs`.

`packages.docs{,-host,-agent}` and `checks.docs` all evaluate cleanly
on the post-#615 / post-#620 shape verified via `nix flake check`.
2026-05-30 12:01:01 +02:00
atlas
983a4fa229 nix/docs: demote index sections h2 → h3 (argus #622 nit)
argus on #622 comment 7419 🟡:
> monospace h2 on index — the CSS styles `h2` with `ui-monospace`
> font (intended for option-name headings in the per-option pages).
> on the index page, "host options" / "agent options" / "Regenerate"
> headings also get monospace treatment. cosmetic; reads as
> intentional if not, easy to scope.

Index page now uses h3 for section headers, leaves h2 free for the
auto-generated option-name headings on host.html / agent.html where
the monospace styling is appropriate.

(Other argus nit — stale namespace text in indexHTML's option
listings — will be addressed when this branch rebases post-#615
merge, same as #620.)
2026-05-30 11:27:31 +02:00
atlas
0cc27fbe32 nix/docs: add HTML output for the options reference (mara/internal-requests#8)
mara on mara/internal-requests#8:
> nix/docs.nix currently only emits CommonMark via doc.optionsCommonMark;
> add HTML output alongside.

Renders host + agent option pages as standalone HTML using cmark-gfm
(stock nixpkgs, no pandoc). Each page is wrapped in a minimal
inline-CSS template — no external stylesheets, no second HTTP fetch.

New bundle layout (consumed by nginx at `hyperhive.darkest.space/options/`):

    index.html   — landing page with cross-links + regenerate snippet
    host.html    — services.hive-c0re.* / hyperhive.{domain,forge,matrix}.*
    agent.html   — hyperhive.{model,allowedRecipients,extraMcpServers,…}
    host.md      — same content, CommonMark source-of-truth
    agent.md     — same content, CommonMark source-of-truth

All asset paths inside the rendered HTML are relative (`./host.html`
etc.) per mara's spec — the bundle mounts at any URL prefix without
rebuild. Forge source links from `transformOptions` are preserved
as proper `<a href>` (verified: `forge.darkest.space/.../nix/...`).

`packages.<system>.docs` now emits HTML primarily; `docs-host` and
`docs-agent` outputs flip from .md to .html (the .md content is still
in the `docs` bundle for callers that want the source shape).

The native nixos-render-docs `options html` subcommand doesn't exist
(only `manpage` / `commonmark` / `asciidoc`). The `manual html` path
exists but needs a full manual structure for what we're treating as
two standalone pages — overkill. cmark-gfm over the existing
CommonMark output is the leanest path.

Verified:

    nix flake check --no-build
    nix build .#docs        # bundled site (5 files)
    nix build .#docs-host   # standalone HTML page
    nix build .#docs-agent  # standalone HTML page
2026-05-30 11:27:31 +02:00
atlas
24f61f3386 nix/docs: drop dead walk helper + dedupe checks.docs eval
argus review notes on #618:

- `walk` in `pickSubtrees` was leftover from an earlier traversal
  design; `pick` does everything we need. drop it.
- `checks.docs` was re-importing `nix/docs.nix` independently of
  `packages.docs`; the comment claimed they shared eval but they
  didn't (nix's lazy eval + import caching made the *result*
  identical, not the eval). switch to `inherit (self.packages.\${system}) docs;`
  so the check is literally the package output, no second import.
2026-05-29 23:46:39 +02:00
atlas
6a64770c79 nix: add options docs outputs for host + agent surfaces (#616)
Auto-generate CommonMark references for hyperhive's two NixOS module
surfaces via `pkgs.nixosOptionsDoc`:

- `packages.<system>.docs-host` — operator-facing options exposed by
  `hyperhive.nixosModules.default` (`services.hive-c0re.*`,
  `hyperhive.domain`, `hyperhive.forge.*`, `hyperhive.matrix.*`).
- `packages.<system>.docs-agent` — per-agent options declared in
  `nix/templates/harness-base.nix` (model, allowedRecipients,
  extraMcpServers, frontend, forge, matrix, gui, …).
- `packages.<system>.docs` — both pages plus a thin `README.md`
  index, bundled for publishing.

Declaration links are rewritten to point at the forge source tree
instead of nix-store paths.

Host options come from a stubbed `nixosSystem` eval that force-disables
all hyperhive subsystems — only the *declarations* feed the doc
renderer, no heavy build inputs end up in the closure. Agent options
reuse `nixosConfigurations.agent-base.options` (already evaluated).

Also wired as `checks.<system>.docs` so CI fails fast on eval breakage.
2026-05-29 23:42:24 +02:00