diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 95dac230cc55..928c002c3af0 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -170,19 +170,22 @@ in package-set { inherit pkgs stdenv callPackage; } self // { callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version); # Creates a Haskell package from a source package by calling cabal2nix on the source. - callCabal2nix = name: src: args: let - filter = path: type: - pkgs.lib.hasSuffix "${name}.cabal" path || - baseNameOf path == "package.yaml"; - expr = self.haskellSrc2nix { - inherit name; - src = if pkgs.lib.canCleanSource src - then pkgs.lib.cleanSourceWith { inherit src filter; } - else src; - }; - in overrideCabal (callPackageKeepDeriver expr args) (orig: { - inherit src; - }); + callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args: + let + filter = path: type: + pkgs.lib.hasSuffix "${name}.cabal" path || + baseNameOf path == "package.yaml"; + expr = self.haskellSrc2nix { + inherit name extraCabal2nixOptions; + src = if pkgs.lib.canCleanSource src + then pkgs.lib.cleanSourceWith { inherit src filter; } + else src; + }; + in overrideCabal (callPackageKeepDeriver expr args) (orig: { + inherit src; + }); + + callCabal2nix = name: src: args: self.callCabal2nixWithOptions name src "" args; # : { root : Path # , source-overrides : Defaulted (Either Path VersionNumber)