diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index bff27fc77754..ff552740a6bd 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1164,6 +1164,35 @@ self: super: { jailbreak = assert drv.version == "1.0.9" && drv.revision == "1"; true; }) super.dhall-nixpkgs); + stack_2_11_1 = + lib.pipe + super.stack_2_11_1 + [ + (self.generateOptparseApplicativeCompletions [ "stack" ]) + + # Seems to be an unnecessarily strict dep on ansi-terminal + doJailbreak + + # The below patch has unix line endings, but the actual file + # has CRLF line endings. The following override changes the + # file to unix line endings before applying the patch. + (overrideCabal (oldAttrs: { + prePatch = oldAttrs.prePatch or "" + '' + "${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix" src/main/BuildInfo.hs + ''; + })) + # stack-2.11.1 has a bug when building without git. + # https://github.com/commercialhaskell/stack/pull/6127 + (appendPatch + (fetchpatch { + name = "stack-fix-building-without-git.patch"; + url = "https://github.com/commercialhaskell/stack/pull/6127/commits/086f93933d547736a7007fc4110f7816ef21f691.patch"; + hash = "sha256-1nwzMoumWceVu8RNnH2mmSxYT24G1FAnFRJvUMeD3po="; + includes = [ "src/main/BuildInfo.hs" ]; + }) + ) + ]; + stack = lib.pipe (super.stack.override { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06acf4e519de..597ac54bda0d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15956,7 +15956,7 @@ with pkgs; cabal-install = haskell.lib.compose.justStaticExecutables haskellPackages.cabal-install; - stack = haskell.lib.compose.justStaticExecutables haskellPackages.stack; + stack = haskell.lib.compose.justStaticExecutables haskellPackages.stack_2_11_1; hlint = haskell.lib.compose.justStaticExecutables haskellPackages.hlint;