Skip to content
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

Fix documentation of default option priority #45130

Closed
wants to merge 1 commit into from

Conversation

lopsided98
Copy link
Contributor

Motivation for this change

The documentation for the default option priority seems to be incorrect, stating that options have priority 1000 by default, while lib/modules.nix#L429 indicates that the default priority is 100.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@samueldr
Copy link
Member

samueldr commented Aug 18, 2018

The 1000 value is mkDefault's, which is what will end up being used by option definitions; it is "used in config sections of non-user modules to set a default".

Though, this is a bit misleading as the default value of an option has priority 1500, as set by mkOptionDefault

AFAICT, 100 is the default priority of a user configuration; e.g. a configuration in configuration.nix.

@lopsided98
Copy link
Contributor Author

Ok, now I see what is meant by that sentence. I think the priority of a user configuration should be documented as well, though, as it is non-obvious even when looking through the code, because it is not in the same part of the file as the mkOverride functions. I'll try to come up with something that clarifies the different types of defaults.

@samueldr
Copy link
Member

No worries, I had to look it up first. You're right, it all needs to be documented. Feel free to do more re-phrasing than simply fixing an int.

@lopsided98 lopsided98 closed this Sep 23, 2018
@lopsided98 lopsided98 deleted the patch-1 branch September 23, 2018 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants