Skip to content

Use haskell-nix-example/nix branch for nix-tools #2150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
url = "github:input-output-hk/stackage.nix";
flake = false;
};
nix-tools-static = {
url = "github:input-output-hk/haskell-nix-example/nix";
flake = false;
};
cabal-32 = {
url = "github:haskell/cabal/3.2";
flake = false;
Expand Down
22 changes: 10 additions & 12 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ let
# going to use. To cut the evaluation time of nix-tools (which would itself
# depend on haskell.nix), we have the option of obtaining a pre-compiled
# and statically-linked copy nix-tools.
#
# For the moment we do this only on x84_64-linux.
nix-tools = (final: prev:
let
# Import the overlay from nix-tools' subdirectory
Expand All @@ -32,11 +30,15 @@ let
# as shown above.
static-nix-tools =
let
tarball = final.fetchzip {
name = "nix-tools-0.1.0.0";
url = "https://ci.zw3rk.com/build/3419283/download/1/nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz";
sha256 = "sha256-0NFDSRJM+f8n3K8902LqqjNJfyqgWUTKAM5xmInsqpU=";
};
# TODO replace once haskell-nix-examples nix-tools is in haskell.nix
zipFile = (import final.haskell-nix.sources.nix-tools-static final).${final.system};
tarball = final.runCommand "nix-tools" {
nativeBuildInputs = [ final.unzip ];
} ''
mkdir -p $out/bin
cd $out/bin
unzip ${zipFile}
'';
nix-tools-provided-exes = builtins.attrNames nix-tools-pkgs.nix-tools.exes;
in
# add the missing exes attributes to the tarball derivation
Expand All @@ -58,11 +60,7 @@ let
prev.haskell-nix // {
inherit (nix-tools-pkgs) nix-tools nix-tools-set;
# either nix-tools from its overlay or from the tarball.
nix-tools-unchecked =
# If possible use the static nix-tools tarball
if final.stdenv.hostPlatform.isLinux && final.stdenv.hostPlatform.isx86_64
then static-nix-tools
else pinned-nix-tools-lib.nix-tools final.system;
nix-tools-unchecked = static-nix-tools;
};
# For use building hadrian. This way updating anything that modifies the
# way hadrian is built will not cause a GHC rebuild.
Expand Down