From dcdd232939232d04c1132b4cc242dd3dac44be8c Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 16 Mar 2020 21:05:52 +0100 Subject: [PATCH] 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. --- lib/modules.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ]