on iko/ghcjs-patch-master help sign in
Flake (#589 and #567)
a2d97bdHamish Mackenzie
@@ -4,8 +4,9 @@ let haskellNix = rec {
4 };
4 };
5
5
6 config = import ./config.nix;
6 config = import ./config.nix;
7+ overlays = [ allOverlays.combined ];
7− overlays = import ./overlays;
8+ allOverlays = import ./overlays;
8− nixpkgsArgs = { inherit overlays config; };
9+ nixpkgsArgs = { inherit config overlays; };
9 };
10 };
10
11
11 haskellNixV1 = haskellNix.nixpkgsArgs;
12 haskellNixV1 = haskellNix.nixpkgsArgs;
flake.nixnew file+25
@@ -0,0 +1,25 @@
1+{
2+ description = "Alternative Haskell Infrastructure for Nixpkgs";
3+
4+ edition = 201909;
5+
6+ outputs = { self }: {
7+ overlay = self.overlays.combined;
8+ overlays = import ./overlays;
9+ config = import ./config.nix;
10+ sources = import ./nixpkgs;
11+ nixpkgsArgs = {
12+ inherit (self) config;
13+ overlays = [ self.overlay ];
14+ };
15+ legacyPackages = let
16+ genAttrs = lst: f:
17+ builtins.listToAttrs (map (name: {
18+ inherit name;
19+ value = f name;
20+ }) lst);
21+ in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
22+ import self.sources.nixpkgs-default
23+ (self.nixpkgsArgs // { localSystem = { inherit system; }; }));
24+ };
25+}
lib/stack-cache-generator.nix−1
@@ -69,7 +69,6 @@ concatMap (dep:
69 }
69 }
70 else builtins.fetchGit {
70 else builtins.fetchGit {
71 inherit (dep) url rev;
71 inherit (dep) url rev;
72− ref = "*";
73 };
72 };
74 in map (subdir: {
73 in map (subdir: {
75 name = cabalName "${pkgsrc}/${subdir}";
74 name = cabalName "${pkgsrc}/${subdir}";
overlays/armv6l-linux.nix+5−5
@@ -1,7 +1,7 @@
1−self: super:
1+final: prev:
2{
2{
3− haskell-nix = super.haskell-nix // ({
3+ haskell-nix = prev.haskell-nix // ({
4− defaultModules = super.haskell-nix.defaultModules ++ [
4+ defaultModules = prev.haskell-nix.defaultModules ++ [
5 ({ pkgs, buildModules, config, lib, ... }:
5 ({ pkgs, buildModules, config, lib, ... }:
6 let
6 let
7 withTH = import ./linux-cross.nix {
7 withTH = import ./linux-cross.nix {
@@ -15,10 +15,10 @@ self: super:
15 inherit (pkgs) gmp;
15 inherit (pkgs) gmp;
16 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
16 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
17 # build host.
17 # build host.
18− inherit (self.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
18+ inherit (final.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
19 # remote-iserv however needs to come from the regular packages as it has to
19 # remote-iserv however needs to come from the regular packages as it has to
20 # run on the target host.
20 # run on the target host.
21− inherit (self.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
21+ inherit (final.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
22 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
22 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
23 extra-test-libs = [
23 extra-test-libs = [
24 # pkgs.rocksdb
24 # pkgs.rocksdb
overlays/bootstrap.nix+75−75
@@ -1,4 +1,4 @@
1−self: super:
1+final: prev:
2let
2let
3 installDeps = targetPrefix: ''
3 installDeps = targetPrefix: ''
4 for P in $($out/bin/${targetPrefix}ghc-pkg list --simple-output | sed 's/-[0-9][0-9.]*//g'); do
4 for P in $($out/bin/${targetPrefix}ghc-pkg list --simple-output | sed 's/-[0-9][0-9.]*//g'); do
@@ -29,26 +29,26 @@ let
29 done
29 done
30 '';
30 '';
31in {
31in {
32− haskell-nix = super.haskell-nix // {
32+ haskell-nix = prev.haskell-nix // {
33 # Use this to disable the existing haskell infra structure for testing purposes
33 # Use this to disable the existing haskell infra structure for testing purposes
34 compiler =
34 compiler =
35− let bootPkgs = with self.buildPackages; {
35+ let bootPkgs = with final.buildPackages; {
36 ghc = buildPackages.haskell-nix.bootstrap.compiler.ghc844;
36 ghc = buildPackages.haskell-nix.bootstrap.compiler.ghc844;
37− inherit (self.haskell-nix.bootstrap.packages) alex happy hscolour;
37+ inherit (final.haskell-nix.bootstrap.packages) alex happy hscolour;
38 };
38 };
39− sphinx = with self.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
39+ sphinx = with final.buildPackages; (python3Packages.sphinx_1_7_9 or python3Packages.sphinx);
40− hsc2hs-align-conditionals-patch = self.fetchpatch {
40+ hsc2hs-align-conditionals-patch = final.fetchpatch {
41 url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
41 url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
42 sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
42 sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
43 extraPrefix = "utils/hsc2hs/";
43 extraPrefix = "utils/hsc2hs/";
44 stripLen = 1;
44 stripLen = 1;
45 };
45 };
46− D5123-patch = self.fetchpatch rec { # https://phabricator.haskell.org/D5123
46+ D5123-patch = final.fetchpatch rec { # https://phabricator.haskell.org/D5123
47 url = "http://tarballs.nixos.org/sha256/${sha256}";
47 url = "http://tarballs.nixos.org/sha256/${sha256}";
48 name = "D5123.diff";
48 name = "D5123.diff";
49 sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
49 sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n";
50 };
50 };
51− haddock-900-patch = self.fetchpatch rec { # https://github.com/haskell/haddock/issues/900
51+ haddock-900-patch = final.fetchpatch rec { # https://github.com/haskell/haddock/issues/900
52 url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/983.diff";
52 url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/983.diff";
53 name = "loadpluginsinmodules.diff";
53 name = "loadpluginsinmodules.diff";
54 sha256 = "0bvvv0zsfq2581zsir97zfkggc1kkircbbajc2fz3b169ycpbha1";
54 sha256 = "0bvvv0zsfq2581zsir97zfkggc1kkircbbajc2fz3b169ycpbha1";
@@ -60,10 +60,10 @@ in {
60 versionLessThan = ver: builtins.compareVersions ver version == 1;
60 versionLessThan = ver: builtins.compareVersions ver version == 1;
61 # Returns true iff this derivation's verion is greater than or equal to ver.
61 # Returns true iff this derivation's verion is greater than or equal to ver.
62 versionAtLeast = ver: !versionLessThan ver;
62 versionAtLeast = ver: !versionLessThan ver;
63− from = start: self.lib.optional (versionAtLeast start);
63+ from = start: final.lib.optional (versionAtLeast start);
64− fromUntil = start: end: self.lib.optional (versionAtLeast start && versionLessThan end);
64+ fromUntil = start: end: final.lib.optional (versionAtLeast start && versionLessThan end);
65− until = end: self.lib.optional (versionLessThan end);
65+ until = end: final.lib.optional (versionLessThan end);
66− always = self.lib.optional true;
66+ always = final.lib.optional true;
67 # Try to avoid reordering the patches unless a patch is added or changed that
67 # Try to avoid reordering the patches unless a patch is added or changed that
68 # will be applied to most versions of the GHC anyway (reordering the patches
68 # will be applied to most versions of the GHC anyway (reordering the patches
69 # results in rebuilds of GHC and reduces sharing in /nix/store).
69 # results in rebuilds of GHC and reduces sharing in /nix/store).
@@ -101,25 +101,25 @@ in {
101 ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch
101 ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch
102 ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch
102 ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch
103
103
104− ++ self.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch
104+ ++ final.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch
105− ++ self.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch
105+ ++ final.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch
106− ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch
106+ ++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch
107− ++ self.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch
107+ ++ final.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch
108− ++ self.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-atomic-arm-arch.patch
108+ ++ final.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-atomic-arm-arch.patch
109− ++ self.lib.optional (version == "8.8.1") ./patches/ghc/ghc-8.8.1-reinstallable-lib-ghc.patch
109+ ++ final.lib.optional (version == "8.8.1") ./patches/ghc/ghc-8.8.1-reinstallable-lib-ghc.patch
110 ++ fromUntil "8.8.2" "8.9" ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch
110 ++ fromUntil "8.8.2" "8.9" ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch
111− ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch
111+ ++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch
112− ++ self.lib.optional (versionAtLeast "8.6.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-macOS-loadArchive-fix.patch
112+ ++ final.lib.optional (versionAtLeast "8.6.4" && final.stdenv.isDarwin) ./patches/ghc/ghc-macOS-loadArchive-fix.patch
113− ++ self.lib.optional (versionAtLeast "8.4.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-darwin-gcc-version-fix.patch
113+ ++ final.lib.optional (versionAtLeast "8.4.4" && final.stdenv.isDarwin) ./patches/ghc/ghc-darwin-gcc-version-fix.patch
114 ;
114 ;
115 in ({
115 in ({
116− ghc844 = self.callPackage ../compiler/ghc {
116+ ghc844 = final.callPackage ../compiler/ghc {
117− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc844; };
117+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; };
118
118
119 inherit bootPkgs sphinx installDeps;
119 inherit bootPkgs sphinx installDeps;
120
120
121− buildLlvmPackages = self.buildPackages.llvmPackages_5;
121+ buildLlvmPackages = final.buildPackages.llvmPackages_5;
122− llvmPackages = self.llvmPackages_5;
122+ llvmPackages = final.llvmPackages_5;
123
123
124 src-spec = rec {
124 src-spec = rec {
125 version = "8.4.4";
125 version = "8.4.4";
@@ -129,15 +129,15 @@ in {
129
129
130 ghc-patches = ghc-patches "8.4.4"
130 ghc-patches = ghc-patches "8.4.4"
131 ++ [ hsc2hs-align-conditionals-patch D5123-patch ]
131 ++ [ hsc2hs-align-conditionals-patch D5123-patch ]
132− ++ self.lib.optional self.stdenv.isDarwin ./patches/ghc/ghc-8.4.4-backport-dylib-command-size-limit.patch;
132+ ++ final.lib.optional final.stdenv.isDarwin ./patches/ghc/ghc-8.4.4-backport-dylib-command-size-limit.patch;
133 };
133 };
134− ghc861 = self.callPackage ../compiler/ghc {
134+ ghc861 = final.callPackage ../compiler/ghc {
135− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc861; };
135+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc861; };
136
136
137 inherit bootPkgs sphinx installDeps;
137 inherit bootPkgs sphinx installDeps;
138
138
139− buildLlvmPackages = self.buildPackages.llvmPackages_6;
139+ buildLlvmPackages = final.buildPackages.llvmPackages_6;
140− llvmPackages = self.llvmPackages_6;
140+ llvmPackages = final.llvmPackages_6;
141
141
142 src-spec = rec {
142 src-spec = rec {
143 version = "8.6.1";
143 version = "8.6.1";
@@ -147,13 +147,13 @@ in {
147
147
148 ghc-patches = [ D5123-patch ];
148 ghc-patches = [ D5123-patch ];
149 };
149 };
150− ghc862 = self.callPackage ../compiler/ghc {
150+ ghc862 = final.callPackage ../compiler/ghc {
151− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc862; };
151+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc862; };
152
152
153 inherit bootPkgs sphinx installDeps;
153 inherit bootPkgs sphinx installDeps;
154
154
155− buildLlvmPackages = self.buildPackages.llvmPackages_6;
155+ buildLlvmPackages = final.buildPackages.llvmPackages_6;
156− llvmPackages = self.llvmPackages_6;
156+ llvmPackages = final.llvmPackages_6;
157
157
158 src-spec = rec {
158 src-spec = rec {
159 version = "8.6.2";
159 version = "8.6.2";
@@ -164,13 +164,13 @@ in {
164 ghc-patches = ghc-patches "8.6.2"
164 ghc-patches = ghc-patches "8.6.2"
165 ++ [ D5123-patch ];
165 ++ [ D5123-patch ];
166 };
166 };
167− ghc863 = self.callPackage ../compiler/ghc {
167+ ghc863 = final.callPackage ../compiler/ghc {
168− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc863; };
168+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc863; };
169
169
170 inherit bootPkgs sphinx installDeps;
170 inherit bootPkgs sphinx installDeps;
171
171
172− buildLlvmPackages = self.buildPackages.llvmPackages_6;
172+ buildLlvmPackages = final.buildPackages.llvmPackages_6;
173− llvmPackages = self.llvmPackages_6;
173+ llvmPackages = final.llvmPackages_6;
174
174
175 src-spec = rec {
175 src-spec = rec {
176 version = "8.6.3";
176 version = "8.6.3";
@@ -181,13 +181,13 @@ in {
181 ghc-patches = ghc-patches "8.6.3"
181 ghc-patches = ghc-patches "8.6.3"
182 ++ [ D5123-patch ];
182 ++ [ D5123-patch ];
183 };
183 };
184− ghc864 = self.callPackage ../compiler/ghc {
184+ ghc864 = final.callPackage ../compiler/ghc {
185− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc864; };
185+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc864; };
186
186
187 inherit bootPkgs sphinx installDeps;
187 inherit bootPkgs sphinx installDeps;
188
188
189− buildLlvmPackages = self.buildPackages.llvmPackages_6;
189+ buildLlvmPackages = final.buildPackages.llvmPackages_6;
190− llvmPackages = self.llvmPackages_6;
190+ llvmPackages = final.llvmPackages_6;
191
191
192 src-spec = rec {
192 src-spec = rec {
193 version = "8.6.4";
193 version = "8.6.4";
@@ -198,13 +198,13 @@ in {
198 ghc-patches = ghc-patches "8.6.4"
198 ghc-patches = ghc-patches "8.6.4"
199 ++ [ D5123-patch ];
199 ++ [ D5123-patch ];
200 };
200 };
201− ghc865 = self.callPackage ../compiler/ghc {
201+ ghc865 = final.callPackage ../compiler/ghc {
202− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc865; };
202+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; };
203
203
204 inherit bootPkgs sphinx installDeps;
204 inherit bootPkgs sphinx installDeps;
205
205
206− buildLlvmPackages = self.buildPackages.llvmPackages_6;
206+ buildLlvmPackages = final.buildPackages.llvmPackages_6;
207− llvmPackages = self.llvmPackages_6;
207+ llvmPackages = final.llvmPackages_6;
208
208
209 src-spec = rec {
209 src-spec = rec {
210 version = "8.6.5";
210 version = "8.6.5";
@@ -215,13 +215,13 @@ in {
215 ghc-patches = ghc-patches "8.6.5"
215 ghc-patches = ghc-patches "8.6.5"
216 ++ [ D5123-patch haddock-900-patch ];
216 ++ [ D5123-patch haddock-900-patch ];
217 };
217 };
218− ghc881 = self.callPackage ../compiler/ghc {
218+ ghc881 = final.callPackage ../compiler/ghc {
219− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc881; };
219+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc881; };
220
220
221 inherit bootPkgs sphinx installDeps;
221 inherit bootPkgs sphinx installDeps;
222
222
223− buildLlvmPackages = self.buildPackages.llvmPackages_7;
223+ buildLlvmPackages = final.buildPackages.llvmPackages_7;
224− llvmPackages = self.llvmPackages_7;
224+ llvmPackages = final.llvmPackages_7;
225
225
226 src-spec = rec {
226 src-spec = rec {
227 version = "8.8.1";
227 version = "8.8.1";
@@ -231,13 +231,13 @@ in {
231
231
232 ghc-patches = ghc-patches "8.8.1";
232 ghc-patches = ghc-patches "8.8.1";
233 };
233 };
234− ghc882 = self.callPackage ../compiler/ghc {
234+ ghc882 = final.callPackage ../compiler/ghc {
235− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc882; };
235+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc882; };
236
236
237 inherit bootPkgs sphinx installDeps;
237 inherit bootPkgs sphinx installDeps;
238
238
239− buildLlvmPackages = self.buildPackages.llvmPackages_7;
239+ buildLlvmPackages = final.buildPackages.llvmPackages_7;
240− llvmPackages = self.llvmPackages_7;
240+ llvmPackages = final.llvmPackages_7;
241
241
242 src-spec = rec {
242 src-spec = rec {
243 version = "8.8.2";
243 version = "8.8.2";
@@ -247,13 +247,13 @@ in {
247
247
248 ghc-patches = ghc-patches "8.8.2";
248 ghc-patches = ghc-patches "8.8.2";
249 };
249 };
250− ghc883 = self.callPackage ../compiler/ghc {
250+ ghc883 = final.callPackage ../compiler/ghc {
251− extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc883; };
251+ extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc883; };
252
252
253 inherit bootPkgs sphinx installDeps;
253 inherit bootPkgs sphinx installDeps;
254
254
255− buildLlvmPackages = self.buildPackages.llvmPackages_7;
255+ buildLlvmPackages = final.buildPackages.llvmPackages_7;
256− llvmPackages = self.llvmPackages_7;
256+ llvmPackages = final.llvmPackages_7;
257
257
258 src-spec = rec {
258 src-spec = rec {
259 version = "8.8.3";
259 version = "8.8.3";
@@ -263,7 +263,7 @@ in {
263
263
264 ghc-patches = ghc-patches "8.8.3";
264 ghc-patches = ghc-patches "8.8.3";
265 };
265 };
266− } // self.lib.optionalAttrs (self.targetPlatform.isGhcjs or false)
266+ } // final.lib.optionalAttrs (final.targetPlatform.isGhcjs or false)
267 # This will inject `exactDeps` and `envDeps` into the ghcjs
267 # This will inject `exactDeps` and `envDeps` into the ghcjs
268 # compiler defined below. This is crucial to build packages
268 # compiler defined below. This is crucial to build packages
269 # with the current use of env and exact Deps.
269 # with the current use of env and exact Deps.
@@ -272,16 +272,16 @@ in {
272 isHaskellNixBootCompiler = true;
272 isHaskellNixBootCompiler = true;
273 })
273 })
274 ({
274 ({
275− ghc865 = let buildGHC = self.buildPackages.haskell-nix.compiler.ghc865;
275+ ghc865 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc865;
276− in let ghcjs865 = self.callPackage ../compiler/ghcjs/ghcjs.nix {
276+ in let ghcjs865 = final.callPackage ../compiler/ghcjs/ghcjs.nix {
277 ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json;
277 ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json;
278 ghcjsVersion = "8.6.0.1";
278 ghcjsVersion = "8.6.0.1";
279 ghc = buildGHC;
279 ghc = buildGHC;
280− cabal-install = self.buildPackages.haskell-nix.cabal-install;
280+ cabal-install = final.buildPackages.haskell-nix.cabal-install;
281 # The alex from the bootstrap packages is apparently broken, and will fail with something like:
281 # The alex from the bootstrap packages is apparently broken, and will fail with something like:
282 # > alex: /nix/store/f7b78rg9pmqgvxvsqfzh1przp7pxii5a-alex-3.2.4-exe-alex/share/x86_64-osx-ghc-8.4.4/alex-3.2.4-1pf5faR9dBuJ8mryql0DoA-alex/AlexTemplate-ghc-nopred: openFile: does not exist (No such file or directory)
282 # > alex: /nix/store/f7b78rg9pmqgvxvsqfzh1przp7pxii5a-alex-3.2.4-exe-alex/share/x86_64-osx-ghc-8.4.4/alex-3.2.4-1pf5faR9dBuJ8mryql0DoA-alex/AlexTemplate-ghc-nopred: openFile: does not exist (No such file or directory)
283− # inherit (self.buildPackages.haskell-nix.bootstrap.packages) alex happy;
283+ # inherit (final.buildPackages.haskell-nix.bootstrap.packages) alex happy;
284− }; in let targetPrefix = "js-unknown-ghcjs-"; in self.runCommand "${targetPrefix}ghc-8.6.5" {
284+ }; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.6.5" {
285 passthru = {
285 passthru = {
286 inherit targetPrefix;
286 inherit targetPrefix;
287 version = "8.6.5";
287 version = "8.6.5";
@@ -293,7 +293,7 @@ in {
293 "--with-ghcjs=${targetPrefix}ghc" "--with-ghcjs-pkg=${targetPrefix}ghc-pkg"
293 "--with-ghcjs=${targetPrefix}ghc" "--with-ghcjs-pkg=${targetPrefix}ghc-pkg"
294 # setting gcc is stupid. non-emscripten ghcjs has no cc.
294 # setting gcc is stupid. non-emscripten ghcjs has no cc.
295 # however cabal insists on compiling the c sources. m(
295 # however cabal insists on compiling the c sources. m(
296− "--with-gcc=${self.buildPackages.stdenv.cc}/bin/cc"
296+ "--with-gcc=${final.buildPackages.stdenv.cc}/bin/cc"
297 ];
297 ];
298 };
298 };
299 # note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
299 # note: we'll use the buildGHCs `hsc2hs`, ghcjss wrapper just horribly breaks in this nix setup.
@@ -310,8 +310,8 @@ in {
310 '' + installDeps targetPrefix);
310 '' + installDeps targetPrefix);
311 })));
311 })));
312
312
313− ghc = self.haskell-nix.compiler.ghc865;
313+ ghc = final.haskell-nix.compiler.ghc865;
314− inherit (self.buildPackages.haskell-nix.bootstrap.packages) cabal-install alex happy;
314+ inherit (final.buildPackages.haskell-nix.bootstrap.packages) cabal-install alex happy;
315
315
316 # WARN: The `import ../. {}` will prevent
316 # WARN: The `import ../. {}` will prevent
317 # any cross to work, as we will loose
317 # any cross to work, as we will loose
@@ -320,7 +320,7 @@ in {
320 # haskellPackages = with import ../. {}; {
320 # haskellPackages = with import ../. {}; {
321 # hpack = null;
321 # hpack = null;
322 # hello = (hackage-package {
322 # hello = (hackage-package {
323− # inherit (self) cabal-install;
323+ # inherit (final) cabal-install;
324 # name = "hello"; version = "1.0.0.2";
324 # name = "hello"; version = "1.0.0.2";
325 # }).components.exes.hello;
325 # }).components.exes.hello;
326 # };
326 # };
@@ -339,7 +339,7 @@ in {
339
339
340
340
341 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
341 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
342− bootstrap = with self.haskell-nix; let ghc = self.buildPackages.haskell-nix.bootstrap.compiler.ghc844; in {
342+ bootstrap = with final.haskell-nix; let ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc844; in {
343 # XXX: import ../. will throw away all other overlays, config values, ...
343 # XXX: import ../. will throw away all other overlays, config values, ...
344 # this is not ideal!
344 # this is not ideal!
345 # get binary compilers for bootstrapping. We'll put the eventual proper
345 # get binary compilers for bootstrapping. We'll put the eventual proper
@@ -353,14 +353,14 @@ in {
353 isHaskellNixBootCompiler = true;
353 isHaskellNixBootCompiler = true;
354 }
354 }
355 )
355 )
356− (import ../compiler/old-ghc-nix { pkgs = self; });
356+ (import ../compiler/old-ghc-nix { pkgs = final; });
357
357
358 packages = {
358 packages = {
359 # cabal has it's own bootstrap script which we'll use.
359 # cabal has it's own bootstrap script which we'll use.
360 cabal-install = import ../compiler/bootstrap/cabal-install.nix {
360 cabal-install = import ../compiler/bootstrap/cabal-install.nix {
361− inherit (self) fetchurl stdenv zlib;
361+ inherit (final) fetchurl stdenv zlib;
362 inherit hackage ghc;
362 inherit hackage ghc;
363− src = self.fetchurl {
363+ src = final.fetchurl {
364 url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz";
364 url = "https://github.com/haskell/cabal/archive/Cabal-v3.0.0.0-rc3.tar.gz";
365 sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm65lbnx33";
365 sha256 = "1zl2mgg8307ykq3v8nmafc6zdhhj1cw7w8ffpap16dsm65lbnx33";
366 };
366 };
@@ -385,7 +385,7 @@ in {
385 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
385 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
386 inherit (bootstrap.packages) cabal-install nix-tools hpack;
386 inherit (bootstrap.packages) cabal-install nix-tools hpack;
387 name = "alex"; version = "3.2.4";
387 name = "alex"; version = "3.2.4";
388− index-state = self.haskell-nix.internalHackageIndexState;
388+ index-state = final.haskell-nix.internalHackageIndexState;
389 materialized = ../materialized/alex;
389 materialized = ../materialized/alex;
390 };
390 };
391 alex = bootstrap.packages.alex-project.hsPkgs.alex.components.exes.alex;
391 alex = bootstrap.packages.alex-project.hsPkgs.alex.components.exes.alex;
@@ -394,7 +394,7 @@ in {
394 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
394 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
395 inherit (bootstrap.packages) cabal-install nix-tools hpack;
395 inherit (bootstrap.packages) cabal-install nix-tools hpack;
396 name = "happy"; version = "1.19.11";
396 name = "happy"; version = "1.19.11";
397− index-state = self.haskell-nix.internalHackageIndexState;
397+ index-state = final.haskell-nix.internalHackageIndexState;
398 materialized = ../materialized/happy;
398 materialized = ../materialized/happy;
399 };
399 };
400 happy = bootstrap.packages.happy-project.hsPkgs.happy.components.exes.happy;
400 happy = bootstrap.packages.happy-project.hsPkgs.happy.components.exes.happy;
@@ -403,7 +403,7 @@ in {
403 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
403 ghc = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
404 inherit (bootstrap.packages) cabal-install nix-tools hpack;
404 inherit (bootstrap.packages) cabal-install nix-tools hpack;
405 name = "hscolour"; version = "1.24.4";
405 name = "hscolour"; version = "1.24.4";
406− index-state = self.haskell-nix.internalHackageIndexState;
406+ index-state = final.haskell-nix.internalHackageIndexState;
407 materialized = ../materialized/hscolour;
407 materialized = ../materialized/hscolour;
408 };
408 };
409 hscolour = bootstrap.packages.hscolour-project.hsPkgs.hscolour.components.exes.HsColour;
409 hscolour = bootstrap.packages.hscolour-project.hsPkgs.hscolour.components.exes.HsColour;
overlays/darwin.nix+1−1
@@ -1,3 +1,3 @@
1−self: super: {
1+final: prev: {
2
2
3}
3}
overlays/default.nix+42−16
@@ -1,19 +1,45 @@
1−[
1+let
2+ overlays = {
3+ wine = import ./wine.nix;
4+ #ghcjs = import ./ghcjs-asterius-triple.nix;
5+ #python = import ./python.nix;
6+ haskell = import ./haskell.nix;
7+ hackage-quirks = import ./hackage-quirks.nix;
8+ bootstrap = import ./bootstrap.nix;
9+ ghc = import ./ghc.nix;
10+ ghc-packages = import ./ghc-packages.nix;
11+ windows = import ./windows.nix;
12+ armv6l-linux = import ./armv6l-linux.nix;
13+ musl = import ./musl.nix;
14+ tools = import ./tools.nix;
15+ };
16+
17+ composeExtensions = f: g: final: prev:
18+ let
19+ fApplied = f final prev;
20+ prev' = prev // fApplied;
21+ in fApplied // g final prev';
22+
23+ ordered = with overlays; [
2 # Hide nixpkgs haskell and haskellPackages from the haskell-nix overlays.
24 # Hide nixpkgs haskell and haskellPackages from the haskell-nix overlays.
3 # This should prevent us inadvertantly depending on them.
25 # This should prevent us inadvertantly depending on them.
26+ (_: prev: {
27+ haskell = { };
4− (_: super: { haskell = {}; haskellPackages = {}; haskell-nix-super = super; })
28+ haskellPackages = { };
29+ haskell-nix-prev = prev;
30+ })
5− (import ./wine.nix)
31+ wine
6− #(import ./ghcjs-asterius-triple.nix)
7− #(import ./python.nix)
8− (import ./haskell.nix)
32+ haskell
9− (import ./hackage-quirks.nix)
33+ hackage-quirks
10− (import ./bootstrap.nix)
34+ bootstrap
11− (import ./ghc.nix)
35+ ghc
12− (import ./ghc-packages.nix)
36+ ghc-packages
13− (import ./windows.nix)
37+ windows
14− (import ./armv6l-linux.nix)
38+ armv6l-linux
15− (import ./musl.nix)
39+ musl
16− (import ./tools.nix)
40+ tools
17 # Restore nixpkgs haskell and haskellPackages
41 # Restore nixpkgs haskell and haskellPackages
18− (_: super: { inherit (super.haskell-nix-super) haskell haskellPackages; })
42+ (_: prev: { inherit (prev.haskell-nix-prev) haskell haskellPackages; })
19−]
43+ ];
44+ combined = builtins.foldl' composeExtensions (_: _: { }) ordered;
45+in overlays // { inherit combined; }
overlays/ghc-packages.nix+22−22
@@ -1,12 +1,12 @@
1−self: super:
1+final: prev:
2let
2let
3− emptyDotCabal = self.runCommand "empty-dot-cabal" {} ''
3+ emptyDotCabal = final.runCommand "empty-dot-cabal" {} ''
4 mkdir -p $out/.cabal
4 mkdir -p $out/.cabal
5 cat <<EOF > $out/.cabal/config
5 cat <<EOF > $out/.cabal/config
6 EOF
6 EOF
7 '';
7 '';
8− callCabalSdist = name: src: self.runCommand "${name}-sdist.tar.gz" {
8+ callCabalSdist = name: src: final.runCommand "${name}-sdist.tar.gz" {
9− nativeBuildInputs = [ self.haskell-nix.cabal-install ];
9+ nativeBuildInputs = [ final.haskell-nix.cabal-install ];
10 } ''
10 } ''
11 tmp=$(mktemp -d)
11 tmp=$(mktemp -d)
12 cp -r ${src}/* $tmp
12 cp -r ${src}/* $tmp
@@ -15,13 +15,13 @@ let
15 HOME=${emptyDotCabal} cabal new-sdist -o $tmp2
15 HOME=${emptyDotCabal} cabal new-sdist -o $tmp2
16 cp $tmp2/*.tar.gz $out
16 cp $tmp2/*.tar.gz $out
17 '';
17 '';
18− callCabal2Nix = name: src: self.stdenv.mkDerivation {
18+ callCabal2Nix = name: src: final.stdenv.mkDerivation {
19 name = "${name}-package.nix";
19 name = "${name}-package.nix";
20 inherit src;
20 inherit src;
21− nativeBuildInputs = [ self.haskell-nix.nix-tools ];
21+ nativeBuildInputs = [ final.haskell-nix.nix-tools ];
22 phases = [ "unpackPhase" "buildPhase" ];
22 phases = [ "unpackPhase" "buildPhase" ];
23
23
24− LOCALE_ARCHIVE = self.lib.optionalString (self.stdenv.hostPlatform.libc == "glibc") "${self.glibcLocales}/lib/locale/locale-archive";
24+ LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.hostPlatform.libc == "glibc") "${final.glibcLocales}/lib/locale/locale-archive";
25 LANG = "en_US.UTF-8";
25 LANG = "en_US.UTF-8";
26 LC_ALL = "en_US.UTF-8";
26 LC_ALL = "en_US.UTF-8";
27
27
@@ -32,8 +32,8 @@ let
32
32
33 # Combines multiple derivations into one to make them
33 # Combines multiple derivations into one to make them
34 # easier to materialize.
34 # easier to materialize.
35− combineFiles = name: ext: files: self.linkFarm name
35+ combineFiles = name: ext: files: final.linkFarm name
36− (self.lib.mapAttrsToList (name: path: {
36+ (final.lib.mapAttrsToList (name: path: {
37 name = name + ext;
37 name = name + ext;
38 inherit path;
38 inherit path;
39 }) files);
39 }) files);
@@ -57,10 +57,10 @@ let
57 # processed yet by `nix-tools`, so we are not materializing the
57 # processed yet by `nix-tools`, so we are not materializing the
58 # ones that currently fail.
58 # ones that currently fail.
59 # (we need to upgrade `nix-tools` to Cabal 3 for them to work)
59 # (we need to upgrade `nix-tools` to Cabal 3 for them to work)
60− skipBroken = self.lib.filterAttrs (pkgName: _:
60+ skipBroken = final.lib.filterAttrs (pkgName: _:
61 ghcName == "ghc865" || (pkgName != "base" && pkgName != "ghc-heap"));
61 ghcName == "ghc865" || (pkgName != "base" && pkgName != "ghc-heap"));
62 materializedPath = ../materialized/ghc-boot-packages-nix + "/${ghcName}";
62 materializedPath = ../materialized/ghc-boot-packages-nix + "/${ghcName}";
63− in (self.haskell-nix.materialize ({
63+ in (final.haskell-nix.materialize ({
64 materialized = if __pathExists materializedPath
64 materialized = if __pathExists materializedPath
65 then materializedPath
65 then materializedPath
66 else null;
66 else null;
@@ -88,9 +88,9 @@ let
88 # The nix produced by `cabalProject` differs slightly depending on
88 # The nix produced by `cabalProject` differs slightly depending on
89 # what the platforms are. There are currently 3 possible outputs.
89 # what the platforms are. There are currently 3 possible outputs.
90 ghc-extra-projects-type =
90 ghc-extra-projects-type =
91− if self.stdenv.hostPlatform.isWindows
91+ if final.stdenv.hostPlatform.isWindows
92 then "windows"
92 then "windows"
93− else if self.stdenv.buildPlatform != self.stdenv.hostPlatform
93+ else if final.stdenv.buildPlatform != final.stdenv.hostPlatform
94 then "cross"
94 then "cross"
95 else "default";
95 else "default";
96
96
@@ -113,7 +113,7 @@ in rec {
113 ghc-boot-packages-sdist-and-nix = builtins.mapAttrs
113 ghc-boot-packages-sdist-and-nix = builtins.mapAttrs
114 (ghcName: value: builtins.mapAttrs
114 (ghcName: value: builtins.mapAttrs
115 (pkgName: dir: cabalToSdistAndNix ghcName pkgName "${value.passthru.configured-src}/${dir}") ghc-extra-pkgs)
115 (pkgName: dir: cabalToSdistAndNix ghcName pkgName "${value.passthru.configured-src}/${dir}") ghc-extra-pkgs)
116− self.buildPackages.haskell-nix.compiler;
116+ final.buildPackages.haskell-nix.compiler;
117
117
118 # All the ghc boot package nix files for each ghc.
118 # All the ghc boot package nix files for each ghc.
119 ghc-boot-packages-nix = builtins.mapAttrs
119 ghc-boot-packages-nix = builtins.mapAttrs
@@ -134,14 +134,14 @@ in rec {
134 let package-locs =
134 let package-locs =
135 # TODO ghc-heap.cabal requires cabal 3. We should update the cabalProject' call
135 # TODO ghc-heap.cabal requires cabal 3. We should update the cabalProject' call
136 # in `ghc-extra-projects` below to work with this.
136 # in `ghc-extra-projects` below to work with this.
137− (self.lib.filterAttrs (n: _: n != "base" && n != "ghc-heap") ghc-extra-pkgs);
137+ (final.lib.filterAttrs (n: _: n != "base" && n != "ghc-heap") ghc-extra-pkgs);
138− in self.stdenv.mkDerivation {
138+ in final.stdenv.mkDerivation {
139 name = "ghc-extra-pkgs-cabal-project-${name}";
139 name = "ghc-extra-pkgs-cabal-project-${name}";
140 phases = [ "buildPhase" ];
140 phases = [ "buildPhase" ];
141 # Copy each cabal file from the configured ghc source and
141 # Copy each cabal file from the configured ghc source and
142 # add a suitable cabal.project file.
142 # add a suitable cabal.project file.
143 buildPhase = ''
143 buildPhase = ''
144− ${self.lib.concatStrings (self.lib.mapAttrsToList (_: dir: ''
144+ ${final.lib.concatStrings (final.lib.mapAttrsToList (_: dir: ''
145 mkdir -p $out/${dir}
145 mkdir -p $out/${dir}
146 cp ${value.passthru.configured-src}/${dir}/*.cabal $out/${dir}
146 cp ${value.passthru.configured-src}/${dir}/*.cabal $out/${dir}
147 # Remove references to libffi as the are not cross platform
147 # Remove references to libffi as the are not cross platform
@@ -149,7 +149,7 @@ in rec {
149 sed -i 's|/nix/store/.*-libffi.*/include||' $out/${dir}/*.cabal
149 sed -i 's|/nix/store/.*-libffi.*/include||' $out/${dir}/*.cabal
150 '') package-locs)}
150 '') package-locs)}
151 cat >$out/cabal.project <<EOF
151 cat >$out/cabal.project <<EOF
152− packages: ${self.lib.concatStringsSep " " (self.lib.attrValues package-locs)}
152+ packages: ${final.lib.concatStringsSep " " (final.lib.attrValues package-locs)}
153 -- need this for libiserve as it doesn't build against 3.0 yet.
153 -- need this for libiserve as it doesn't build against 3.0 yet.
154 constraints: network < 3.0,
154 constraints: network < 3.0,
155 ghc +ghci,
155 ghc +ghci,
@@ -157,22 +157,22 @@ in rec {
157 libiserv +network
157 libiserv +network
158 EOF
158 EOF
159 '';
159 '';
160− }) self.buildPackages.haskell-nix.compiler;
160+ }) final.buildPackages.haskell-nix.compiler;
161
161
162 # A `cabalProject'` project for each ghc
162 # A `cabalProject'` project for each ghc
163 ghc-extra-projects = builtins.mapAttrs (ghcName: proj:
163 ghc-extra-projects = builtins.mapAttrs (ghcName: proj:
164 # Where to look for materialization files
164 # Where to look for materialization files
165 let materializedPath = ../materialized/ghc-extra-projects
165 let materializedPath = ../materialized/ghc-extra-projects
166 + "/${ghc-extra-projects-type}/${ghcName}";
166 + "/${ghc-extra-projects-type}/${ghcName}";
167− in self.haskell-nix.cabalProject' {
167+ in final.haskell-nix.cabalProject' {
168 name = "ghc-extra-projects-${ghc-extra-projects-type}-${ghcName}";
168 name = "ghc-extra-projects-${ghc-extra-projects-type}-${ghcName}";
169 src = proj;
169 src = proj;
170− index-state = self.haskell-nix.internalHackageIndexState;
170+ index-state = final.haskell-nix.internalHackageIndexState;
171 materialized =
171 materialized =
172 if __pathExists materializedPath
172 if __pathExists materializedPath
173 then materializedPath
173 then materializedPath
174 else null;
174 else null;
175− ghc = self.buildPackages.haskell-nix.compiler.${ghcName};
175+ ghc = final.buildPackages.haskell-nix.compiler.${ghcName};
176 configureArgs = "--disable-tests"; # avoid failures satisfying bytestring package tests dependencies
176 configureArgs = "--disable-tests"; # avoid failures satisfying bytestring package tests dependencies
177 })
177 })
178 ghc-extra-pkgs-cabal-projects;
178 ghc-extra-pkgs-cabal-projects;
overlays/ghc.nix+6−6
@@ -1,13 +1,13 @@
1−self: super: with super;
1+final: prev: with prev;
2 # sadly we need to patch GHC a bit.
2 # sadly we need to patch GHC a bit.
3 let
3 let
4 ghcPkgOverrides = {
4 ghcPkgOverrides = {
5 enableIntegerSimple = false;
5 enableIntegerSimple = false;
6− } // lib.optionalAttrs self.stdenv.hostPlatform.isAarch32 {
6+ } // lib.optionalAttrs final.stdenv.hostPlatform.isAarch32 {
7 enableRelocatableStaticLibs = false;
7 enableRelocatableStaticLibs = false;
8 };
8 };
9 ghcDrvOverrides = drv: {
9 ghcDrvOverrides = drv: {
10− hardeningDisable = (drv.hardeningDisable or []) ++ [ "stackprotector" "format" ] ++ lib.optionals super.stdenv.hostPlatform.isAarch32 [ "pic" "pie" ];
10+ hardeningDisable = (drv.hardeningDisable or []) ++ [ "stackprotector" "format" ] ++ lib.optionals prev.stdenv.hostPlatform.isAarch32 [ "pic" "pie" ];
11 };
11 };
12 in {
12 in {
13 haskell-nix = let
13 haskell-nix = let
@@ -17,7 +17,7 @@ self: super: with super;
17 # we want to apply this only to non-ghcjs ones.
17 # we want to apply this only to non-ghcjs ones.
18 # As we do some ghc <- ghcjs mapping for ghcjs.
18 # As we do some ghc <- ghcjs mapping for ghcjs.
19 needsPatches = name:
19 needsPatches = name:
20− !(super.stdenv.targetPlatform.isGhcjs or false)
20+ !(prev.stdenv.targetPlatform.isGhcjs or false)
21 && lib.hasPrefix "ghc" name
21 && lib.hasPrefix "ghc" name
22 && !lib.hasPrefix "ghc82" name
22 && !lib.hasPrefix "ghc82" name
23 && !lib.hasPrefix "ghcjs" name
23 && !lib.hasPrefix "ghcjs" name
@@ -25,8 +25,8 @@ self: super: with super;
25 overrideCompiler = compiler:
25 overrideCompiler = compiler:
26 (compiler.override ghcPkgOverrides).overrideAttrs ghcDrvOverrides;
26 (compiler.override ghcPkgOverrides).overrideAttrs ghcDrvOverrides;
27 in
27 in
28− lib.recursiveUpdate super.haskell-nix {
28+ lib.recursiveUpdate prev.haskell-nix {
29 compiler = lib.mapAttrs (_name: overrideCompiler)
29 compiler = lib.mapAttrs (_name: overrideCompiler)
30− (lib.filterAttrs (name: _value: needsPatches name) super.haskell-nix.compiler);
30+ (lib.filterAttrs (name: _value: needsPatches name) prev.haskell-nix.compiler);
31 };
31 };
32 }
32 }
overlays/ghcjs-asterius-triple.nix+6−6
@@ -1,6 +1,6 @@
1# This overlay does *not* work as expected.
1# This overlay does *not* work as expected.
2# See https://github.com/NixOS/nixpkgs/issues/65589
2# See https://github.com/NixOS/nixpkgs/issues/65589
3−self: super: super.lib.recursiveUpdate super {
3+final: prev: prev.lib.recursiveUpdate prev {
4 lib.systems.examples = {
4 lib.systems.examples = {
5 # Ghcjs
5 # Ghcjs
6 ghcjs = {
6 ghcjs = {
@@ -17,15 +17,15 @@ self: super: super.lib.recursiveUpdate super {
17 platform = {};
17 platform = {};
18 };
18 };
19 };
19 };
20− # gcc = if self.targetPlatform.isGhcjs then null else super.gcc;
20+ # gcc = if final.targetPlatform.isGhcjs then null else prev.gcc;
21− lib.systems.parse = with self.lib.systems.parse; {
21+ lib.systems.parse = with final.lib.systems.parse; {
22 cpuTypes.js = cpuTypes.wasm32 // { name = "js"; family = "js"; };
22 cpuTypes.js = cpuTypes.wasm32 // { name = "js"; family = "js"; };
23 kernels.ghcjs = kernels.none // { name = "ghcjs"; };
23 kernels.ghcjs = kernels.none // { name = "ghcjs"; };
24 kernels.asterius = kernels.none // { name = "asterius"; };
24 kernels.asterius = kernels.none // { name = "asterius"; };
25− mkSkeletonFromList = l: builtins.trace l (super.lib.systems.parse.mkSkeletonFromList l);
25+ mkSkeletonFromList = l: builtins.trace l (prev.lib.systems.parse.mkSkeletonFromList l);
26− mkSystemFromString = s: builtins.trace s (super.lib.systems.parse.mkSystemFromString s);
26+ mkSystemFromString = s: builtins.trace s (prev.lib.systems.parse.mkSystemFromString s);
27 };
27 };
28− lib.systems.inspect.patterns = with self.lib.systems.parse; {
28+ lib.systems.inspect.patterns = with final.lib.systems.parse; {
29 isJavaScript = { cpu = cpuTypes.js; };
29 isJavaScript = { cpu = cpuTypes.js; };
30 isWasm32 = { cpu = cpuTypes.wasm32; };
30 isWasm32 = { cpu = cpuTypes.wasm32; };
31 isWasm64 = { cpu = cpuTypes.wasm64; };
31 isWasm64 = { cpu = cpuTypes.wasm64; };
overlays/hackage-quirks.nix+6−6
@@ -2,11 +2,11 @@
2# arguments for `haskell-nix.hackage-project` and the functions
2# arguments for `haskell-nix.hackage-project` and the functions
3# that use it (like `hackage-package`)
3# that use it (like `hackage-package`)
4#
4#
5−self: super:
5+final: prev:
6let
6let
7− inherit (self) lib;
7+ inherit (final) lib;
8
8
9−in { haskell-nix = super.haskell-nix // {
9+in { haskell-nix = prev.haskell-nix // {
10
10
11 hackageQuirks = { name, version }: {
11 hackageQuirks = { name, version }: {
12 # FIXME: this is required to build cabal-install 3.2 with ghc 8.6,
12 # FIXME: this is required to build cabal-install 3.2 with ghc 8.6,
@@ -38,16 +38,16 @@ in { haskell-nix = super.haskell-nix // {
38 # Windows characters confuse cross compilation
38 # Windows characters confuse cross compilation
39 # See https://github.com/snoyberg/file-embed/pull/33
39 # See https://github.com/snoyberg/file-embed/pull/33
40 (lib.optionalAttrs (version == "2.9.2.1") {
40 (lib.optionalAttrs (version == "2.9.2.1") {
41− packages.file-embed.src = self.fetchgit {
41+ packages.file-embed.src = final.fetchgit {
42 url = "https://github.com/hamishmack/file-embed.git";
42 url = "https://github.com/hamishmack/file-embed.git";
43 rev = "12b33b8b710517308954c1facff3dc679c2dc5e3";
43 rev = "12b33b8b710517308954c1facff3dc679c2dc5e3";
44 sha256 = "0jcpja4s4cylmg9rddyakb1p1fb4l41ffwmy0njpb1dxc5z3v618";
44 sha256 = "0jcpja4s4cylmg9rddyakb1p1fb4l41ffwmy0njpb1dxc5z3v618";
45 };
45 };
46 })
46 })
47 # Musl needs static zlib
47 # Musl needs static zlib
48− (lib.optionalAttrs self.stdenv.hostPlatform.isMusl {
48+ (lib.optionalAttrs final.stdenv.hostPlatform.isMusl {
49 packages.pandoc.components.exes.pandoc.configureFlags = [
49 packages.pandoc.components.exes.pandoc.configureFlags = [
50− "--ghc-option=-optl=-L${self.zlib.static}/lib"
50+ "--ghc-option=-optl=-L${final.zlib.static}/lib"
51 ];
51 ];
52 })
52 })
53 ];
53 ];
overlays/haskell.nix+94−94
@@ -2,8 +2,8 @@
2#
2#
3# for hygenic reasons we'll use haskell-nix as a prefix.
3# for hygenic reasons we'll use haskell-nix as a prefix.
4# Using haskell.nix in nix is awkward as I needs to be quoted.
4# Using haskell.nix in nix is awkward as I needs to be quoted.
5−self: super: {
5+final: prev: {
6− haskell-nix = with self.haskell-nix; {
6+ haskell-nix = with final.haskell-nix; {
7
7
8 # Default modules, these will always be included.
8 # Default modules, these will always be included.
9 # They are here to be overridden/added to by other
9 # They are here to be overridden/added to by other
@@ -13,7 +13,7 @@ self: super: {
13 # We provide a `callPackage` function to consumers for
13 # We provide a `callPackage` function to consumers for
14 # convenience. We will however refrain from using it
14 # convenience. We will however refrain from using it
15 # here and be explicit about imports and dependencies.
15 # here and be explicit about imports and dependencies.
16− callPackage = super.lib.callPackageWith (self // self.haskell-nix);
16+ callPackage = prev.lib.callPackageWith (final // final.haskell-nix);
17
17
18 # You can provide different pins for hackage.nix and stackage.nix if required.
18 # You can provide different pins for hackage.nix and stackage.nix if required.
19 # It's also possible to override these sources with NIX_PATH.
19 # It's also possible to override these sources with NIX_PATH.
@@ -32,7 +32,7 @@ self: super: {
32 fetchExternal = import ../lib/fetch-external.nix;
32 fetchExternal = import ../lib/fetch-external.nix;
33
33
34 # Functions for cleaning Haskell source directories.
34 # Functions for cleaning Haskell source directories.
35− inherit (import ../lib/clean-source-haskell.nix { inherit (self) lib; })
35+ inherit (import ../lib/clean-source-haskell.nix { inherit (final) lib; })
36 haskellSourceFilter
36 haskellSourceFilter
37 cleanSourceHaskell;
37 cleanSourceHaskell;
38
38
@@ -59,8 +59,8 @@ self: super: {
59
59
60 # Utility functions for working with the component builder.
60 # Utility functions for working with the component builder.
61 haskellLib = let hl = import ../lib {
61 haskellLib = let hl = import ../lib {
62− inherit (self) stdenv lib runCommand recurseIntoAttrs srcOnly;
62+ inherit (final) stdenv lib runCommand recurseIntoAttrs srcOnly;
63− inherit (self.buildPackages) git;
63+ inherit (final.buildPackages) git;
64 haskellLib = hl;
64 haskellLib = hl;
65 }; in hl;
65 }; in hl;
66
66
@@ -80,7 +80,7 @@ self: super: {
80 import ../package-set.nix {
80 import ../package-set.nix {
81 inherit (args) pkg-def pkg-def-extras;
81 inherit (args) pkg-def pkg-def-extras;
82 modules = defaultModules ++ modules;
82 modules = defaultModules ++ modules;
83− pkgs = self;
83+ pkgs = final;
84 hackage = hackageAll;
84 hackage = hackageAll;
85 };
85 };
86
86
@@ -89,10 +89,10 @@ self: super: {
89 # info. Instead we can add ghc-boot-packages to `pkg-def-extras`.
89 # info. Instead we can add ghc-boot-packages to `pkg-def-extras`.
90 excludeBootPackages = pkg-def: hackage:
90 excludeBootPackages = pkg-def: hackage:
91 let original = pkg-def hackage;
91 let original = pkg-def hackage;
92− bootPkgNames = self.lib.attrNames
92+ bootPkgNames = final.lib.attrNames
93− self.ghc-boot-packages.${(pkg-def hackage).compiler.nix-name};
93+ final.ghc-boot-packages.${(pkg-def hackage).compiler.nix-name};
94 in original // {
94 in original // {
95− packages = self.lib.filterAttrs (n: _: self.lib.all (b: n != b) bootPkgNames)
95+ packages = final.lib.filterAttrs (n: _: final.lib.all (b: n != b) bootPkgNames)
96 original.packages;
96 original.packages;
97 };
97 };
98
98
@@ -119,7 +119,7 @@ self: super: {
119 in mkPkgSet {
119 in mkPkgSet {
120 pkg-def = excludeBootPackages pkg-def;
120 pkg-def = excludeBootPackages pkg-def;
121 pkg-def-extras = [ stack-pkgs.extras
121 pkg-def-extras = [ stack-pkgs.extras
122− self.ghc-boot-packages.${compiler.nix-name}
122+ final.ghc-boot-packages.${compiler.nix-name}
123 ]
123 ]
124 ++ pkg-def-extras;
124 ++ pkg-def-extras;
125 # set doExactConfig = true. The stackage set should be consistent
125 # set doExactConfig = true. The stackage set should be consistent
@@ -145,7 +145,7 @@ self: super: {
145 in mkPkgSet {
145 in mkPkgSet {
146 inherit pkg-def;
146 inherit pkg-def;
147 pkg-def-extras = [ plan-pkgs.extras
147 pkg-def-extras = [ plan-pkgs.extras
148− self.ghc-boot-packages.${compiler.nix-name}
148+ final.ghc-boot-packages.${compiler.nix-name}
149 ]
149 ]
150 ++ pkg-def-extras;
150 ++ pkg-def-extras;
151 # set doExactConfig = true, as we trust cabals resolution for
151 # set doExactConfig = true, as we trust cabals resolution for
@@ -157,7 +157,7 @@ self: super: {
157 };
157 };
158
158
159 # Package sets for all stackage snapshots.
159 # Package sets for all stackage snapshots.
160− snapshots = import ../snapshots.nix { inherit (self) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
160+ snapshots = import ../snapshots.nix { inherit (final) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
161 # Pick a recent LTS snapshot to be our "default" package set.
161 # Pick a recent LTS snapshot to be our "default" package set.
162 haskellPackages = snapshots."lts-14.13";
162 haskellPackages = snapshots."lts-14.13";
163
163
@@ -165,26 +165,26 @@ self: super: {
165 # files. This version of nix-tools may be cross compiled.
165 # files. This version of nix-tools may be cross compiled.
166 # We probably never want to actually cross compile nix-tools on
166 # We probably never want to actually cross compile nix-tools on
167 # it's own.
167 # it's own.
168− nix-tools-cross-compiled = self.lib.makeOverridable (import ../nix-tools) {
168+ nix-tools-cross-compiled = final.lib.makeOverridable (import ../nix-tools) {
169− inherit (self) pkgs lib symlinkJoin makeWrapper
169+ inherit (final) pkgs lib symlinkJoin makeWrapper
170 git nix nix-prefetch-git;
170 git nix nix-prefetch-git;
171− inherit (self.haskell-nix) fetchExternal cleanSourceHaskell mkCabalProjectPkgSet;
171+ inherit (final.haskell-nix) fetchExternal cleanSourceHaskell mkCabalProjectPkgSet;
172 hpack = null; # nix-tools does not use hpack project files
172 hpack = null; # nix-tools does not use hpack project files
173 };
173 };
174 # While `nix-tools-cross-compiled` may be cross compiled,
174 # While `nix-tools-cross-compiled` may be cross compiled,
175 # getting it from `buildPackages` we should get
175 # getting it from `buildPackages` we should get
176 # nix-tools suitable for running on the build system.
176 # nix-tools suitable for running on the build system.
177− nix-tools = self.buildPackages.haskell-nix.nix-tools-cross-compiled;
177+ nix-tools = final.buildPackages.haskell-nix.nix-tools-cross-compiled;
178 # TODO perhaps there is a cleaner way to get a suitable nix-tools.
178 # TODO perhaps there is a cleaner way to get a suitable nix-tools.
179
179
180 # Produce a fixed output derivation from a moving target (hackage index tarball)
180 # Produce a fixed output derivation from a moving target (hackage index tarball)
181 # Takes desired index-state and sha256 and produces a set { name, index }, where
181 # Takes desired index-state and sha256 and produces a set { name, index }, where
182 # index points to "01-index.tar.gz" file downloaded from hackage.haskell.org.
182 # index points to "01-index.tar.gz" file downloaded from hackage.haskell.org.
183− hackageTarball = { index-state, sha256, nix-tools ? self.haskell-nix.nix-tools, ... }:
183+ hackageTarball = { index-state, sha256, nix-tools ? final.haskell-nix.nix-tools, ... }:
184 assert sha256 != null;
184 assert sha256 != null;
185 let at = builtins.replaceStrings [":"] [""] index-state; in
185 let at = builtins.replaceStrings [":"] [""] index-state; in
186 { name = "hackage.haskell.org-at-${at}";
186 { name = "hackage.haskell.org-at-${at}";
187− index = self.fetchurl {
187+ index = final.fetchurl {
188 name = "01-index.tar.gz-at-${at}";
188 name = "01-index.tar.gz-at-${at}";
189 url = "https://hackage.haskell.org/01-index.tar.gz";
189 url = "https://hackage.haskell.org/01-index.tar.gz";
190 downloadToTemp = true;
190 downloadToTemp = true;
@@ -196,20 +196,20 @@ self: super: {
196 };
196 };
197
197
198 # Creates Cabal local repository from { name, index } set.
198 # Creates Cabal local repository from { name, index } set.
199− mkLocalHackageRepo = import ../mk-local-hackage-repo self;
199+ mkLocalHackageRepo = import ../mk-local-hackage-repo final;
200
200
201 dotCabal = { index-state, sha256, cabal-install, extra-hackage-tarballs ? [], ... }@args:
201 dotCabal = { index-state, sha256, cabal-install, extra-hackage-tarballs ? [], ... }@args:
202 let
202 let
203 allTarballs = [ (hackageTarball args) ] ++ extra-hackage-tarballs;
203 allTarballs = [ (hackageTarball args) ] ++ extra-hackage-tarballs;
204− allNames = self.lib.concatMapStringsSep "-" (tarball: tarball.name) allTarballs;
204+ allNames = final.lib.concatMapStringsSep "-" (tarball: tarball.name) allTarballs;
205 # Main Hackage index-state is embedded in its name and thus will propagate to
205 # Main Hackage index-state is embedded in its name and thus will propagate to
206 # dotCabalName anyway.
206 # dotCabalName anyway.
207 dotCabalName = "dot-cabal-" + allNames;
207 dotCabalName = "dot-cabal-" + allNames;
208 in
208 in
209− self.runCommand dotCabalName { nativeBuildInputs = [ cabal-install ]; } ''
209+ final.runCommand dotCabalName { nativeBuildInputs = [ cabal-install ]; } ''
210 mkdir -p $out/.cabal
210 mkdir -p $out/.cabal
211 cat <<EOF > $out/.cabal/config
211 cat <<EOF > $out/.cabal/config
212− ${self.lib.concatStrings (
212+ ${final.lib.concatStrings (
213 map (tarball:
213 map (tarball:
214 ''
214 ''
215 repository ${tarball.name}
215 repository ${tarball.name}
@@ -224,11 +224,11 @@ self: super: {
224
224
225 # All repositories must be mkdir'ed before calling new-update on any repo,
225 # All repositories must be mkdir'ed before calling new-update on any repo,
226 # otherwise it fails.
226 # otherwise it fails.
227− ${self.lib.concatStrings (map ({ name, ... }: ''
227+ ${final.lib.concatStrings (map ({ name, ... }: ''
228 mkdir -p $out/.cabal/packages/${name}
228 mkdir -p $out/.cabal/packages/${name}
229 '') allTarballs)}
229 '') allTarballs)}
230
230
231− ${self.lib.concatStrings (map ({ name, ... }: ''
231+ ${final.lib.concatStrings (map ({ name, ... }: ''
232 HOME=$out cabal new-update ${name}
232 HOME=$out cabal new-update ${name}
233 '') allTarballs)}
233 '') allTarballs)}
234 '';
234 '';
@@ -245,31 +245,31 @@ self: super: {
245
245
246 # Helps materialize the output of derivations
246 # Helps materialize the output of derivations
247 materialize = import ../lib/materialize.nix {
247 materialize = import ../lib/materialize.nix {
248− inherit (self.buildPackages) nix;
248+ inherit (final.buildPackages) nix;
249− inherit (self.haskell-nix) checkMaterialization;
249+ inherit (final.haskell-nix) checkMaterialization;
250− pkgs = self.buildPackages.pkgs;
250+ pkgs = final.buildPackages.pkgs;
251− inherit (self.buildPackages.pkgs) runCommand;
251+ inherit (final.buildPackages.pkgs) runCommand;
252 };
252 };
253
253
254 update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
254 update-index-state-hashes = import ../scripts/update-index-state-hashes.nix {
255− inherit (self.haskell-nix) indexStateHashesPath nix-tools;
255+ inherit (final.haskell-nix) indexStateHashesPath nix-tools;
256− inherit (self) coreutils nix writeShellScriptBin stdenv curl;
256+ inherit (final) coreutils nix writeShellScriptBin stdenv curl;
257 };
257 };
258
258
259 # Function to call stackToNix
259 # Function to call stackToNix
260 callStackToNix = import ../lib/call-stack-to-nix.nix {
260 callStackToNix = import ../lib/call-stack-to-nix.nix {
261− pkgs = self.buildPackages.pkgs;
261+ pkgs = final.buildPackages.pkgs;
262− inherit (self.buildPackages.pkgs) runCommand;
262+ inherit (final.buildPackages.pkgs) runCommand;
263− inherit (self.buildPackages.haskell-nix) nix-tools mkCacheFile materialize;
263+ inherit (final.buildPackages.haskell-nix) nix-tools mkCacheFile materialize;
264 };
264 };
265
265
266 # given a source location call `cabal-to-nix` (from nix-tools) on it
266 # given a source location call `cabal-to-nix` (from nix-tools) on it
267 # to produce the nix representation of it.
267 # to produce the nix representation of it.
268 callCabalToNix = { name, src, cabal-file ? "${name}.cabal" }:
268 callCabalToNix = { name, src, cabal-file ? "${name}.cabal" }:
269− self.buildPackages.pkgs.runCommand "${name}.nix" {
269+ final.buildPackages.pkgs.runCommand "${name}.nix" {
270− nativeBuildInputs = [ self.buildPackages.haskell-nix.nix-tools ];
270+ nativeBuildInputs = [ final.buildPackages.haskell-nix.nix-tools ];
271
271
272− LOCALE_ARCHIVE = self.lib.optionalString (self.stdenv.buildPlatform.libc == "glibc") "${self.buildPackages.glibcLocales}/lib/locale/locale-archive";
272+ LOCALE_ARCHIVE = final.lib.optionalString (final.stdenv.buildPlatform.libc == "glibc") "${final.buildPackages.glibcLocales}/lib/locale/locale-archive";
273 LANG = "en_US.UTF-8";
273 LANG = "en_US.UTF-8";
274 LC_ALL = "en_US.UTF-8";
274 LC_ALL = "en_US.UTF-8";
275 } ''
275 } ''
@@ -297,7 +297,7 @@ self: super: {
297 assert isNull sha256;
297 assert isNull sha256;
298 builtins.fetchGit
298 builtins.fetchGit
299 ({ inherit url rev; } //
299 ({ inherit url rev; } //
300− self.buildPackages.lib.optionalAttrs (ref != null) { inherit ref; }
300+ final.buildPackages.lib.optionalAttrs (ref != null) { inherit ref; }
301 )
301 )
302 else
302 else
303 # Non-private repos must have sha256 set.
303 # Non-private repos must have sha256 set.
@@ -305,7 +305,7 @@ self: super: {
305 # pkgs.fetchgit doesn't have any way of fetching from a given
305 # pkgs.fetchgit doesn't have any way of fetching from a given
306 # ref.
306 # ref.
307 assert isNull ref;
307 assert isNull ref;
308− self.buildPackages.pkgs.fetchgit {
308+ final.buildPackages.pkgs.fetchgit {
309 url = url;
309 url = url;
310 rev = rev;
310 rev = rev;
311 sha256 = sha256;
311 sha256 = sha256;
@@ -318,20 +318,20 @@ self: super: {
318 nix-expr =
318 nix-expr =
319 if type == "cabal"
319 if type == "cabal"
320 then
320 then
321− self.buildPackages.haskell-nix.callCabalToNix {
321+ final.buildPackages.haskell-nix.callCabalToNix {
322 src = repoWithSubdir;
322 src = repoWithSubdir;
323 inherit name cabal-file;
323 inherit name cabal-file;
324 }
324 }
325 else if type == "stack"
325 else if type == "stack"
326 then
326 then
327− (self.buildPackages.haskell-nix.callStackToNix {
327+ (final.buildPackages.haskell-nix.callStackToNix {
328 src = repoWithSubdir;
328 src = repoWithSubdir;
329 inherit name subdir;
329 inherit name subdir;
330 }).projectNix
330 }).projectNix
331 else
331 else
332 throw "Unknown type '${type}` for a cache entry";
332 throw "Unknown type '${type}` for a cache entry";
333
333
334− sha256String = if isNull sha256 then self.buildPackages.lib.fakeSha256 else sha256;
334+ sha256String = if isNull sha256 then final.buildPackages.lib.fakeSha256 else sha256;
335
335
336 in {
336 in {
337 line = "${url} ${rev} ${subdir} ${sha256String} ${name}";
337 line = "${url} ${rev} ${subdir} ${sha256String} ${name}";
@@ -347,24 +347,24 @@ self: super: {
347 # the results of `stack-to-nix` can be imported in restrected eval
347 # the results of `stack-to-nix` can be imported in restrected eval
348 # mode.
348 # mode.
349 mkCacheFile = repos:
349 mkCacheFile = repos:
350− self.buildPackages.pkgs.runCommand "cache-file" {} ''
350+ final.buildPackages.pkgs.runCommand "cache-file" {} ''
351 mkdir -p $out
351 mkdir -p $out
352 touch $out/.stack-to-nix.cache
352 touch $out/.stack-to-nix.cache
353− ${self.lib.concatStrings (
353+ ${final.lib.concatStrings (
354− self.lib.lists.zipListsWith (n: repo:
354+ final.lib.lists.zipListsWith (n: repo:
355 let l = mkCacheLine repo;
355 let l = mkCacheLine repo;
356 in ''
356 in ''
357 cp ${l.nix-expr} $out/.stack-to-nix.cache.${toString n}
357 cp ${l.nix-expr} $out/.stack-to-nix.cache.${toString n}
358 echo ${l.line} .stack-to-nix.cache.${toString n} >> $out/.stack-to-nix.cache
358 echo ${l.line} .stack-to-nix.cache.${toString n} >> $out/.stack-to-nix.cache
359 '')
359 '')
360− (self.lib.lists.range 0 ((builtins.length repos) - 1))
360+ (final.lib.lists.range 0 ((builtins.length repos) - 1))
361 repos)
361 repos)
362 }
362 }
363 '';
363 '';
364
364
365 genStackCache = import ../lib/stack-cache-generator.nix {
365 genStackCache = import ../lib/stack-cache-generator.nix {
366− inherit (self.buildPackages) pkgs;
366+ inherit (final.buildPackages) pkgs;
367− inherit (self.buildPackages.haskell-nix) haskellLib nix-tools;
367+ inherit (final.buildPackages.haskell-nix) haskellLib nix-tools;
368 };
368 };
369
369
370 mkCacheModule = cache:
370 mkCacheModule = cache:
@@ -391,11 +391,11 @@ self: super: {
391 then
391 then
392 builtins.fetchGit
392 builtins.fetchGit
393 ({ inherit url rev; } //
393 ({ inherit url rev; } //
394− self.buildPackages.lib.optionalAttrs (ref != null) { inherit ref; }
394+ final.buildPackages.lib.optionalAttrs (ref != null) { inherit ref; }
395 )
395 )
396 else
396 else
397− self.buildPackages.pkgs.fetchgit { inherit url rev sha256; };
397+ final.buildPackages.pkgs.fetchgit { inherit url rev sha256; };
398− } // self.buildPackages.lib.optionalAttrs (subdir != null) { postUnpack = "sourceRoot+=/${subdir}; echo source root reset to $sourceRoot"; };
398+ } // final.buildPackages.lib.optionalAttrs (subdir != null) { postUnpack = "sourceRoot+=/${subdir}; echo source root reset to $sourceRoot"; };
399 };
399 };
400
400
401 cacheMap = builtins.map repoToAttr cache;
401 cacheMap = builtins.map repoToAttr cache;
@@ -408,23 +408,23 @@ self: super: {
408 # Resulting nix files are added to nix-plan subdirectory.
408 # Resulting nix files are added to nix-plan subdirectory.
409 callCabalProjectToNix = import ../lib/call-cabal-project-to-nix.nix {
409 callCabalProjectToNix = import ../lib/call-cabal-project-to-nix.nix {
410 index-state-hashes = import indexStateHashesPath;
410 index-state-hashes = import indexStateHashesPath;
411− inherit (self.buildPackages.haskell-nix) dotCabal nix-tools haskellLib materialize;
411+ inherit (final.buildPackages.haskell-nix) dotCabal nix-tools haskellLib materialize;
412− pkgs = self.buildPackages.pkgs;
412+ pkgs = final.buildPackages.pkgs;
413− inherit (self.buildPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
413+ inherit (final.buildPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
414− inherit (self.buildPackages.haskell-nix) cabal-install ghc;
414+ inherit (final.buildPackages.haskell-nix) cabal-install ghc;
415− inherit (self.buildPackages.pkgs) runCommand symlinkJoin cacert;
415+ inherit (final.buildPackages.pkgs) runCommand symlinkJoin cacert;
416 };
416 };
417
417
418 # Loads a plan and filters the package directories using cleanSourceWith
418 # Loads a plan and filters the package directories using cleanSourceWith
419 importAndFilterProject = import ../lib/import-and-filter-project.nix {
419 importAndFilterProject = import ../lib/import-and-filter-project.nix {
420− inherit (self.buildPackages.haskell-nix) haskellLib;
420+ inherit (final.buildPackages.haskell-nix) haskellLib;
421− pkgs = self.buildPackages.pkgs;
421+ pkgs = final.buildPackages.pkgs;
422 };
422 };
423
423
424 # References to the unpacked sources, for caching in a Hydra jobset.
424 # References to the unpacked sources, for caching in a Hydra jobset.
425 source-pins = import ../lib/make-source-pins.nix {
425 source-pins = import ../lib/make-source-pins.nix {
426− inherit (self) lib writeTextFile;
426+ inherit (final) lib writeTextFile;
427− sources = [ hackageSrc stackageSrc self.path ];
427+ sources = [ hackageSrc stackageSrc final.path ];
428 };
428 };
429
429
430 # -- IFDs --
430 # -- IFDs --
@@ -440,17 +440,17 @@ self: super: {
440 { name
440 { name
441 , version
441 , version
442 , ... }@args:
442 , ... }@args:
443− let tarball = self.pkgs.fetchurl {
443+ let tarball = final.pkgs.fetchurl {
444 url = "mirror://hackage/${name}-${version}.tar.gz";
444 url = "mirror://hackage/${name}-${version}.tar.gz";
445 inherit (hackage.${name}.${version}) sha256; };
445 inherit (hackage.${name}.${version}) sha256; };
446− in let src = self.buildPackages.pkgs.runCommand "${name}-${version}-src" { } ''
446+ in let src = final.buildPackages.pkgs.runCommand "${name}-${version}-src" { } ''
447 tmp=$(mktemp -d)
447 tmp=$(mktemp -d)
448 cd $tmp
448 cd $tmp
449 tar xzf ${tarball}
449 tar xzf ${tarball}
450 mv "${name}-${version}" $out
450 mv "${name}-${version}" $out
451 '';
451 '';
452 in cabalProject' (
452 in cabalProject' (
453− (self.haskell-nix.hackageQuirks { inherit name version; }) //
453+ (final.haskell-nix.hackageQuirks { inherit name version; }) //
454 builtins.removeAttrs args [ "version" ] // { inherit src; });
454 builtins.removeAttrs args [ "version" ] // { inherit src; });
455
455
456 # This function is like `cabalProject` but it makes the plan-nix available
456 # This function is like `cabalProject` but it makes the plan-nix available
@@ -463,7 +463,7 @@ self: super: {
463 { plan-pkgs = plan.pkgs;
463 { plan-pkgs = plan.pkgs;
464 pkg-def-extras = args.pkg-def-extras or [];
464 pkg-def-extras = args.pkg-def-extras or [];
465 modules = (args.modules or [])
465 modules = (args.modules or [])
466− ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; };
466+ ++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; };
467 extra-hackages = args.extra-hackages or [];
467 extra-hackages = args.extra-hackages or [];
468 };
468 };
469 in { inherit (pkg-set.config) hsPkgs; inherit pkg-set; plan-nix = plan.nix; };
469 in { inherit (pkg-set.config) hsPkgs; inherit pkg-set; plan-nix = plan.nix; };
@@ -487,9 +487,9 @@ self: super: {
487 in let pkg-set = mkStackPkgSet
487 in let pkg-set = mkStackPkgSet
488 { stack-pkgs = stack.pkgs;
488 { stack-pkgs = stack.pkgs;
489 pkg-def-extras = (args.pkg-def-extras or []);
489 pkg-def-extras = (args.pkg-def-extras or []);
490− modules = self.lib.singleton (mkCacheModule cache)
490+ modules = final.lib.singleton (mkCacheModule cache)
491 ++ (args.modules or [])
491 ++ (args.modules or [])
492− ++ self.lib.optional (args ? ghc) { ghc.package = args.ghc; };
492+ ++ final.lib.optional (args ? ghc) { ghc.package = args.ghc; };
493 };
493 };
494 in { inherit (pkg-set.config) hsPkgs; inherit pkg-set; stack-nix = stack.nix; };
494 in { inherit (pkg-set.config) hsPkgs; inherit pkg-set; stack-nix = stack.nix; };
495
495
@@ -504,7 +504,7 @@ self: super: {
504 # Like `cabalProject'`, but for building the GHCJS compiler.
504 # Like `cabalProject'`, but for building the GHCJS compiler.
505 # This is exposed to allow GHCJS developers to work on the GHCJS
505 # This is exposed to allow GHCJS developers to work on the GHCJS
506 # code in a nix-shell with `shellFor`.
506 # code in a nix-shell with `shellFor`.
507− ghcjsProject = import ../lib/ghcjs-project.nix { pkgs = self; };
507+ ghcjsProject = import ../lib/ghcjs-project.nix { pkgs = final; };
508
508
509 # The functions that return a plan-nix often have a lot of dependencies
509 # The functions that return a plan-nix often have a lot of dependencies
510 # that could be GCed and also will not make it into hydra cache.
510 # that could be GCed and also will not make it into hydra cache.
@@ -513,47 +513,47 @@ self: super: {
513 # project = cabalProject' {...};
513 # project = cabalProject' {...};
514 # In your tests module add something that is effectively
514 # In your tests module add something that is effectively
515 # testProjectPlan = withInputs project.plan-nix;
515 # testProjectPlan = withInputs project.plan-nix;
516− withInputs = self.recurseIntoAttrs;
516+ withInputs = final.recurseIntoAttrs;
517
517
518 # Add this to your tests to make all the dependencies of haskell.nix
518 # Add this to your tests to make all the dependencies of haskell.nix
519 # are tested and cached.
519 # are tested and cached.
520− haskellNixRoots = self.recurseIntoAttrs {
520+ haskellNixRoots = final.recurseIntoAttrs {
521 Level0 = haskellNixRoots' 0;
521 Level0 = haskellNixRoots' 0;
522 Level1 = haskellNixRoots' 1;
522 Level1 = haskellNixRoots' 1;
523 };
523 };
524
524
525 haskellNixRoots' = ifdLevel:
525 haskellNixRoots' = ifdLevel:
526− let filterSupportedGhc = self.lib.filterAttrs (n: _: n == "ghc865" || n == "ghc883");
526+ let filterSupportedGhc = final.lib.filterAttrs (n: _: n == "ghc865" || n == "ghc883");
527− in self.recurseIntoAttrs ({
527+ in final.recurseIntoAttrs ({
528 # Things that require no IFD to build
528 # Things that require no IFD to build
529− inherit (self.buildPackages.haskell-nix) nix-tools source-pins;
529+ inherit (final.buildPackages.haskell-nix) nix-tools source-pins;
530− bootstap-nix-tools = self.buildPackages.haskell-nix.bootstrap.packages.nix-tools;
530+ bootstap-nix-tools = final.buildPackages.haskell-nix.bootstrap.packages.nix-tools;
531− alex-plan-nix = withInputs self.buildPackages.haskell-nix.bootstrap.packages.alex-project.plan-nix;
531+ alex-plan-nix = withInputs final.buildPackages.haskell-nix.bootstrap.packages.alex-project.plan-nix;
532− happy-plan-nix = withInputs self.buildPackages.haskell-nix.bootstrap.packages.happy-project.plan-nix;
532+ happy-plan-nix = withInputs final.buildPackages.haskell-nix.bootstrap.packages.happy-project.plan-nix;
533− hscolour-plan-nix = withInputs self.buildPackages.haskell-nix.bootstrap.packages.hscolour-project.plan-nix;
533+ hscolour-plan-nix = withInputs final.buildPackages.haskell-nix.bootstrap.packages.hscolour-project.plan-nix;
534− } // self.lib.optionalAttrs (ifdLevel > 0) {
534+ } // final.lib.optionalAttrs (ifdLevel > 0) {
535 # Things that require one IFD to build (the inputs should be in level 0)
535 # Things that require one IFD to build (the inputs should be in level 0)
536− alex = self.buildPackages.haskell-nix.bootstrap.packages.alex;
536+ alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
537− happy = self.buildPackages.haskell-nix.bootstrap.packages.happy;
537+ happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
538− hscolour = self.buildPackages.haskell-nix.bootstrap.packages.hscolour;
538+ hscolour = final.buildPackages.haskell-nix.bootstrap.packages.hscolour;
539− ghc865 = self.buildPackages.haskell-nix.compiler.ghc865;
539+ ghc865 = final.buildPackages.haskell-nix.compiler.ghc865;
540− ghc883 = self.buildPackages.haskell-nix.compiler.ghc883;
540+ ghc883 = final.buildPackages.haskell-nix.compiler.ghc883;
541− ghc-boot-packages-nix = self.recurseIntoAttrs
541+ ghc-boot-packages-nix = final.recurseIntoAttrs
542− (builtins.mapAttrs (_: self.recurseIntoAttrs)
542+ (builtins.mapAttrs (_: final.recurseIntoAttrs)
543− (filterSupportedGhc self.ghc-boot-packages-nix));
543+ (filterSupportedGhc final.ghc-boot-packages-nix));
544− ghc-extra-projects = self.recurseIntoAttrs (builtins.mapAttrs (_: proj: withInputs proj.plan-nix)
544+ ghc-extra-projects = final.recurseIntoAttrs (builtins.mapAttrs (_: proj: withInputs proj.plan-nix)
545− (filterSupportedGhc self.ghc-extra-projects));
545+ (filterSupportedGhc final.ghc-extra-projects));
546− } // self.lib.optionalAttrs (ifdLevel > 1) {
546+ } // final.lib.optionalAttrs (ifdLevel > 1) {
547 # Things that require two levels of IFD to build (inputs should be in level 1)
547 # Things that require two levels of IFD to build (inputs should be in level 1)
548− inherit (self.haskell-nix) nix-tools;
548+ inherit (final.haskell-nix) nix-tools;
549 # These seem to be the only things we use from `ghc-extra-packages`
549 # These seem to be the only things we use from `ghc-extra-packages`
550− # in haskell.nix itself.
550+ # in haskell.nix itfinal.
551− iserv-proxy = self.recurseIntoAttrs
551+ iserv-proxy = final.recurseIntoAttrs
552 (builtins.mapAttrs (_: pkgs: pkgs.iserv-proxy.components.exes.iserv-proxy)
552 (builtins.mapAttrs (_: pkgs: pkgs.iserv-proxy.components.exes.iserv-proxy)
553− (filterSupportedGhc self.ghc-extra-packages));
553+ (filterSupportedGhc final.ghc-extra-packages));
554− remote-iserv = self.recurseIntoAttrs
554+ remote-iserv = final.recurseIntoAttrs
555 (builtins.mapAttrs (_: pkgs: pkgs.remote-iserv.components.exes.remote-iserv)
555 (builtins.mapAttrs (_: pkgs: pkgs.remote-iserv.components.exes.remote-iserv)
556− (filterSupportedGhc self.ghc-extra-packages));
556+ (filterSupportedGhc final.ghc-extra-packages));
557 });
557 });
558 };
558 };
559}
559}
overlays/musl.nix+3−3
@@ -1,10 +1,10 @@
1−self: super: super.lib.optionalAttrs super.stdenv.hostPlatform.isMusl {
1+final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl {
2 # On nixpkgs 19.09 openssl is configured as `linux-generic64` instead
2 # On nixpkgs 19.09 openssl is configured as `linux-generic64` instead
3 # of `linux-x86_64` and as a result the `asm` parts of of openssl
3 # of `linux-x86_64` and as a result the `asm` parts of of openssl
4 # are not built. Because the `no_asm` configure flag is also not passed
4 # are not built. Because the `no_asm` configure flag is also not passed
5 # the c versions of the functions are also not included.
5 # the c versions of the functions are also not included.
6− openssl = super.openssl.overrideAttrs (attrs:
6+ openssl = prev.openssl.overrideAttrs (attrs:
7− super.lib.optionalAttrs super.stdenv.hostPlatform.isx86_64 {
7+ prev.lib.optionalAttrs prev.stdenv.hostPlatform.isx86_64 {
8 configureScript = "./Configure linux-x86_64";
8 configureScript = "./Configure linux-x86_64";
9 });
9 });
10}
10}
overlays/python.nix+4−4
@@ -1,8 +1,8 @@
1−(self: super: {
1+(final: prev: {
2 # See nixpkgs#51135
2 # See nixpkgs#51135
3− python37 = super.python37.override {
3+ python37 = prev.python37.override {
4− packageOverrides = python-self: python-super: {
4+ packageOverrides = python-final: python-prev: {
5− docutils = python-super.docutils.overrideAttrs (oldAttrs: {
5+ docutils = python-prev.docutils.overrideAttrs (oldAttrs: {
6 LC_CTYPE = "en_US.UTF-8";
6 LC_CTYPE = "en_US.UTF-8";
7 LANG = "en_US.UTF-8";
7 LANG = "en_US.UTF-8";
8 });
8 });
overlays/tools.nix+15−15
@@ -31,11 +31,11 @@
31# ghc = haskell-nix.compiler.ghc883;
31# ghc = haskell-nix.compiler.ghc883;
32# }
32# }
33#
33#
34−self: super:
34+final: prev:
35let
35let
36− inherit (self) lib;
36+ inherit (final) lib;
37
37
38−in { haskell-nix = super.haskell-nix // {
38+in { haskell-nix = prev.haskell-nix // {
39
39
40 # Some times the package name in hackage is not the same as tool name.
40 # Some times the package name in hackage is not the same as tool name.
41 toolPackageName = {
41 toolPackageName = {
@@ -43,37 +43,37 @@ in { haskell-nix = super.haskell-nix // {
43 };
43 };
44
44
45 hackage-tool = { name, ... }@args:
45 hackage-tool = { name, ... }@args:
46− (self.haskell-nix.hackage-package
46+ (final.haskell-nix.hackage-package
47− (args // { name = self.haskell-nix.toolPackageName."${name}" or name; }))
47+ (args // { name = final.haskell-nix.toolPackageName."${name}" or name; }))
48 .components.exes."${name}";
48 .components.exes."${name}";
49
49
50 tool = name: versionOrArgs:
50 tool = name: versionOrArgs:
51 let
51 let
52− args = self.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
52+ args = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
53 in
53 in
54− (if self.haskell-nix.custom-tools ? "${name}"
54+ (if final.haskell-nix.custom-tools ? "${name}"
55− && self.haskell-nix.custom-tools."${name}" ? "${args.version}"
55+ && final.haskell-nix.custom-tools."${name}" ? "${args.version}"
56− then self.haskell-nix.custom-tools."${name}"."${args.version}"
56+ then final.haskell-nix.custom-tools."${name}"."${args.version}"
57− else self.haskell-nix.hackage-tool) (args // { inherit name; });
57+ else final.haskell-nix.hackage-tool) (args // { inherit name; });
58
58
59− tools = lib.mapAttrs self.haskell-nix.tool;
59+ tools = lib.mapAttrs final.haskell-nix.tool;
60
60
61 # Like `tools` but allows default ghc to be specified
61 # Like `tools` but allows default ghc to be specified
62 toolsForGhc = ghc: toolSet:
62 toolsForGhc = ghc: toolSet:
63− self.haskell-nix.tools (
63+ final.haskell-nix.tools (
64 lib.mapAttrs (name: versionOrArgs:
64 lib.mapAttrs (name: versionOrArgs:
65 # Add default ghc if not specified in the args
65 # Add default ghc if not specified in the args
66 { inherit ghc; }
66 { inherit ghc; }
67− // self.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs
67+ // final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs
68 ) toolSet
68 ) toolSet
69 );
69 );
70
70
71 # Tools not in hackage yet
71 # Tools not in hackage yet
72 custom-tools = {
72 custom-tools = {
73 ghcide.object-code = args:
73 ghcide.object-code = args:
74− (self.haskell-nix.cabalProject (args // {
74+ (final.haskell-nix.cabalProject (args // {
75 name = "ghcide";
75 name = "ghcide";
76− src = self.fetchFromGitHub {
76+ src = final.fetchFromGitHub {
77 owner = "mpickering";
77 owner = "mpickering";
78 repo = "ghcide";
78 repo = "ghcide";
79 rev = "706c59c97c25c66798815c1dc3ee6885a298918a";
79 rev = "706c59c97c25c66798815c1dc3ee6885a298918a";
overlays/windows.nix+11−11
@@ -2,30 +2,30 @@
2# conditionals need to be in the leafs! If we attach the conditional to the root
2# conditionals need to be in the leafs! If we attach the conditional to the root
3# node (e.g. the whole customization here), they will be evaluated at the wrong time
3# node (e.g. the whole customization here), they will be evaluated at the wrong time
4# and not end up with the expected changes we want.
4# and not end up with the expected changes we want.
5−self: super:
5+final: prev:
6{
6{
7 # on windows we have this habit of putting libraries
7 # on windows we have this habit of putting libraries
8 # into `bin`, wheras on unix it's usually `lib`. For
8 # into `bin`, wheras on unix it's usually `lib`. For
9 # this confuses nix easily. So we'll just move the
9 # this confuses nix easily. So we'll just move the
10 # .dll's from `bin` into `$out/lib`. Such that they
10 # .dll's from `bin` into `$out/lib`. Such that they
11 # are trivially found.
11 # are trivially found.
12− # openssl = super.openssl.overrideAttrs (drv: {
12+ # openssl = prev.openssl.overrideAttrs (drv: {
13− # # postInstall = with super.stdenv; drv.postInstall + lib.optionalString hostPlatform.isWindows ''
13+ # # postInstall = with prev.stdenv; drv.postInstall + lib.optionalString hostPlatform.isWindows ''
14 # # cp $bin/bin/*.dll $out/lib/
14 # # cp $bin/bin/*.dll $out/lib/
15 # # '';
15 # # '';
16 # postFixup = "";
16 # postFixup = "";
17 # });
17 # });
18
18
19− mfpr = super.mfpr.overrideAttrs (drv: {
19+ mfpr = prev.mfpr.overrideAttrs (drv: {
20− configureFlags = (drv.configureFlags or []) ++ super.stdenv.lib.optional super.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
20+ configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
21 });
21 });
22
22
23− libmpc = super.libmpc.overrideAttrs (drv: {
23+ libmpc = prev.libmpc.overrideAttrs (drv: {
24− configureFlags = (drv.configureFlags or []) ++ super.stdenv.lib.optional super.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
24+ configureFlags = (drv.configureFlags or []) ++ prev.stdenv.lib.optional prev.stdenv.hostPlatform.isWindows "--enable-static --disable-shared" ;
25 });
25 });
26
26
27− haskell-nix = super.haskell-nix // ({
27+ haskell-nix = prev.haskell-nix // ({
28− defaultModules = super.haskell-nix.defaultModules ++ [
28+ defaultModules = prev.haskell-nix.defaultModules ++ [
29 ({ pkgs, buildModules, config, lib, ... }:
29 ({ pkgs, buildModules, config, lib, ... }:
30 let
30 let
31 withTH = import ./mingw_w64.nix {
31 withTH = import ./mingw_w64.nix {
@@ -37,10 +37,10 @@ self: super:
37 inherit (pkgs.buildPackages) symlinkJoin;
37 inherit (pkgs.buildPackages) symlinkJoin;
38 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
38 # iserv-proxy needs to come from the buildPackages, as it needs to run on the
39 # build host.
39 # build host.
40− inherit (self.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
40+ inherit (final.buildPackages.ghc-extra-packages."${config.compiler.nix-name}".iserv-proxy.components.exes) iserv-proxy;
41 # remote-iserv however needs to come from the regular packages as it has to
41 # remote-iserv however needs to come from the regular packages as it has to
42 # run on the target host.
42 # run on the target host.
43− inherit (self.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
43+ inherit (final.ghc-extra-packages."${config.compiler.nix-name}".remote-iserv.components.exes) remote-iserv;
44 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
44 # we need to use openssl.bin here, because the .dll's are in the .bin expression.
45 # extra-test-libs = [ pkgs.rocksdb pkgs.openssl.bin pkgs.libffi pkgs.gmp ];
45 # extra-test-libs = [ pkgs.rocksdb pkgs.openssl.bin pkgs.libffi pkgs.gmp ];
46 } // {
46 } // {
overlays/wine.nix+4−4
@@ -1,13 +1,13 @@
1# fix wine at 3.0.2; the 4.x branch breaks windows cross compilation.
1# fix wine at 3.0.2; the 4.x branch breaks windows cross compilation.
2# this will inevitably replace *any* wine version. Thus this might not
2# this will inevitably replace *any* wine version. Thus this might not
3# really be what we ultimately want.
3# really be what we ultimately want.
4−self: super:
4+final: prev:
5{
5{
6− winePackages = super.winePackages // {
6+ winePackages = prev.winePackages // {
7− minimal = super.winePackages.minimal.overrideAttrs (oldAttrs: {
7+ minimal = prev.winePackages.minimal.overrideAttrs (oldAttrs: {
8 name = "wine-3.21";
8 name = "wine-3.21";
9 version = "3.21";
9 version = "3.21";
10− src = super.fetchurl {
10+ src = prev.fetchurl {
11 url = "https://dl.winehq.org/wine/source/3.x/wine-3.21.tar.xz";
11 url = "https://dl.winehq.org/wine/source/3.x/wine-3.21.tar.xz";
12 sha256 = "1h70wb7kysbzv36i3fblyiihvalwhy6sj4s2a8nf21nz2mhc0k58"; };
12 sha256 = "1h70wb7kysbzv36i3fblyiihvalwhy6sj4s2a8nf21nz2mhc0k58"; };
13 });
13 });