3
0
Fork 0
forked from mirrors/nixpkgs

haskell.lib.haskellSrc2nix: add extraCabal2nixOptions

This commit is contained in:
Robert Hensing 2018-03-09 14:47:47 +01:00
parent 6fcf691545
commit a90294afe4

View file

@ -107,7 +107,7 @@ let
inherit packages;
};
haskellSrc2nix = { name, src, sha256 ? null }:
haskellSrc2nix = { name, src, sha256 ? null, extraCabal2nixOptions ? "" }:
let
sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"'';
in pkgs.buildPackages.stdenv.mkDerivation {
@ -120,7 +120,7 @@ let
installPhase = ''
export HOME="$TMP"
mkdir -p "$out"
cabal2nix --compiler=${ghc.haskellCompilerName} --system=${stdenv.system} ${sha256Arg} "${src}" > "$out/default.nix"
cabal2nix --compiler=${ghc.haskellCompilerName} --system=${stdenv.system} ${sha256Arg} "${src}" ${extraCabal2nixOptions} > "$out/default.nix"
'';
};