lib/modules.nix: Clean up mergeAttrDefinitionsWithPrio impl

This commit is contained in:
Robert Hensing 2023-06-23 18:10:49 +02:00 committed by GitHub
parent 8f31bff794
commit 895ac17634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -920,14 +920,7 @@ let
option -> attrsOf { highestPrio, value } option -> attrsOf { highestPrio, value }
*/ */
mergeAttrDefinitionsWithPrio = opt: mergeAttrDefinitionsWithPrio = opt:
let subAttrDefs = let
lib.concatMap
({ value, ... }@def:
map
(value: def // { inherit value; })
(lib.pushDownProperties value)
)
opt.definitionsWithLocations;
defsByAttr = defsByAttr =
lib.zipAttrs ( lib.zipAttrs (
lib.concatLists ( lib.concatLists (
@ -935,7 +928,7 @@ let
({ value, ... }@def: ({ value, ... }@def:
map map
(lib.mapAttrsToList (k: value: { ${k} = def // { inherit value; }; })) (lib.mapAttrsToList (k: value: { ${k} = def // { inherit value; }; }))
(lib.pushDownProperties value) (pushDownProperties value)
) )
opt.definitionsWithLocations opt.definitionsWithLocations
) )