New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/options: Only recurse into visible sub options #82897
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roberth
approved these changes
Mar 19, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works. Will backport.
10 tasks
infinisil
added a commit
that referenced
this pull request
Dec 18, 2020
Initially #82897 prevented non-visible options from being rendered in the manual, but visible-but-internal options were still being recursed into. This fixes this, aligning the recurse condition here with the one in make-options-doc/default.nix
infinisil
added a commit
to infinisil/nixpkgs
that referenced
this pull request
Mar 4, 2022
lib/options: Don't show internal suboption in the manual Initially NixOS#82897 prevented non-visible options from being rendered in the manual, but visible-but-internal options were still being recursed into. This fixes this, aligning the recurse condition here with the one in make-options-doc/default.nix lib/modules: Implement module-builtin assertions This implements assertions/warnings supported by the module system directly, instead of just being a NixOS option (see nixos/modules/misc/assertions.nix). This has the following benefits: - It allows cleanly redoing the user interface. The new implementation specifically allows disabling assertions or converting them to warnings instead. - Assertions/warnings can now be thrown easily from within submodules, which previously wasn't possible and needed workarounds. nixos/assertions: Use module-builtin assertion implementation lib/modules: Use module-builtin assertions for mkRemovedOptionModule and co. nixos/modules: Allow options to be coerced to a string for convenience nixos/modules: Expose the internal module in the top-level documentation nixos/docs: Update assertion docs for new module-builtin ones lib/tests: Implement generalized checkConfigCodeOutErr for module tests lib/tests: Add tests for module-builtin assertions lib/modules: Rename _module.assertions to _module.checks lib/modules: Remove _module.checks.*.triggerPath as it's not necessary Previously this option was thought to be necessary to avoid infinite recursion, but it actually isn't, since the check evaluation isn't fed back into the module fixed-point. lib/modules: _module.check should always be internal Honestly this option should probably just be removed lib/modules: Introduce _module.checks.*.check Previously the .enable option was used to encode the condition as well, which lead to some oddness: - In order to encode an assertion, one had to invert it - To disable a check, one had to mkForce it By introducing a separate .check option this is solved because: - It can be used to encode assertions - Disabling is done separately with .enable option, whose default can be overridden without a mkForce lib/modules: Prefix mkRemovedOptionModule & co. check names To avoid name clashes Co-authored-by: Robert Hensing <robert@roberthensing.nl> bla
github-actions bot
pushed a commit
to nix-community/nixpkgs.lib
that referenced
this pull request
Dec 4, 2022
Initially NixOS/nixpkgs#82897 prevented non-visible options from being rendered in the manual, but visible-but-internal options were still being recursed into. This fixes this, aligning the recurse condition here with the one in make-options-doc/default.nix
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
10.rebuild-darwin: 0
10.rebuild-linux: 1-10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Fixes #82862, which was introduced with #78135
Confirmed this works with a
config.nix
like this:Then building the manual and opening it:
And then searching for the string
subsubsubsub
. Before this PR it would occur once underoldoldoldold.<name>.subsubsubsub
and once undernewnewnewnew.<name>.subsubsubsub
, but only the latter of which is present after this PR.