haskell overrides: admit old overrides

This commit is contained in:
tv 2022-09-13 21:22:15 +02:00
parent 4005029bf6
commit 5de8b8530c
2 changed files with 14 additions and 8 deletions

View File

@ -8,11 +8,13 @@ in
haskell = super.haskell // { haskell = super.haskell // {
packages = mapAttrs (name: value: packages = mapAttrs (name: value:
if hasAttr "override" value if hasAttr "override" value
then value.override { inherit overrides; } then value.override (old: {
overrides = composeExtensions (old.overrides or (_: _: {})) overrides;
})
else value else value
) super.haskell.packages; ) super.haskell.packages;
}; };
haskellPackages = super.haskellPackages.override { haskellPackages = super.haskellPackages.override (old: {
inherit overrides; overrides = composeExtensions (old.overrides or (_: _: {})) overrides;
}; });
} }

View File

@ -10,11 +10,15 @@ in
haskell = super.haskell // { haskell = super.haskell // {
packages = mapAttrs (name: value: packages = mapAttrs (name: value:
if hasAttr "override" value if hasAttr "override" value
then value.override { inherit overrides; } then value.override (old: {
overrides =
composeExtensions (old.overrides or (_: _: { })) overrides;
})
else value else value
) super.haskell.packages; ) super.haskell.packages;
}; };
haskellPackages = super.haskellPackages.override { haskellPackages = super.haskellPackages.override (old: {
inherit overrides; overrides =
}; composeExtensions (old.overrides or (_: _: { })) overrides;
});
} }