about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-03-16 21:05:52 +0100
committerSilvan Mosberger <contact@infinisil.com>2020-03-17 19:19:39 +0100
commitdcdd232939232d04c1132b4cc242dd3dac44be8c (patch)
treec4e3d7aa9486f741f8747700ca27f383125563ae /lib
parent41742c85ec108ce9c89a315d16e6494bc3885542 (diff)
downloadnixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar.gz
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar.bz2
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar.lz
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar.xz
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.tar.zst
nixlib-dcdd232939232d04c1132b4cc242dd3dac44be8c.zip
lib/modules: Remove internal _module attribute from config
The _module option is added as an internal option set, and it messes up
the results of module evaluations, requiring people to manually filter
_modules out.

If people depend on this, they can still use config._module from inside
the modules, exposing _module as an explicitly declared user option. Or
alternatively with the _module attribute now returned by evalModules.
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 6cbef5632bd7..48f4c04ed1bf 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -93,7 +93,11 @@ rec {
             res set._definedNames
         else
           res;
-      result = { inherit options config; };
+      result = {
+        inherit options;
+        config = removeAttrs config [ "_module" ];
+        inherit (config) _module;
+      };
     in result;
 
   # collectModules :: (modulesPath: String) -> (modules: [ Module ]) -> (args: Attrs) -> [ Module ]