summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-05-05 16:23:57 -0400
committerNicolas B. Pierron <nicolas.b.pierron@gmail.com>2015-03-12 23:42:57 +0100
commite3eff53037f1b7abb7a44ba72f59f20649023642 (patch)
tree4e48d6f16aca424ee144a05390c481aa824ee070 /lib/modules.nix
parente4a06f35b1d88ab98fa8b6962e7a3f802232d165 (diff)
downloadnixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar.gz
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar.bz2
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar.lz
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar.xz
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.tar.zst
nixpkgs-e3eff53037f1b7abb7a44ba72f59f20649023642.zip
evalModules: Add internal option for the check argument
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 84ca209d367..1d7c7b22765 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -25,6 +25,16 @@ rec {
 
             internal = true;
           };
+
+          __internal.check = mkOption {
+            description = "Whether to check whether all option definitions have matching declarations.";
+
+            type = types.uniq types.bool;
+
+            internal = true;
+
+            default = check;
+          };
         };
 
         config = {
@@ -45,7 +55,7 @@ rec {
           if isOption v then v.value
           else yieldConfig (prefix ++ [n]) v) set) ["_definedNames"];
         in
-        if check && set ? _definedNames then
+        if options.__internal.check.value && set ? _definedNames then
           fold (m: res:
             fold (name: res:
               if set ? ${name} then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")