nixpkgs/lib
Silvan Mosberger 998a9c1707 lib/options: Better mergeEqualOption error for uncomparable types
For an option definition that uses `lib.options.mergeEqualOption`
underneath, like `types.anything`, an error is thrown when multiple
functions are assigned, indicating that functions can't be compared for
equivalence:

  error: The option `test' has conflicting definition values:
  - In `xxx': <function>
  - In `xxx': <function>
  (use '--show-trace' to show detailed location information)

However, the error message didn't use the correct files. While above
error indicates that both definitions are in the xxx file, that's in
fact not true. Above error was generated with

  options.test = lib.mkOption {
    type = lib.types.anything;
  };

  imports = [
    {
      _file = "yyy";
      test = y: y;
    }
    {
      _file = "xxx";
      test = x: x;
    }
  ];

With this change, the error uses the correct file locations:

  error: The option `test' has conflicting definition values:
  - In `xxx': <function>
  - In `yyy': <function>
  (use '--show-trace' to show detailed location information)
2021-08-10 19:54:32 +02:00
..
systems lib.systems: add m68k-netbsd support 2021-08-01 15:27:12 +00:00
tests Merge pull request #131267 from blaggacao/fix-functionArgs 2021-08-04 00:02:57 +02:00
asserts.nix
attrsets.nix Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
cli.nix
customisation.nix treewide: Do a number of no-op cleanups for cross and darwin 2021-05-06 11:17:26 -04:00
debug.nix lib/debug: add traceFnSeqN 2021-01-25 19:25:50 +01:00
default.nix lib.mkFixStrictness: Deprecate 2021-07-12 07:31:29 +02:00
deprecated.nix treewide: fold -> foldr 2021-01-26 10:57:07 +07:00
fetchers.nix
filesystem.nix lib: Add readTree function to filesystem 2020-10-19 16:42:21 -07:00
fixed-points.nix lib: Add composeManyExtensions 2020-11-13 21:37:57 +01:00
flake.nix init: lib/flake 2021-04-28 14:21:27 -05:00
generators.nix lib/generators: add toDhall 2021-04-01 14:29:57 +02:00
kernel.nix Merge pull request #84032 from teto/fix_kernel_merge 2020-05-22 13:32:22 +02:00
licenses.nix treewide: use quotes for url 2021-06-20 16:26:23 +02:00
lists.nix lib: remove mention of flashplayer in docs 2021-02-08 09:38:41 -08:00
meta.nix lib.meta: introduce availableOn 2021-04-02 19:20:23 +08:00
minver.nix Bump minver.nix to 2.2 2020-06-04 13:43:10 +02:00
modules.nix lib.mkFixStrictness: Deprecate 2021-07-12 07:31:29 +02:00
options.nix lib/options: Better mergeEqualOption error for uncomparable types 2021-08-10 19:54:32 +02:00
sources.nix lib.sources.trace: init 2021-05-29 16:03:55 +02:00
strings-with-deps.nix lib: Use Nix's static scope checking, fix error message, optimize 2020-10-22 13:46:47 +02:00
strings.nix strings.nix: Fix overly monomorphic type signature comments 2021-07-04 20:52:48 +02:00
trivial.nix lib: fix functionArgs for functors 2021-08-03 16:40:58 -05:00
types.nix Merge pull request #128032 from Artturin/add-swap-options 2021-07-23 10:45:53 +02:00
versions.nix
zip-int-bits.nix