|
1 |
| -{ stdenv, cabal-install, mkStackSnapshotPkgSet }: |
| 1 | +{ stdenv, cabal-install, mkStackSnapshotPkgSet, mkCabalProjectPkgSet }: |
2 | 2 |
|
3 | 3 | with stdenv.lib;
|
4 | 4 |
|
5 | 5 | let
|
6 |
| - pkgSet = mkStackSnapshotPkgSet { |
7 |
| - resolver = "lts-12.21"; |
8 |
| - # Work around a mismatch between stackage metadata and the |
9 |
| - # libraries shipped with GHC. |
10 |
| - # https://github.com/commercialhaskell/stackage/issues/4466 |
11 |
| - pkg-def-extras = [(hackage: { |
12 |
| - packages = { |
13 |
| - "transformers" = (((hackage.transformers)."0.5.6.2").revisions).default; |
14 |
| - "process" = (((hackage.process)."1.6.5.0").revisions).default; |
15 |
| - }; |
16 |
| - })]; |
| 6 | + pkgSet = { |
| 7 | + stack = mkStackSnapshotPkgSet { |
| 8 | + resolver = "lts-12.21"; |
| 9 | + # Work around a mismatch between stackage metadata and the |
| 10 | + # libraries shipped with GHC. |
| 11 | + # https://github.com/commercialhaskell/stackage/issues/4466 |
| 12 | + pkg-def-extras = [(hackage: { |
| 13 | + packages = { |
| 14 | + "transformers" = (((hackage.transformers)."0.5.6.2").revisions).default; |
| 15 | + "process" = (((hackage.process)."1.6.5.0").revisions).default; |
| 16 | + }; |
| 17 | + })]; |
| 18 | + }; |
| 19 | + |
| 20 | + cabal = mkCabalProjectPkgSet { |
| 21 | + plan-pkgs = import ./pkgs.nix; |
| 22 | + pkg-def-extras = [{ |
| 23 | + pkga = ./.plan.nix/pkga.nix; |
| 24 | + pkgb = ./.plan.nix/pkgb.nix; |
| 25 | + }]; |
| 26 | + }; |
17 | 27 | };
|
18 | 28 |
|
19 |
| - env = pkgSet.config.hsPkgs.shellFor { |
20 |
| - packages = ps: with ps; [ conduit conduit-extra resourcet ]; |
21 |
| - withHoogle = true; |
22 |
| - # This adds cabal-install to the shell, which helps tests because |
23 |
| - # they use a nix-shell --pure. Normally you would BYO cabal-install. |
24 |
| - buildInputs = [ cabal-install ]; |
| 29 | + env = { |
| 30 | + stack = pkgSet.stack.config.hsPkgs.shellFor { |
| 31 | + packages = ps: with ps; [ conduit conduit-extra resourcet ]; |
| 32 | + withHoogle = true; |
| 33 | + # This adds cabal-install to the shell, which helps tests because |
| 34 | + # they use a nix-shell --pure. Normally you would BYO cabal-install. |
| 35 | + buildInputs = [ cabal-install ]; |
| 36 | + }; |
| 37 | + |
| 38 | + cabal = pkgSet.cabal.config.hsPkgs.shellFor { |
| 39 | + packages = ps: with ps; [ pkga pkgb ]; |
| 40 | + }; |
25 | 41 | };
|
26 | 42 |
|
27 | 43 | in
|
|
33 | 49 | # test shell-for with an example program
|
34 | 50 |
|
35 | 51 | printf "checking that the shell env has the dependencies...\n" >& 2
|
36 |
| - ${env.ghc}/bin/runghc ${./conduit.hs} |
| 52 | + ${env.stack.ghc}/bin/runghc ${./pkgb/src/conduit.hs} |
37 | 53 |
|
38 | 54 | touch $out
|
39 | 55 | '';
|
|
0 commit comments