3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/lib
Maximilian Bosch b6d3c9f821
lib/modules: fix error-message when declaring an option inside `config'
The message I originally implemented here was to catch a mixup of
`config' and `options' in a `types.submodule'[1]. However it looks
rather weird for a wrongly declared top-level option.

So I decided to throw

    error: The option `foo' does not exist. Definition values:
           - In `<unknown-file>':
               {
                 bar = {
                   _type = "option";
                   type = {
                     _type = "option-type";
               ...

           It seems as you're trying to declare an option by placing it into `config' rather than `options'!

for an expression like

    with import ./lib;

    evalModules {
      modules = [
        {
          foo.bar = mkOption {
            type = types.str;
          };
        }
      ];
    }

[1]  fa30c9abed
2021-08-25 23:18:27 +02:00
..
systems Merge pull request #134763 from r-burns/fix-scaleway 2021-08-21 03:40:30 +01:00
tests lib/generators/toPretty: add evaluation-limit 2021-08-25 23:18:26 +02:00
asserts.nix
attrsets.nix lib: optimize setAttrByPath and cleaup imports 2021-08-23 18:04:47 -04: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: export strings/escapeRegex 2021-08-22 00:01:38 -04: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 Fix import path. 2021-08-14 14:46:00 -05:00
generators.nix lib/generators/toPretty: add evaluation-limit 2021-08-25 23:18:26 +02:00
kernel.nix Merge pull request #84032 from teto/fix_kernel_merge 2020-05-22 13:32:22 +02:00
licenses.nix lib.licenses: mark a few unfree redistributable licenses as such 2021-08-11 19:07:47 +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/modules: fix error-message when declaring an option inside `config' 2021-08-25 23:18:27 +02:00
options.nix lib/options: use depthLimit for toPretty when showing a definition 2021-08-25 23:18:27 +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