summary refs log tree commit diff
path: root/lib/tests/modules
Commit message (Collapse)AuthorAge
* 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/tests/modules: Add test case for duplicate option error file locationRobert Hensing2022-03-07
| |
| * lib.modules: Make option injection work when shorthandOnlyDefinesConfigRobert Hensing2022-03-03
| |
| * lib.modules: Improve option-is-prefix error messageRobert 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.types.optionType: Only merge when necessaryRobert Hensing2022-03-10
|/
* 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.types: Introduce `types.optionType`Silvan Mosberger2022-03-01
| | | | | | This type correctly merges multiple option types together while also annotating them with file information. In a future commit this will be used for `_module.freeformType`
* lib/types: Introduce types.raw for unprocessed valuesSilvan Mosberger2022-02-22
|
* lib/tests: Add tests for emptyValueSilvan Mosberger2022-02-17
|
* Merge pull request #144022 from hercules-ci/lib-modules-optimize-unmatchedDefnsSilvan Mosberger2021-12-07
|\ | | | | lib/modules: Short-circuit unmatchedDefns when configs is empty
| * lib/tests/modules: Test non-strictness some moreRobert Hensing2021-11-03
| | | | | | | | | | Doesn't seem to have been a problem actually, but now it won't regress.
* | modules: Add moduleType to module argumentsRobert Hensing2021-11-22
| |
* | lib.evalModules: Add extendModules and type to resultRobert Hensing2021-11-01
|/ | | | | | | Allows the simultaneous construction of top-level invocations and submodule types. This helps structure configuration systems integration code.
* lib/types: Make types.anything merge functionsSilvan Mosberger2021-10-02
| | | | | Previously it would give an error if there were multiple function definitions.
* Revert "lib/tests: Add type deprecation tests"Robert Hensing2021-05-05
| | | | This reverts commit 8b957e3b301d748e6fbbed806d82bd9d4b9d4ac4.
* lib/tests: Add type deprecation testsSilvan Mosberger2021-05-03
|
* lib/tests: Make sure the submodule type description can be evaluatedSilvan Mosberger2021-05-03
| | | | | | | | | | | | | | | | | In 2d45a62899d47c109a0b8ce4ca9d33265b8a1a37, the submodule type description was amended with the freeformType description. This causes all the modules passed to the submodule to be evaluated once on their own, without any extra definitions from the config section. This means that the specified modules need to be valid on their own, without any undeclared options. This commit adds a test that evaluates a submodules option description, which would trigger the above problem for one of the tests, if it were not fixed by this commit as well. This is done because the next commit makes option evaluation a bit more strict, which would also trigger this test failure, even though it's not related to the change at all.
* lib/tests: More functionTo testsSilvan Mosberger2021-01-27
|
* lib/tests/modules: add a test for the functionTo typeBas van Dijk2021-01-24
| | | | (cherry picked from commit 478af112e83df806bd8a51174834d2a130fbdeb9)
* Revert "Module-builtin assertions, disabling assertions and submodule ↵Silvan Mosberger2020-12-18
| | | | assertions"
* lib/modules: Introduce _module.checks.*.checkSilvan Mosberger2020-12-17
| | | | | | | | | | | | 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: Remove _module.checks.*.triggerPath as it's not necessarySilvan Mosberger2020-11-30
| | | | | | 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: Rename _module.assertions to _module.checksSilvan Mosberger2020-11-30
|
* lib/tests: Add tests for module-builtin assertionsSilvan Mosberger2020-11-30
|
* lib/tests: Add tests for types.anythingSilvan Mosberger2020-09-15
|
* lib/modules: Add syntactic sugar for config._module.freeformTypeSilvan Mosberger2020-08-14
| | | | | | | | | | | This introduces `freeformType` as a top-level module attribute, allowing definitions like { freeformType = ...; options = ...; config = ...; }
* lib/tests: Add tests for freeform modulesSilvan Mosberger2020-08-03
|
* lib/*: editorconfig fixeszowoq2020-07-31
|
* lib/tests: Check for nested option-dependent definitionsSilvan Mosberger2020-03-19
|
* Revert "lib/modules: Throw better error when definitions assign to an option ↵Silvan Mosberger2020-03-19
| | | | | | | | set" This reverts commit 15c873b486347e7861c64fb0b5a7852be9fc82e4. This was causing infinite recursion when depending on nested options
* Merge pull request #82751 from Infinisil/minor-module-improvementsRobert Hensing2020-03-18
|\ | | | | Minor module improvements
| * lib/modules: Throw better error when definitions assign to an option setSilvan Mosberger2020-03-18
| |
* | lib/modules: Test the ability for config to depend on options for compatibilityRobert Hensing2020-03-17
|/
* lib/tests: Add tests for attrsOf and lazyAttrsOfSilvan Mosberger2020-01-10
|
* lib/tests: Fix module testsSilvan Mosberger2020-01-10
| | | | | | | | | Fix the broken test in https://github.com/NixOS/nixpkgs/pull/77416 Apparently hydra uses `nix-build lib/tests/release.nix` to run all tests, where IFD isn't allowed. Fortunately we can get around this with builtins.toFile, which doesn't require IFD, but still can test the properties we want.
* lib/tests: Add test case for imports from derivationsSilvan Mosberger2020-01-10
|
* Merge pull request #76857 from Infinisil/recursive-disableModulesSilvan Mosberger2020-01-09
|\ | | | | Apply `disabledModules` recursively
| * lib/tests: Add tests for recursive disabledModulesSilvan Mosberger2020-01-09
| |
* | lib/tests: remove strictly loaOf tests and rebase on attrsOfrnhmjoj2020-01-06
|/
* lib/tests: Add submoduleWith testsSilvan Mosberger2020-01-02
|
* lib/types: Add oneOf, extension of either to a list of typesSilvan Mosberger2019-08-06
|
* Fix the documentation for the tests to reflect what is actually happening.(cdep)illabout2019-02-07
|
* lib/modules: Change mkAliasOptionModule to use the priority for the alias.(cdep)illabout2019-01-24
| | | | | | | | | | | | | | | This commit changes the `mkAliasOptionModule` function to make sure that the priority for the aliased option is propagated to the non-aliased option. This also affects the `mkRenamedOptionModule` function in a similar fashion. This also removes the `mkAliasOptionModuleWithPriority` function, since its functionality is now subsumed by `mkAliasOptionModule`. This change was recommended by @nbp: https://github.com/NixOS/nixpkgs/pull/53397#discussion_r245487432
* Add test that shows that the aliases are able to override options.(cdep)illabout2019-01-06
|
* lib/modules: Add a function to create an option alias that respects the priority(cdep)illabout2019-01-04
| | | | | | | | | | | | | | | | | This commit adds a function `mkAliasOptionModuleWithPriority`. This function will make an alias to an existing option and copy over the priority. This functionality is needed for PRs like #53041. In that case `nixos-generate-config` added an option to `hardware-configuration.nix` with `mkDefault`. That option was then changed and an alias created for the old name. The end user should be able to set the non-alias option in their `configuration.nix` and have everything work correctly. Without this function, the priority for the option won't be copied over correctly and the end-user will get a message saying they have the same option set to two different values.
* Add a failing test for mkAliasOptionModule.(cdep)illabout2019-01-04
|
* lib.types: fix loaOf behavior for long listsRobert Helgesson2018-05-07
| | | | | | | Assigning a list of 10 or more elements to an option having the type `loaOf a` produces a configuration value that is not honoring the order of the original list. This commit fixes this and a related issue arising when 10 or more lists are merged into this type of option.
* lib/types: Add coercedTo unsound testsSilvan Mosberger2018-05-06
|
* lib/types: add `ints.positive`.Profpatsch2017-11-05
| | | | For values that are positive, but cannot be 0.