|
8 | 8 | # going to use. To cut the evaluation time of nix-tools (which would itself
|
9 | 9 | # depend on haskell.nix), we have the option of obtaining a pre-compiled
|
10 | 10 | # and statically-linked copy nix-tools.
|
11 |
| - # |
12 |
| - # For the moment we do this only on x84_64-linux. |
13 | 11 | nix-tools = (final: prev:
|
14 | 12 | let
|
15 | 13 | # Import the overlay from nix-tools' subdirectory
|
|
32 | 30 | # as shown above.
|
33 | 31 | static-nix-tools =
|
34 | 32 | let
|
35 |
| - tarball = final.fetchzip { |
36 |
| - name = "nix-tools-0.1.0.0"; |
37 |
| - url = "https://ci.zw3rk.com/build/3419283/download/1/nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz"; |
38 |
| - sha256 = "sha256-0NFDSRJM+f8n3K8902LqqjNJfyqgWUTKAM5xmInsqpU="; |
39 |
| - }; |
| 33 | + # TODO replace once haskell-nix-examples nix-tools is in haskell.nix |
| 34 | + zipFile = (import final.haskell-nix.sources.nix-tools-static final).${final.system}; |
| 35 | + tarball = final.runCommand "nix-tools" { |
| 36 | + nativeBuildInputs = [ final.unzip ]; |
| 37 | + } '' |
| 38 | + mkdir -p $out/bin |
| 39 | + cd $out/bin |
| 40 | + unzip ${zipFile} |
| 41 | + ''; |
40 | 42 | nix-tools-provided-exes = builtins.attrNames nix-tools-pkgs.nix-tools.exes;
|
41 | 43 | in
|
42 | 44 | # add the missing exes attributes to the tarball derivation
|
|
58 | 60 | prev.haskell-nix // {
|
59 | 61 | inherit (nix-tools-pkgs) nix-tools nix-tools-set;
|
60 | 62 | # either nix-tools from its overlay or from the tarball.
|
61 |
| - nix-tools-unchecked = |
62 |
| - # If possible use the static nix-tools tarball |
63 |
| - if final.stdenv.hostPlatform.isLinux && final.stdenv.hostPlatform.isx86_64 |
64 |
| - then static-nix-tools |
65 |
| - else pinned-nix-tools-lib.nix-tools final.system; |
| 63 | + nix-tools-unchecked = static-nix-tools; |
66 | 64 | };
|
67 | 65 | # For use building hadrian. This way updating anything that modifies the
|
68 | 66 | # way hadrian is built will not cause a GHC rebuild.
|
|
0 commit comments