refactor(docs): switch to nixos-render-docs for nix options generation

- Use nixos-render-docs commonmark as the rendering engine
- Add GitHub source links (Declared by) for each option
- Fix installation.md links pointing to /docs/nix-module -> /docs/nix-options
This commit is contained in:
Ruixi-rebirth 2026-05-13 11:06:59 +08:00
parent 0b39255831
commit d7c5b603eb
5 changed files with 380 additions and 193 deletions

View file

@ -34,11 +34,25 @@ jobs:
nix build .#nixos-options-json --out-link result-nixos
nix build .#hm-options-json --out-link result-hm
- name: Render to CommonMark
run: |
echo '{}' > /tmp/manpage-urls.json
nix run nixpkgs#nixos-render-docs -- options commonmark \
--manpage-urls /tmp/manpage-urls.json \
--revision nightly \
result-nixos/share/doc/nixos/options.json \
/tmp/nixos-raw.md
nix run nixpkgs#nixos-render-docs -- options commonmark \
--manpage-urls /tmp/manpage-urls.json \
--revision nightly \
result-hm/share/doc/nixos/options.json \
/tmp/hm-raw.md
- name: Format to Markdown
run: |
python3 ./.github/scripts/generate-nix-options-docs.py \
result-nixos/share/doc/nixos/options.json \
result-hm/share/doc/nixos/options.json \
/tmp/nixos-raw.md \
/tmp/hm-raw.md \
docs/nix-options.md
- name: Auto-commit changes