lib.types.boolByOr: init
This type is necessary to have correct merging behavior for `allowUnfreePredicate` and `allowInsecurePredicate` Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
@@ -111,6 +111,12 @@ checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*'
|
||||
checkConfigError 'while evaluating a definition from `.*/define-enable-abort.nix' config.enable ./define-enable-abort.nix
|
||||
checkConfigError 'while evaluating the error message for definitions for .enable., which is an option that does not exist' config.enable ./define-enable-abort.nix
|
||||
|
||||
# Check boolByOr type.
|
||||
checkConfigOutput '^false$' config.value.falseFalse ./boolByOr.nix
|
||||
checkConfigOutput '^true$' config.value.trueFalse ./boolByOr.nix
|
||||
checkConfigOutput '^true$' config.value.falseTrue ./boolByOr.nix
|
||||
checkConfigOutput '^true$' config.value.trueTrue ./boolByOr.nix
|
||||
|
||||
checkConfigOutput '^1$' config.bare-submodule.nested ./declare-bare-submodule.nix ./declare-bare-submodule-nested-option.nix
|
||||
checkConfigOutput '^2$' config.bare-submodule.deep ./declare-bare-submodule.nix ./declare-bare-submodule-deep-option.nix
|
||||
checkConfigOutput '^42$' config.bare-submodule.nested ./declare-bare-submodule.nix ./declare-bare-submodule-nested-option.nix ./declare-bare-submodule-deep-option.nix ./define-bare-submodule-values.nix
|
||||
|
||||
14
lib/tests/modules/boolByOr.nix
Normal file
14
lib/tests/modules/boolByOr.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ lib, ... }: {
|
||||
|
||||
options.value = lib.mkOption {
|
||||
type = lib.types.lazyAttrsOf lib.types.boolByOr;
|
||||
};
|
||||
|
||||
config.value = {
|
||||
falseFalse = lib.mkMerge [ false false ];
|
||||
trueFalse = lib.mkMerge [ true false ];
|
||||
falseTrue = lib.mkMerge [ false true ];
|
||||
trueTrue = lib.mkMerge [ true true ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user