callCabal2nix: Fix calling with a path in the store.

This commit is contained in:
Shea Levy
2018-01-11 10:17:56 -05:00
parent 7fedfeabae
commit 4e78aeb441
5 changed files with 24 additions and 2 deletions

View File

@@ -146,7 +146,9 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
overrideCabal (self.callPackage (haskellSrc2nix {
inherit name;
src = pkgs.lib.cleanSourceWith
{ inherit src;
{ src = if pkgs.lib.canCleanSource src
then src
else pkgs.safeDiscardStringContext src;
filter = path: type:
pkgs.lib.hasSuffix "${name}.cabal" path ||
pkgs.lib.hasSuffix "package.yaml" path;