diff --git a/doc/languages-frameworks/haskell.section.md b/doc/languages-frameworks/haskell.section.md index 247daf8d1dbe..3c2798c538d0 100644 --- a/doc/languages-frameworks/haskell.section.md +++ b/doc/languages-frameworks/haskell.section.md @@ -191,6 +191,10 @@ and `version` from Hackage. `sha256` : Hash to use for the default case of `src`. +`sourceRoot`, `setSourceRoot` +: Passed to `stdenv.mkDerivation`; see [“Variables controlling the unpack +phase”](#variables-controlling-the-unpack-phase). + `revision` : Revision number of the updated cabal file to fetch from Hackage. If `null` (which is the default value), the one included in `src` is used. diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 92c2451a5df1..14afa3dfe6b4 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -34,6 +34,8 @@ in , version, revision ? null , sha256 ? null , src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; } +, sourceRoot ? null +, setSourceRoot ? null , buildDepends ? [], setupHaskellDepends ? [], libraryHaskellDepends ? [], executableHaskellDepends ? [] , buildTarget ? "" , buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [], benchmarkToolDepends ? [] @@ -825,6 +827,8 @@ stdenv.mkDerivation ({ ; } +// optionalAttrs (args ? sourceRoot) { inherit sourceRoot; } +// optionalAttrs (args ? setSourceRoot) { inherit setSourceRoot; } // optionalAttrs (args ? preCompileBuildDriver) { inherit preCompileBuildDriver; } // optionalAttrs (args ? postCompileBuildDriver) { inherit postCompileBuildDriver; } // optionalAttrs (args ? preUnpack) { inherit preUnpack; }