diff options
| author | Robert Hensing <roberth@users.noreply.github.com> | 2025-04-01 00:48:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-01 00:48:56 +0200 |
| commit | d2c98293660ca32b5e3a3ee9510e0dcb26b787ef (patch) | |
| tree | 9239993339f39b4044e768719e18022da2031088 /lib | |
| parent | python3Packages.langchain*: bulk update (#394752) (diff) | |
| parent | lib.modules: simplified logic in zipAttrsWith and minor cleanup (diff) | |
| download | nixpkgs-d2c98293660ca32b5e3a3ee9510e0dcb26b787ef.tar.gz | |
lib.modules: simplified logic in usage of zipAttrsWith and minor cleanup (#388748)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/modules.nix | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index 935ef4baabad..8e6c6249f61c 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -320,7 +320,6 @@ let prefix ? [], }: evalModules (evalModulesArgs // { - inherit class; modules = regularModules ++ modules; specialArgs = evalModulesArgs.specialArgs or {} // specialArgs; prefix = extendArgs.prefix or evalModulesArgs.prefix or []; @@ -335,8 +334,7 @@ let options = checked options; config = checked (removeAttrs config [ "_module" ]); _module = checked (config._module); - inherit extendModules type; - class = class; + inherit extendModules type class; }; in result; @@ -602,7 +600,7 @@ let # an attrset 'name' => list of submodules that declare ‘name’. declsByName = zipAttrsWith - (n: concatLists) + (n: v: v) (map (module: let subtree = module.options; in if !(isAttrs subtree) then @@ -614,7 +612,7 @@ let else mapAttrs (n: option: - [{ inherit (module) _file; pos = unsafeGetAttrPos n subtree; options = option; }] + { inherit (module) _file; pos = unsafeGetAttrPos n subtree; options = option; } ) subtree ) @@ -657,12 +655,12 @@ let # extract the definitions for each loc rawDefinitionsByName = zipAttrsWith - (n: concatLists) + (n: v: v) (map (module: mapAttrs (n: value: - [{ inherit (module) file; inherit value; }] + { inherit (module) file; inherit value; } ) module.config ) |
