mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
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:
parent
ca91080b21
commit
90a8618c03
@ -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 (
|
||||
import (nixpkgsPath + "/pkgs/development/haskell-modules/${fileName}") {
|
||||
haskellLib = pkgs.haskell.lib.compose;
|
||||
inherit pkgs;
|
||||
} {} {}
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user