···3636 inherit (lib.types)
3737 mkOptionType
3838 ;
3939+ prioritySuggestion = ''
4040+ Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
4141+ '';
3942in
4043rec {
4144···184187 if length defs == 1
185188 then (head defs).value
186189 else assert length defs > 1;
187187- throw "The option `${showOption loc}' is defined multiple times.\n${message}\nDefinition values:${showDefs defs}";
190190+ throw "The option `${showOption loc}' is defined multiple times while it's expected to be unique.\n${message}\nDefinition values:${showDefs defs}\n${prioritySuggestion}";
188191189192 /* "Merge" option definitions by checking that they all have the same value. */
190193 mergeEqualOption = loc: defs:
···195198 else if length defs == 1 then (head defs).value
196199 else (foldl' (first: def:
197200 if def.value != first.value then
198198- throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"
201201+ throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}\n${prioritySuggestion}"
199202 else
200203 first) (head defs) (tail defs)).value;
201204