1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

Merge pull request #36652 from roberth/cabal2nix-extra-options

haskell.lib.haskellSrc2nix: add extraCabal2nixOptions
This commit is contained in:
Peter Simons 2018-03-09 15:06:14 +01:00 committed by GitHub
commit 90b394936b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"
'';
};