Skip to content

Commit a66a6c5

Browse files
authored
Merge pull request #3133 from haskell/nix-ghc94
nix: fix nix environment for GHC 9.4
2 parents 2bd1863 + 88a1dbb commit a66a6c5

File tree

4 files changed

+92
-58
lines changed

4 files changed

+92
-58
lines changed

configuration-ghc-90.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let
2323
ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_2_0_4;
2424

2525
Cabal = hself.Cabal_3_6_3_0;
26-
ormolu = hself.ormolu_0_5_0_0;
26+
ormolu = hself.ormolu_0_5_0_1;
2727
fourmolu = hself.fourmolu_0_6_0_0;
2828
# Hlint is still broken
2929
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint-34 { });

configuration-ghc-94.nix

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ let
3131

3232
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
3333

34+
cereal = hsuper.callHackage "cereal" "0.5.8.3" {};
35+
base-compat = hsuper.callHackage "base-compat" "0.12.2" {};
36+
base-compat-batteries = hsuper.callHackage "base-compat-batteries" "0.12.2" {};
37+
hashable = hsuper.callHackage "hashable" "1.4.1.0" {};
38+
primitive = hsuper.callHackage "primitive" "0.7.4.0" {};
39+
ghc-check = hsuper.callHackage "ghc-check" "0.5.0.8" {};
40+
lens = hsuper.callHackage "lens" "5.2" {};
41+
integer-logarithms = hsuper.callHackage "integer-logarithms" "1.0.3.1" {};
42+
hiedb = hsuper.callHackage "hiedb" "0.4.2.0" {};
43+
hie-bios = hsuper.callHackage "hie-bios" "0.11.0" {};
44+
lsp = hsuper.callCabal2nix "lsp" "${inputs.lsp}/lsp" {};
45+
lsp-types = hsuper.callCabal2nix "lsp-types" "${inputs.lsp}/lsp-types" {};
46+
3447
# Re-generate HLS drv excluding some plugins
3548
haskell-language-server =
3649
hself.callCabal2nixWithOptions "haskell-language-server" ./.

flake.lock

+49-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+29-18
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
flake = false;
2020
};
2121

22-
# List of hackage dependencies
23-
lsp = {
24-
url = "https://hackage.haskell.org/package/lsp-1.6.0.0/lsp-1.6.0.0.tar.gz";
22+
# cabal hashes contains all the version for different haskell packages, to update:
23+
# nix flake lock --update-input all-cabal-hashes-unpacked
24+
all-cabal-hashes-unpacked = {
25+
url = "github:commercialhaskell/all-cabal-hashes/current-hackage";
2526
flake = false;
2627
};
27-
lsp-types = {
28-
url = "https://hackage.haskell.org/package/lsp-types-1.6.0.0/lsp-types-1.6.0.0.tar.gz";
28+
29+
# List of hackage dependencies
30+
lsp = {
31+
url = "github:haskell/lsp/b0f8596887088b8ab65fc1015c773f45b47234ae";
2932
flake = false;
3033
};
3134
lsp-test = {
@@ -100,7 +103,7 @@
100103
poetry2nix.url = "github:nix-community/poetry2nix/master";
101104
};
102105
outputs =
103-
inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, ... }:
106+
inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, all-cabal-hashes-unpacked, ... }:
104107
{
105108
overlays.default = final: prev:
106109
with prev;
@@ -156,8 +159,8 @@
156159
# GHCIDE requires hie-bios ^>=0.9.1
157160
hie-bios = hself.callCabal2nix "hie-bios" inputs.hie-bios {};
158161

159-
lsp = hsuper.callCabal2nix "lsp" inputs.lsp {};
160-
lsp-types = hsuper.callCabal2nix "lsp-types" inputs.lsp-types {};
162+
lsp = hsuper.callCabal2nix "lsp" "${inputs.lsp}/lsp" {};
163+
lsp-types = hsuper.callCabal2nix "lsp-types" "${inputs.lsp}/lsp-types" {};
161164
lsp-test = hsuper.callCabal2nix "lsp-test" inputs.lsp-test {};
162165

163166
implicit-hie-cradle = hself.callCabal2nix "implicit-hie-cradle" inputs.implicit-hie-cradle {};
@@ -186,6 +189,14 @@
186189
in {
187190
inherit hlsSources;
188191

192+
all-cabal-hashes = prev.runCommand "all-cabal-hashes.tar.gz"
193+
{ }
194+
''
195+
cd ${all-cabal-hashes-unpacked}
196+
cd ..
197+
tar czf $out $(basename ${all-cabal-hashes-unpacked})
198+
'';
199+
189200
# Haskell packages extended with our packages
190201
hlsHpkgs = compiler: extended haskell.packages.${compiler};
191202

@@ -216,7 +227,7 @@
216227

217228
ghc902Config = (import ./configuration-ghc-90.nix) { inherit pkgs inputs; };
218229
ghc924Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; };
219-
ghc941Config = (import ./configuration-ghc-94.nix) { inherit pkgs inputs; };
230+
ghc942Config = (import ./configuration-ghc-94.nix) { inherit pkgs inputs; };
220231

221232
# GHC versions
222233
# While HLS still works fine with 8.10 GHCs, we only support the versions that are cached
@@ -226,13 +237,13 @@
226237
cases = {
227238
ghc902 = ghc902Config.tweakHpkgs (pkgs.hlsHpkgs "ghc902");
228239
ghc924 = ghc924Config.tweakHpkgs (pkgs.hlsHpkgs "ghc924");
229-
ghc941 = ghc941Config.tweakHpkgs (pkgs.hlsHpkgs "ghc941");
240+
ghc942 = ghc942Config.tweakHpkgs (pkgs.hlsHpkgs "ghc942");
230241
};
231242
in { default = cases."${ghcVersion}"; } // cases;
232243

233244
ghc902 = supportedGHCs.ghc902;
234245
ghc924 = supportedGHCs.ghc924;
235-
ghc941 = supportedGHCs.ghc941;
246+
ghc942 = supportedGHCs.ghc942;
236247
ghcDefault = supportedGHCs.default;
237248

238249
# For markdown support
@@ -282,16 +293,16 @@
282293
hpkgs.ghc
283294
pkgs.cabal-install
284295
# @guibou: I'm not sure hie-bios is needed
285-
ghcDefault.hie-bios
296+
pkgs.haskellPackages.hie-bios
286297
# Dependencies needed to build some parts of hackage
287298
gmp zlib ncurses
288299
# Changelog tooling
289-
(gen-hls-changelogs ghcDefault)
300+
(gen-hls-changelogs pkgs.haskellPackages)
290301
# For the documentation
291302
pythonWithPackages
292303
# @guibou: I'm not sure this is needed.
293304
hlint
294-
ghcDefault.opentelemetry-extra
305+
pkgs.haskellPackages.opentelemetry-extra
295306
capstone tracy
296307
# ormolu
297308
# stylish-haskell
@@ -345,7 +356,7 @@
345356
src = null;
346357
};
347358
# Create a hls executable
348-
# Copied from https://github.com/NixOS/nixpkgs/blob/210784b7c8f3d926b7db73bdad085f4dc5d79418/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix#L16
359+
# Copied from https://github.com/NixOS/nixpkgs/blob/210784b7c8f3d926b7db73bdad085f4dc5d79428/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix#L16
349360
mkExe = hpkgs:
350361
with pkgs.haskell.lib;
351362
(enableSharedExecutables (overrideCabal hpkgs.haskell-language-server
@@ -365,22 +376,22 @@
365376
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
366377
haskell-language-server-902-dev = mkDevShell ghc902 "cabal.project";
367378
haskell-language-server-924-dev = mkDevShell ghc924 "cabal.project";
368-
haskell-language-server-941-dev = mkDevShell ghc941 "cabal.project";
379+
haskell-language-server-942-dev = mkDevShell ghc942 "cabal.project";
369380
};
370381

371382
# Developement shell, haskell packages are also provided by nix
372383
nixDevShells = {
373384
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
374385
haskell-language-server-902-dev-nix = mkDevShellWithNixDeps ghc902 "cabal.project";
375386
haskell-language-server-924-dev-nix = mkDevShellWithNixDeps ghc924 "cabal.project";
376-
haskell-language-server-941-dev-nix = mkDevShellWithNixDeps ghc941 "cabal.project";
387+
haskell-language-server-942-dev-nix = mkDevShellWithNixDeps ghc942 "cabal.project";
377388
};
378389

379390
allPackages = {
380391
haskell-language-server = mkExe ghcDefault;
381392
haskell-language-server-902 = mkExe ghc902;
382393
haskell-language-server-924 = mkExe ghc924;
383-
haskell-language-server-941 = mkExe ghc941;
394+
haskell-language-server-942 = mkExe ghc942;
384395
};
385396

386397
devShells = simpleDevShells // nixDevShells // {

0 commit comments

Comments
 (0)