-
Notifications
You must be signed in to change notification settings - Fork 211
/
default.nix
31 lines (27 loc) · 938 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ pkgs ? (import ../default.nix {}).legacyPackages.${builtins.currentSystem}.pkgs
# Include the stack nix-shell in closure of stackRebuild, so that it
# doesn't get garbage-collected whilst the build is running.
# https://github.com/commercialhaskell/stack/issues/3479
, stackShell ? import ../nix/stack-shell.nix {}
}:
with pkgs.lib;
with pkgs;
let
buildTools = [
gnused gnugrep coreutils git nix gnumake
gnutar gzip lz4 bzip2 xz
stack haskell-build-tools.weeder
];
libs = ps: with ps; [turtle safe transformers extra async digest];
ghc' = haskellPackages.ghcWithPackages libs;
stackRebuild = runCommand "stack-rebuild" {
buildInputs = [ ghc' makeWrapper ];
} ''
mkdir -p $out/bin
ghc -Wall -threaded -o $out/bin/rebuild ${./rebuild.hs}
wrapProgram $out/bin/rebuild \
--set PATH "${lib.makeBinPath buildTools}" \
--set NO_GC_STACK_SHELL ${stackShell}
'';
in
stackRebuild