Skip to content

Commit ccce756

Browse files
guiboujneira
andauthored
Move hackage back to flake.nix (#2652)
Apparently `flake-compat` does not work correctly with local flake. Reported by @teto and @smunix in 2621. Co-authored-by: Javier Neira <[email protected]>
1 parent c1bea2d commit ccce756

File tree

4 files changed

+56
-85
lines changed

4 files changed

+56
-85
lines changed

configuration-ghc-921.nix

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# nix version of cabal-ghc901.project
2-
{ pkgs, hackage }:
2+
{ pkgs, inputs }:
33

44
let
55
disabledPlugins = [
@@ -10,12 +10,12 @@ let
1010
hpkgsOverride = hself: hsuper:
1111
with pkgs.haskell.lib;
1212
{
13-
fourmolu = hself.callCabal2nix "fourmolu" hackage.fourmolu {};
13+
fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu {};
1414
primitive-extras = hself.primitive-extras_0_10_1_2;
15-
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" hackage.ghc-exactprint {};
16-
constraints-extras = hself.callCabal2nix "constraints-extras" hackage.constraints-extras {};
17-
retrie = hself.callCabal2nix "retrie" hackage.retrie {};
18-
hlint = doJailbreak (hself.callCabal2nix "hlint" hackage.hlint {});
15+
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint {};
16+
constraints-extras = hself.callCabal2nix "constraints-extras" inputs.constraints-extras {};
17+
retrie = hself.callCabal2nix "retrie" inputs.retrie {};
18+
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint {});
1919

2020
# Re-generate HLS drv excluding some plugins
2121
haskell-language-server =

flake.lock

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

flake.nix

+38-9
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,46 @@
2222
flake = false;
2323
};
2424

25-
hackage-sources.url = "path:./flake_hackage";
25+
# List of hackage dependencies
26+
lsp = {
27+
url = "https://hackage.haskell.org/package/lsp-1.4.0.0/lsp-1.4.0.0.tar.gz";
28+
flake = false;
29+
};
30+
lsp-types = {
31+
url = "https://hackage.haskell.org/package/lsp-types-1.4.0.1/lsp-types-1.4.0.1.tar.gz";
32+
flake = false;
33+
};
34+
lsp-test = {
35+
url = "https://hackage.haskell.org/package/lsp-test-0.14.0.2/lsp-test-0.14.0.2.tar.gz";
36+
flake = false;
37+
};
38+
ghc-exactprint = {
39+
url = "https://hackage.haskell.org/package/ghc-exactprint-1.4.1/ghc-exactprint-1.4.1.tar.gz";
40+
flake = false;
41+
};
42+
constraints-extras = {
43+
url = "https://hackage.haskell.org/package/constraints-extras-0.3.2.1/constraints-extras-0.3.2.1.tar.gz";
44+
flake = false;
45+
};
46+
retrie = {
47+
url = "https://hackage.haskell.org/package/retrie-1.2.0.1/retrie-1.2.0.1.tar.gz";
48+
flake = false;
49+
};
50+
fourmolu = {
51+
url = "https://hackage.haskell.org/package/fourmolu-0.5.0.1/fourmolu-0.5.0.1.tar.gz";
52+
flake = false;
53+
};
54+
hlint = {
55+
url = "https://hackage.haskell.org/package/hlint-3.3.6/hlint-3.3.6.tar.gz";
56+
flake = false;
57+
};
2658
};
2759
outputs =
28-
{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, hackage-sources }:
60+
inputs@{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, ... }:
2961
{
3062
overlay = final: prev:
3163
with prev;
3264
let
33-
hackage = hackage-sources.inputs;
34-
3565
haskellOverrides = hself: hsuper: {
3666
# we override mkDerivation here to apply the following
3767
# tweak to each haskell package:
@@ -79,9 +109,9 @@
79109
# We need an older version
80110
hiedb = hself.hiedb_0_4_1_0;
81111

82-
lsp = hsuper.callCabal2nix "lsp" hackage.lsp {};
83-
lsp-types = hsuper.callCabal2nix "lsp-types" hackage.lsp-types {};
84-
lsp-test = hsuper.callCabal2nix "lsp-test" hackage.lsp-test {};
112+
lsp = hsuper.callCabal2nix "lsp" inputs.lsp {};
113+
lsp-types = hsuper.callCabal2nix "lsp-types" inputs.lsp-types {};
114+
lsp-test = hsuper.callCabal2nix "lsp-test" inputs.lsp-test {};
85115

86116
implicit-hie-cradle = hself.callCabal2nix "implicit-hie-cradle"
87117
(builtins.fetchTarball {
@@ -135,7 +165,6 @@
135165
} // (flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ])
136166
(system:
137167
let
138-
hackage = hackage-sources.inputs;
139168
pkgs = import nixpkgs {
140169
inherit system;
141170
overlays = [ self.overlay ];
@@ -174,7 +203,7 @@
174203
};
175204

176205
ghc901Config = (import ./configuration-ghc-901.nix) { inherit pkgs; };
177-
ghc921Config = (import ./configuration-ghc-921.nix) { inherit pkgs hackage; };
206+
ghc921Config = (import ./configuration-ghc-921.nix) { inherit pkgs inputs; };
178207

179208
# GHC versions
180209
ghcDefault = pkgs.hlsHpkgs ("ghc"

flake_hackage/flake.nix

-44
This file was deleted.

0 commit comments

Comments
 (0)