diff options
author | sternenseemann <sternenseemann@systemli.org> | 2021-12-15 13:13:01 +0100 |
---|---|---|
committer | sterni <sternenseemann@systemli.org> | 2021-12-15 17:23:04 +0100 |
commit | 90a8618c03970d3ee190c7c8da9b19a0a1b05e44 (patch) | |
tree | 91be4091fafaee5933ece9ea5433e41adc68488d /maintainers/scripts | |
parent | ca91080b21890aacef4e7b9e9465abcb37920aac (diff) | |
download | nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar.gz nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar.bz2 nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar.lz nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar.xz nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.tar.zst nixlib-90a8618c03970d3ee190c7c8da9b19a0a1b05e44.zip |
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`.
Diffstat (limited to 'maintainers/scripts')
-rw-r--r-- | maintainers/scripts/haskell/test-configurations.nix | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/maintainers/scripts/haskell/test-configurations.nix b/maintainers/scripts/haskell/test-configurations.nix index 05f26f861473..12287896b50d 100644 --- a/maintainers/scripts/haskell/test-configurations.nix +++ b/maintainers/scripts/haskell/test-configurations.nix @@ -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 |