about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2024-01-06 16:35:08 +0100
committersternenseemann <sternenseemann@systemli.org>2024-01-06 16:42:49 +0100
commitca733b431bff805ccfc28f1ffeefe8a53c537f42 (patch)
tree7102a7c9822ebe99887627b01a1a6fbedcc36fd9 /pkgs/development/haskell-modules
parentef01f5e93ed0a3518f168b81d0c5611afbfb947d (diff)
downloadnixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar.gz
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar.bz2
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar.lz
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar.xz
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.tar.zst
nixlib-ca733b431bff805ccfc28f1ffeefe8a53c537f42.zip
haskellPackages.extensions: use Cabal core pkg if possible
For GHC 9.6 and 9.8 we can use the Cabal library bundled with GHC since
it matches the requested version. This can prevent inconsistent
dependencies later in e.g. haskell-language-server.

For lower versions we may need to jailbreak and downgrade Cabal to which
upstream seems to be open:

> We need to pin a single major version of Cabal here because the main
> reason we use Cabal is for its list of extensions. Later versions have
> strictly more extensions, and we'll have missing patterns if we try to
> support more than one major version. If this causes problems in
> practice let's revisit this decision and come up with another
> approach.

Alternatively, hls-stan-plugin can be disabled.
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index d19950134d8f..4ed4e122ebfa 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -92,10 +92,13 @@ self: super: {
     guardian
   ;
 
-  # Extensions needs the latest version of Cabal for its list of Haskell language
-  # extensions.
+  # Extensions wants the latest version of Cabal for its list of Haskell
+  # language extensions.
   extensions = super.extensions.override {
-    Cabal = self.Cabal_3_10_2_1;
+    Cabal =
+      if versionOlder self.ghc.version "9.6"
+      then self.Cabal_3_10_2_1
+      else null; # use GHC bundled version
   };
 
   #######################################