|
1 | 1 | { self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true }:
|
2 | 2 | let tool-version-map = import ./tool-map.nix;
|
3 |
| - tool = tool-name: pkgs.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; |
4 |
| - cabal-install = pkgs.haskell-nix.nix-tools-unchecked.exes.cabal; |
| 3 | + tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule]; |
| 4 | + cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal; |
| 5 | + haskell-tools = |
| 6 | + pkgs.lib.optionalAttrs (withHLS && (compiler-not-in ( |
| 7 | + # it appears we can't get HLS build with 9.8 yet. |
| 8 | + pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name |
| 9 | + ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) { hls = tool "haskell-language-server"; } |
| 10 | + // pkgs.lib.optionalAttrs (withHlint && (compiler-not-in ( |
| 11 | + pkgs.lib.optional (builtins.compareVersions compiler.version "9.8" >= 0) compiler-nix-name |
| 12 | + ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) { hlint = tool "hlint"; }; |
5 | 13 | # add a trace helper. This will trace a message about disabling a component despite requesting it, if it's not supported in that compiler.
|
6 | 14 | compiler-not-in = compiler-list: name: (if __elem compiler-nix-name compiler-list then __trace "No ${name}. Not yet compatible with ${compiler-nix-name}" false else true);
|
7 | 15 |
|
@@ -86,17 +94,17 @@ pkgs.mkShell ({
|
86 | 94 | (tool "alex")
|
87 | 95 | stdenv.cc.cc.lib ]) ++ (with pkgs.buildPackages; [
|
88 | 96 | ])
|
89 |
| - ++ pkgs.lib.optional (withHLS && (compiler-not-in ( |
90 |
| - # it appears we can't get HLS build with 9.8 yet. |
91 |
| - pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name |
92 |
| - ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "Haskell Language Server")) (tool "haskell-language-server") |
93 |
| - ++ pkgs.lib.optional (withHlint && (compiler-not-in ( |
94 |
| - pkgs.lib.optional (builtins.compareVersions compiler.version "9.8" >= 0) compiler-nix-name |
95 |
| - ++ pkgs.lib.optional (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) "ghc902") "HLint")) (tool "hlint") |
| 97 | + ++ builtins.attrValues haskell-tools |
96 | 98 | ++ pkgs.lib.optional withIOG
|
97 | 99 | (with pkgs; [ cddl cbor-diag ]
|
98 | 100 | ++ map pkgs.lib.getDev (with pkgs; [
|
99 | 101 | libblst libsodium-vrf secp256k1
|
100 | 102 | ]))
|
101 | 103 | ;
|
| 104 | + |
| 105 | + passthru = { |
| 106 | + plans = if haskell-tools == {} then {} else |
| 107 | + pkgs.pkgsBuildBuild.linkFarm "plans" |
| 108 | + (builtins.mapAttrs (_: t: t.project.plan-nix) haskell-tools); |
| 109 | + }; |
102 | 110 | })
|
0 commit comments