maintainers/scripts/test-configuration.nix: improve overlay call

configuration-nix.nix uses builtins.intersectAttrs to not any overrides
for packages not present in `super` (presumably for use outside of
nixpkgs?). To accomodate it, we pass an attribute set with every
attribute of haskellPackages, but set to `null` as `super`, and — while
we're at it — a fix point as `self`.
This commit is contained in:
sternenseemann 2021-12-15 13:13:01 +01:00 committed by sterni
parent ca91080b21
commit 90a8618c03

View File

@ -96,12 +96,22 @@ let
"darwin" = defaultSets;
}.${configName} or setsForVersion;
# evaluate a configuration and only return the attributes changed by it
# attribute set that has all the attributes of haskellPackages set to null
availableHaskellPackages = builtins.listToAttrs (
builtins.map (attr: lib.nameValuePair attr null) (
builtins.attrNames pkgs.haskellPackages
)
);
# evaluate a configuration and only return the attributes changed by it,
# pass availableHaskellPackages as super in case intersectAttrs is used
overriddenAttrs = fileName: builtins.attrNames (
lib.fix (self:
import (nixpkgsPath + "/pkgs/development/haskell-modules/${fileName}") {
haskellLib = pkgs.haskell.lib.compose;
inherit pkgs;
} {} {}
} self availableHaskellPackages
)
);
# list of derivations that are affected by overrides in the given configuration