Loading lib/tests/modules.sh +1 −0 Original line number Diff line number Diff line Loading @@ -706,6 +706,7 @@ checkConfigError 'The option .group..*would be a parent of the following options # types.optionDeclaration checkConfigOutput '^10$' config.anOption ./option.nix checkConfigError 'A definition for option .aBadOptionDef. is not of type .option declaration.' config.aBadOptionDef ./option.nix # Test that types.optionType merges types correctly checkConfigOutput '^10$' config.theOption.int ./optionTypeMerging.nix Loading lib/tests/modules/option.nix +13 −1 Original line number Diff line number Diff line { config, lib, ... }: { config, lib, options, ... }: { options = { theOption = lib.mkOption { type = lib.types.optionDeclaration; }; anOption = config.theOption; aBadOptionDef = lib.mkOption { type = lib.types.optionDeclaration; description = '' This option is perfectly fine, but will have a bad definition. ''; }; }; config = { theOption = lib.mkOption { type = lib.types.int; }; anOption = 10; aBadOptionDef = options.theOption; # Not a declaration }; } Loading
lib/tests/modules.sh +1 −0 Original line number Diff line number Diff line Loading @@ -706,6 +706,7 @@ checkConfigError 'The option .group..*would be a parent of the following options # types.optionDeclaration checkConfigOutput '^10$' config.anOption ./option.nix checkConfigError 'A definition for option .aBadOptionDef. is not of type .option declaration.' config.aBadOptionDef ./option.nix # Test that types.optionType merges types correctly checkConfigOutput '^10$' config.theOption.int ./optionTypeMerging.nix Loading
lib/tests/modules/option.nix +13 −1 Original line number Diff line number Diff line { config, lib, ... }: { config, lib, options, ... }: { options = { theOption = lib.mkOption { type = lib.types.optionDeclaration; }; anOption = config.theOption; aBadOptionDef = lib.mkOption { type = lib.types.optionDeclaration; description = '' This option is perfectly fine, but will have a bad definition. ''; }; }; config = { theOption = lib.mkOption { type = lib.types.int; }; anOption = 10; aBadOptionDef = options.theOption; # Not a declaration }; }