@@ -476,23 +476,26 @@ final: prev: {
476476 # components so they have a `.project` attribute and as well as
477477 # a `.package` attribute on the components.
478478 addProjectAndPackageAttrs = rawProject:
479− final.lib.fix (project: rawProject // {
480− hsPkgs = (final.lib.mapAttrs (n: package:
481− if package == null
482− then null
483− else
484− package // {
485− components = final.lib.mapAttrs (n: v:
486− if n == "library" || n == "all"
487− then v // { inherit project package; }
488− else final.lib.mapAttrs (_: c: c // { inherit project package; }) v
489− ) package.components;
490− inherit project;
491− }
492− ) rawProject.hsPkgs
493− // {
494− # These are functions not packages
495− inherit (rawProject.hsPkgs) shellFor ghcWithHoogle ghcWithPackages;
479+ final.lib.fix (project':
480+ let project = final.lib.dontRecurseIntoAttrs project';
481+ in rawProject // {
482+ hsPkgs = (final.lib.mapAttrs (n: package':
483+ if package' == null
484+ then null
485+ else
486+ let package = final.lib.dontRecurseIntoAttrs package';
487+ in package' // {
488+ components = final.lib.mapAttrs (n: v:
489+ if n == "library" || n == "all"
490+ then v // { inherit project package; }
491+ else final.lib.mapAttrs (_: c: c // { inherit project package; }) v
492+ ) package'.components;
493+ inherit project;
494+ }
495+ ) rawProject.hsPkgs
496+ // {
497+ # These are functions not packages
498+ inherit (rawProject.hsPkgs) shellFor ghcWithHoogle ghcWithPackages;
496499 });
497500 });
498501