Skip to content

Commit 6eaafcd

Browse files
authored
Use haskell-nix-example/nix branch for nix-tools (#2150)
* Use haskell-nix-example/nix branch for nix-tools * Update to get macOS nix-tools-static fix
1 parent af88d55 commit 6eaafcd

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

flake.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
url = "github:input-output-hk/stackage.nix";
4040
flake = false;
4141
};
42+
nix-tools-static = {
43+
url = "github:input-output-hk/haskell-nix-example/nix";
44+
flake = false;
45+
};
4246
cabal-32 = {
4347
url = "github:haskell/cabal/3.2";
4448
flake = false;

overlays/default.nix

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ let
88
# going to use. To cut the evaluation time of nix-tools (which would itself
99
# depend on haskell.nix), we have the option of obtaining a pre-compiled
1010
# and statically-linked copy nix-tools.
11-
#
12-
# For the moment we do this only on x84_64-linux.
1311
nix-tools = (final: prev:
1412
let
1513
# Import the overlay from nix-tools' subdirectory
@@ -32,11 +30,15 @@ let
3230
# as shown above.
3331
static-nix-tools =
3432
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+
'';
4042
nix-tools-provided-exes = builtins.attrNames nix-tools-pkgs.nix-tools.exes;
4143
in
4244
# add the missing exes attributes to the tarball derivation
@@ -58,11 +60,7 @@ let
5860
prev.haskell-nix // {
5961
inherit (nix-tools-pkgs) nix-tools nix-tools-set;
6062
# 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;
6664
};
6765
# For use building hadrian. This way updating anything that modifies the
6866
# way hadrian is built will not cause a GHC rebuild.

0 commit comments

Comments
 (0)