Commit Graph

18 Commits

Author SHA1 Message Date
Silvan Mosberger
9a44f44d4c
lib/types: Add oneOf, extension of either to a list of types 2019-08-06 14:08:42 +02:00
(cdep)illabout
dcbd136319
Fix the documentation for the tests to reflect what is actually happening. 2019-02-07 10:33:48 +09:00
(cdep)illabout
81fa1e392b lib/modules: Change mkAliasOptionModule to use the priority for the alias.
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
2019-01-24 13:02:16 +09:00
(cdep)illabout
7314d885a1
Add test that shows that the aliases are able to override options. 2019-01-06 18:10:03 +09:00
(cdep)illabout
b81b3ad1b0
lib/modules: Add a function to create an option alias that respects the priority
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.
2019-01-04 18:35:10 +09:00
(cdep)illabout
da00ec4b45
Add a failing test for mkAliasOptionModule. 2019-01-04 18:34:09 +09:00
Robert Helgesson
08e8701673
lib.types: fix loaOf behavior for long lists
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.
2018-05-07 20:23:52 +02:00
Silvan Mosberger
b16a69289a lib/types: Add coercedTo unsound tests 2018-05-06 23:58:36 +02:00
Profpatsch
462c048c77 lib/types: add ints.positive.
For values that are positive, but cannot be 0.
2017-11-05 15:56:32 +01:00
Profpatsch
c85f085062 lib/types: update docs to match the new type names 2017-11-05 15:56:32 +01:00
Daiderd Jordan
d88721e440
modules: add support for module replacement with disabledModules
This is based on a prototype Nicolas B. Pierron worked on during a
discussion we had at FOSDEM.

A new version with a workaround for problems of the reverted original.
Discussion: https://github.com/NixOS/nixpkgs/commit/3f2566689
2017-03-03 13:45:22 +01:00
Vladimír Čunát
fcec3e1c72
Revert "modules: add support for module replacement with disabledModules"
This reverts commit 3f2566689d14f1d7778d55ca807d1dad2f4695d1 for now.
Evaluation of the tested job got broken, blocking nixos-unstable.
2017-03-01 21:56:01 +01:00
Daiderd Jordan
37705ac1b1 use relative path for module tests 2017-02-28 00:14:48 +01:00
Daiderd Jordan
3f2566689d modules: add support for module replacement with disabledModules
This is based on a prototype Nicolas B. Pierron worked on during a
discussion we had at FOSDEM.
2017-02-28 00:14:48 +01:00
Nikolay Amiantov
fcb20b9fee module tests: add tests for coercedTo 2017-02-02 01:53:00 +03:00
Nicolas B. Pierron
a6b455bbae NixOS modules: Add error context on module arguments evaluation. 2015-07-14 15:07:54 +02:00
Nicolas B. Pierron
7f1a782d91 Add tests for the new module system improvements. 2015-03-16 22:38:41 +01:00
Nicolas B. Pierron
6d15e32536 Issue #6161 - Add tests for NixOS modules. 2015-02-09 00:07:44 +01:00