Age | Commit message (Collapse) | Author | Files | Lines |
|
mkAliasOptionModule should not default to mdDoc descriptions because
that can break out-of-tree users of documentation infrastructure. add an
explicitly-MD variant for now, to be removed some time after the MD
transition is complete.
|
|
|
|
nixos/doc: document `mkOrder` and friends
|
|
Add a section on ordering option definitions.
Also mention `mkDefault` in the section on `mkOverride`.
Clarify the code a bit by renaming `defaultPriority` to
`defaultOverridePriority` and introducing `defaultOrderPriority`.
|
|
Add trace items that provide context for a failed definition that
can not be caught within the Nix language.
This also adds a test for the `tryEval` behavior of `showDefs`.
|
|
This fixes mkAliasOptionModule in systems with no warning option.
|
|
treewide: clean up
|
|
nixosTest: make modular
|
|
|
|
|
|
This attr provides the location of each definition.
This is particularly useful for introspecting options of type
`attrsOf`. E.g., it allows finding the location of a systemd
service definition by parsing
`options.systemd.services.definitionsWithLocations`.
|
|
|
|
|
|
This is particularly useful for disabling modules defined in a flake.
Example:
disabledModules = [ "${flake}/modules/mymodule.nix" ];
Previously, absolute string paths were internally prepended with `modulesPath`,
which caused the module filtering to fail.
|
|
|
|
`m` must always be an attrset at this point. It is basically always
evaluated. This will make it throw when any of the attrs is accessed,
rather than just `config`. We assume that this will improve the error
message in more scenarios.
|
|
|
|
|
|
and extend-
|
|
hercules-ci/lib-modules-allow-disable-_modules.args-docs-internal
lib.modules: Allow making _module.args internal
|
|
|
|
This allows other module system consumers to
disable these docs via option merging.
For instance arion uses asciidoc instead of
docbook so that would look awful.
|
|
lib/modules: Document `_module.args`
|
|
Documents the _module.args option, motivated by many usages in Flakes,
especially with the deprecation of extraArgs
(https://github.com/NixOS/nixpkgs/commit/78ada833615d241ed76463aa5a024b614150eb4d)
The documentation rendering for this option had to be handled a bit
specially, since it's not declared in nixos/modules like all the other
NixOS options.
Co-Authored-By: pennae <github@quasiparticle.net>
Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
|
|
lib/modules: Finally remove deprecated types.optionSet
|
|
|
|
|
|
Stop premature warnings, including `nix.settings` migration
|
|
Let's keep things simple and not poke holes in the
improved migration process.
|
|
types.optionSet has been deprecated for almost 10 years now
(0e333688cea468a28516bf6935648c03ed62a7bb)! A removal
was already attempted in 2019
(27982b408e465554b8831f492362bc87ed0ec02a), but it was promptly
reinstantiated since some third-party uses were discovered
(f531ce75e4178c6867cc1d0f7fec96b2d5c3f1cb).
It's finally time to remove it for good :)
|
|
hercules-ci/issue-146882-transparent-submodule-options
lib.modules: Let module declare options directly in bare submodule
|
|
Adds support for sinceRelease
|
|
|
|
|
|
It's still in the hot path.
|
|
This reverts commit 6b077c47ff14cb9a4a8f5cb8986fa83ff626c732.
Thanks Infinisil for discovering this problem:
> After a lot of trial and error, trying to prove why fixupOptionType should
> be used here or not, I figured it out: It's needed for the sake of file
> locations in error messages.
|
|
|
|
|
|
|
|
|
|
This scans the options with fewer function calls, improving performance.
It also removes a let Env from the happy flow of the new logic.
|
|
|
|
... where a bare submodule is an option that has a type like
`submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`.
This makes migration unnecessary when introducing a freeform type
in an existing option tree.
Closes #146882
|
|
This ensures that the module file locations are propagated to the
freeform type, which makes it so that submodules in freeform types now
have their declaration location shown in the manual, fixing
https://github.com/NixOS/nixpkgs/issues/132085.
In addition, this also newly allows freeformTypes to be declared
multiple times and all declarations being merged together according to
normal option merging.
This also removes some awkwardness regarding the type of `freeformType`
|
|
Fixes https://github.com/NixOS/nixpkgs/issues/53458, as types.raw
doesn't allow setting multiple values
|
|
Wraps a module with a default location for reporting errors.
|
|
module.${attr} is used at least twice, so it must be evaluated at least
twice (and since it's a function argument, be turned into a thunk
twice).
|
|
the foldl is equivalent to a zip with concat. list concatenation in nix
is an O(n) operation, which makes this operation extremely inefficient
when large numbers of modules are involved.
this change reduces the number of list elements by 7 million on the
system used to write this, total memory spent on lists by 58MB, and
total memory allocated on the GC heap by almost 100MB (with a similar
reduction in GC heap size). it's also slightly faster.
|
|
treewide: more defaultText for options
|
|
|