on master help sign in
Refactor stack-shell.nix to use buildStackProject
613aff2Vaibhav Sagar
stack-shell.nix+5−15
@@ -1,9 +1,7 @@
1+{ ghc }:
1with (import <nixpkgs> {});
2with (import <nixpkgs> {});
2
3
3let
4let
4− # MUST match GHC of resolver in stack.yaml
5− ghc = haskell.packages.ghc802.ghc;
6−
7 native_libs = [
5 native_libs = [
8 libffi
6 libffi
9 zlib
7 zlib
@@ -15,17 +13,9 @@ let
15 CoreServices
13 CoreServices
16 ]);
14 ]);
17
15
18−in stdenv.mkDerivation {
16+in haskell.lib.buildStackProject {
19−
17+ inherit ghc;
18+ buildInputs = native_libs;
20 name = "idrisBuildEnv";
19 name = "idrisBuildEnv";
21−
20+ src = ./.;
22− buildInputs = [ ghc ] ++ native_libs;
23−
24− STACK_IN_NIX_EXTRA_ARGS = builtins.foldl'
25− (acc: lib:
26− " --extra-lib-dirs=${lib}/lib --extra-include-dirs=${lib}/include" + acc)
27− "" native_libs;
28−
29− # Needed if one wants to use ghci, due to https://ghc.haskell.org/trac/ghc/ticket/11042
30− LD_LIBRARY_PATH = builtins.concatStringsSep ":" (map (lib: lib.out + "/lib") native_libs);
31}
21}