summary refs log tree commit diff
path: root/lib/modules.nix
Commit message (Collapse)AuthorAge
...
* | Merge pull request #191540 from hercules-ci/nixosTest-modularRobert Hensing2022-09-28
|\ \ | |/ |/| nixosTest: make modular
| * lib/modules: Fix meta duplication in shorthand syntaxRobert Hensing2022-09-21
| |
* | lib/modules: add `definitionsWithLocations` to evaluated optionsErik Arvstedt2022-09-05
|/ | | | | | | | | 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`.
* Merge branch 'master' into option-docs-mdpennae2022-09-01
|\
| * lib.modules: support strings with absolute paths in `disabledModules`Erik Arvstedt2022-08-31
| | | | | | | | | | | | | | | | | | 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.
* | lib/modules: convert option description to MDpennae2022-08-31
|/
* lib/modules: Add _module.specialArgsRobert Hensing2022-07-21
|
* lib/modules: Throw earlier when module function does not return attrsRobert Hensing2022-06-14
| | | | | | | `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.
* lib.types: Add deferredModuleWithRobert Hensing2022-06-14
|
* lib/types, lib/modules: Remove unused extensionOffsetRobert Hensing2022-06-14
|
* lib/modules: Fix missing prefix in extendModules when unset in both eval- ↵Robert Hensing2022-06-10
| | | | and extend-
* Merge pull request #167776 from ↵Robert Hensing2022-04-30
|\ | | | | | | | | hercules-ci/lib-modules-allow-disable-_modules.args-docs-internal lib.modules: Allow making _module.args internal
| * lib.modules: Allow making _module.args internalRobert Hensing2022-04-11
| | | | | | | | | | | | | | | | 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.types.submoduleWith: Avoid _key collisions after extendModulesRobert Hensing2022-04-24
|/
* Merge pull request #165540 from Infinisil/module-args-docsRobert Hensing2022-04-05
|\ | | | | lib/modules: Document `_module.args`
| * lib/modules: Document _module.argsSilvan Mosberger2022-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #164651 from Infinisil/remove-optionSetSilvan Mosberger2022-03-25
|\ \ | | | | | | lib/modules: Finally remove deprecated types.optionSet
| * | lib/modules: Finally remove deprecated types.optionSetSilvan Mosberger2022-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 :)
* | | Merge remote-tracking branch 'upstream/master' into tests-restrict-argumentsRobert Hensing2022-03-21
|\ \ \ | | |/ | |/|
| * | Merge pull request #163451 from hercules-ci/stop-premature-warningsKevin Cox2022-03-21
| |\ \ | | |/ | |/| Stop premature warnings, including `nix.settings` migration
| | * lib.mkRenamedOptionModuleWith: Remove warnWhenReadRobert Hensing2022-03-21
| | | | | | | | | | | | | | | Let's keep things simple and not poke holes in the improved migration process.
| | * lib: Add mkRenamedOptionModuleWithRobert Hensing2022-03-09
| | | | | | | | | | | | Adds support for sinceRelease
| * | Merge pull request #156533 from ↵Silvan Mosberger2022-03-16
| |\ \ | | | | | | | | | | | | | | | | hercules-ci/issue-146882-transparent-submodule-options lib.modules: Let module declare options directly in bare submodule
| | * | lib/modules.nix: Add comment about internal shorthand null valueRobert Hensing2022-03-07
| | | |
| | * | lib/modules.nix: Move comment to the actual legacy codeRobert Hensing2022-03-07
| | | |
| | * | Revert "lib.modules: Remove redundant fixupOptionType in option injection"Robert Hensing2022-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | lib.modules: Remove redundant fixupOptionType in option injectionRobert Hensing2022-03-03
| | | |
| | * | lib.modules: Make option injection work when shorthandOnlyDefinesConfigRobert Hensing2022-03-03
| | | |
| | * | lib.modules: Improve option-is-prefix error messageRobert Hensing2022-03-03
| | | |
| | * | lib.modules: Explain why options can only be merged into submodulesRobert Hensing2022-03-03
| | | |
| | * | lib.modules: Refactor option scanning slightlyRobert Hensing2022-03-03
| | | | | | | | | | | | | | | | | | | | | | | | This scans the options with fewer function calls, improving performance. It also removes a let Env from the happy flow of the new logic.
| | * | lib.types.submodule: Remove redundant isSubmodule attrRobert Hensing2022-03-03
| | | |
| | * | lib.modules: Let module declare options directly in bare submoduleRobert Hensing2022-03-03
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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
* | / lib: applyIfFunction -> applyModuleArgsIfFunctionRobert Hensing2022-03-21
|/ /
* / lib/modules.nix: Optimize optionSet legacy compat codeRobert Hensing2022-03-07
|/ | | | It's still in the hot path.
* lib.modules: Use types.optionType for _module.freeformTypeSilvan Mosberger2022-03-01
| | | | | | | | | | | | | 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`
* lib/modules: Use types.raw for _module.argsSilvan Mosberger2022-02-22
| | | | | Fixes https://github.com/NixOS/nixpkgs/issues/53458, as types.raw doesn't allow setting multiple values
* lib/modules: introduce setDefaultModuleLocationNaïm Favier2022-01-27
| | | | Wraps a module with a default location for reporting errors.
* lib/modules: extract multiply-used value in byNamepennae2021-12-28
| | | | | | 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).
* lib/modules: optimize byNamepennae2021-12-25
| | | | | | | | | | | 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.
* Merge pull request #148785 from pennae/more-option-doc-staticizingGraham Christensen2021-12-17
|\ | | | | treewide: more defaultText for options
| * nixos/modules: Allow options to be coerced to a string for convenienceSilvan Mosberger2021-12-08
| |
* | Merge pull request #144022 from hercules-ci/lib-modules-optimize-unmatchedDefnsSilvan Mosberger2021-12-07
|\ \ | | | | | | lib/modules: Short-circuit unmatchedDefns when configs is empty
| * | lib/modules: Use strict fold' as recursiveUpdate is also strictRobert Hensing2021-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recursiveUpdate does not produce an attrset until it has evaluated both its arguments to weak head normal form. nix-repl> lib.recursiveUpdate (throw "a") (throw "b") error: b nix-repl> lib.recursiveUpdate (throw "a") {} error: a
| * | lib/modules: Fix import* commentsRobert Hensing2021-11-03
| | | | | | | | | | | | Very confusing otherwise.
| * | lib/modules: Remove a lib.flipRobert Hensing2021-11-03
| | | | | | | | | | | | In hot code, the overhead (envs, applies) can matter.
| * | lib/modules: Short-circuit unmatchedDefns earlierRobert Hensing2021-11-03
| | |
| * | lib/modules: Short-circuit unmatchedDefns when configs is emptyRobert Hensing2021-10-31
| | |
* | | lib/modules: Deprecate args and checkRobert Hensing2021-12-02
| | |
* | | lib/modules: Pass legacy args argument along through extendModulesRobert Hensing2021-12-02
| |/ |/|