diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index f10b5831267d..a7d1a3483a08 100644 --- a/pkgs/lib/options.nix +++ b/pkgs/lib/options.nix @@ -66,18 +66,18 @@ rec { if all opt.check list then opt.merge list else - throw "One of the definitions has a bad type."; + throw "One of option ${name} values is of a bad type."; } else opt; - ensureDefaultType = opt: + checkDefault = opt: if opt ? check && opt ? default then opt // { default = if opt.check opt.default then opt.default else - throw "The default value has a bad type."; + throw "The default value of option ${name} is of a bad type."; } else opt; @@ -136,7 +136,7 @@ rec { # override settings ensureMergeInputType - ensureDefaultType + checkDefault handleOptionSets ];