Loading lib/modules.nix +27 −4 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,29 @@ let else defsFiltered.values; in # Fast path: the overwhelming majority of options have exactly one # definition whose value carries no property wrapper # (mkIf/mkMerge/mkOverride/mkOrder/definition). In that case the # discharge/filter/sort pipeline above is a no-op but still allocates # several intermediate lists and closures. Detect it up front and hand # the original singleton straight to the type merge. The let-bindings # above are lazy and thus never forced on this branch. if length defs == 1 && ( let d = head defs; in addErrorContext "while evaluating definitions from `${d.file}':" ( !(isAttrs d.value && d.value ? _type) ) ) then { values = defs; highestPrio = defaultOverridePriority; } else { values = defsSorted; inherit (defsFiltered) highestPrio; Loading Loading
lib/modules.nix +27 −4 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,29 @@ let else defsFiltered.values; in # Fast path: the overwhelming majority of options have exactly one # definition whose value carries no property wrapper # (mkIf/mkMerge/mkOverride/mkOrder/definition). In that case the # discharge/filter/sort pipeline above is a no-op but still allocates # several intermediate lists and closures. Detect it up front and hand # the original singleton straight to the type merge. The let-bindings # above are lazy and thus never forced on this branch. if length defs == 1 && ( let d = head defs; in addErrorContext "while evaluating definitions from `${d.file}':" ( !(isAttrs d.value && d.value ? _type) ) ) then { values = defs; highestPrio = defaultOverridePriority; } else { values = defsSorted; inherit (defsFiltered) highestPrio; Loading