Skip to content

Comments

make-options-doc: Support Nix-provided declaration links#174460

Merged
roberth merged 2 commits intoNixOS:masterfrom
hercules-ci:module-docs-Nix-driven-location-links
Jun 22, 2022
Merged

make-options-doc: Support Nix-provided declaration links#174460
roberth merged 2 commits intoNixOS:masterfrom
hercules-ci:module-docs-Nix-driven-location-links

Conversation

@roberth
Copy link
Member

@roberth roberth commented May 25, 2022

Description of changes

Previously, the location logic was hardcoded, supporting only
Nixpkgs and NixOps properly, leaving other uses of the module
system without good location support.

Usage is along the lines of

makeOptionsDoc {
  # ...
  transformOptions = opt:
    opt // { declarations = map (decl: { url = ...; name = ...; }) opt.declarations; };
}

Now also fixes the Nixpkgs config options doc file links. For broken links, see https://nixos.org/manual/nixpkgs/stable/#opt-allowAliases.

ping @rycee

Things done
  • Built on platform(s)
    • x86_64-linux
      • NixOS manual renders as before
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label May 25, 2022
@roberth roberth requested review from infinisil and rycee May 25, 2022 10:07
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 25, 2022
@infinisil
Copy link
Member

Can we remove the special cases for NixOS and Nixops? Or at least push them out of the XSL file

@roberth
Copy link
Member Author

roberth commented May 25, 2022

Can we remove the special cases for NixOS and Nixops? Or at least push them out of the XSL file

That is the goal, but we'll need a migration window where both methods are available, at least for NixOps.

@roberth
Copy link
Member Author

roberth commented May 25, 2022

I'm also hesitant to migrate NixOS immediately because its list of options is huge and tiny per-option overhead may be significant.

@roberth roberth added the 6.topic: module system About "NixOS" module system internals label May 26, 2022
roberth added 2 commits June 15, 2022 00:45
Previously, the location logic was hardcoded, supporting only
Nixpkgs and NixOps properly, leaving other uses of the module
system without good location support.
@roberth roberth force-pushed the module-docs-Nix-driven-location-links branch from b358768 to 11b33fc Compare June 14, 2022 22:45
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Jun 14, 2022
@roberth
Copy link
Member Author

roberth commented Jun 22, 2022

I've described the follow-up work in #178572

@github-actions
Copy link
Contributor

Successfully created backport PR #178573 for release-22.05.

roberth added a commit to hercules-ci/nixpkgs that referenced this pull request Jun 27, 2022
Feature was introduced in NixOS#174460,
but wasn't supported in `mergeJSON.py` yet.
roberth added a commit to hercules-ci/nixpkgs that referenced this pull request Jun 27, 2022
Feature was introduced in NixOS#174460,
but wasn't supported in `mergeJSON.py` yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants