docs: treat internal options as invisible

`internal` options are intended to be implicitly not `visible`. This is
already handled correctly by the nixos tooling, but our custom tooling
did not correctly handle the edge case.

This lead to strange cases where an internal option is not included in
the docs, but its sub-options were still visible.
This commit is contained in:
Matt Sturgeon 2024-12-27 20:20:10 +00:00
parent e5974b316d
commit 60e88b870c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -41,9 +41,9 @@ let
isVisible =
opts:
if lib.isOption opts then
opts.visible or true
opts.visible or true && !(opts.internal or false)
else if opts.isOption then
opts.index.options.visible or true
opts.index.options.visible or true && !(opts.index.options.internal or false)
else
let
filterFunc = lib.filterAttrs (_: v: if lib.isAttrs v then isVisible v else true);