about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-02-10 00:02:27 +0000
committerGitHub <noreply@github.com>2023-02-10 00:02:27 +0000
commit71c0c6d98488e3e5b0d068b234c8fe1b9c5f2321 (patch)
treed2dd58f94a1a8fd38927022df29e23860faab013 /lib
parentb5d4dad2b8432ed1ab8edb68a8af4ac4b4250108 (diff)
parent841564d9983ba98d21c3f837ce5cdc60253815a6 (diff)
Merge master into staging-next
Diffstat (limited to 'lib')
-rw-r--r--lib/options.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/options.nix b/lib/options.nix
index d14d209a83471..5e8f4ca4bb950 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -36,6 +36,9 @@ let
   inherit (lib.types)
     mkOptionType
     ;
+  prioritySuggestion = ''
+   Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
+  '';
 in
 rec {
 
@@ -184,7 +187,7 @@ rec {
     if length defs == 1
     then (head defs).value
     else assert length defs > 1;
-      throw "The option `${showOption loc}' is defined multiple times.\n${message}\nDefinition values:${showDefs defs}";
+      throw "The option `${showOption loc}' is defined multiple times while it's expected to be unique.\n${message}\nDefinition values:${showDefs defs}\n${prioritySuggestion}";
 
   /* "Merge" option definitions by checking that they all have the same value. */
   mergeEqualOption = loc: defs:
@@ -195,7 +198,7 @@ rec {
     else if length defs == 1 then (head defs).value
     else (foldl' (first: def:
       if def.value != first.value then
-        throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}"
+        throw "The option `${showOption loc}' has conflicting definition values:${showDefs [ first def ]}\n${prioritySuggestion}"
       else
         first) (head defs) (tail defs)).value;