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:03:00 +0000
committerGitHub <noreply@github.com>2023-02-10 00:03:00 +0000
commit0417b0e54f3055fbd5d4129b8c57811b9e228f9e (patch)
treea85710963a65875ce9c620342ed3e88fb1a1a855 /lib
parent5bc96030b03cf1199899b07a04c2076dcd1d75ff (diff)
parent71c0c6d98488e3e5b0d068b234c8fe1b9c5f2321 (diff)
Merge staging-next into staging
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;