Move packageSourceOverrides to haskellLib

This commit is contained in:
Will Fancher
2018-01-18 16:42:56 -05:00
parent c278dd0b9d
commit 9047a7dd33
2 changed files with 14 additions and 12 deletions
+12
View File
@@ -40,6 +40,18 @@ rec {
overrideScope = scope: overrideCabal (drv.overrideScope scope) f;
};
# : Map Name (Either Path VersionNumber) -> HaskellPackageOverrideSet
# Given a set whose values are either paths or version strings, produces
# a package override set (i.e. (self: super: { etc. })) that sets
# the packages named in the input set to the corresponding versions
packageSourceOverrides =
overrides: self: super: pkgs.lib.mapAttrs (name: src:
let isPath = x: builtins.substring 0 1 (toString x) == "/";
generateExprs = if isPath src
then self.callCabal2nix
else self.callHackage;
in generateExprs name src {}) overrides;
/* doCoverage modifies a haskell package to enable the generation
and installation of a coverage report.