@@ -0,0 +1,47 @@
1+{ stdenv, cabal-install, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject }:
2+
3+with stdenv.lib;
4+
5+let
6+ plan = importAndFilterProject (callCabalProjectToNix {
7+ src = ./.;
8+ });
9+ pkgSet = mkCabalProjectPkgSet {
10+ plan-pkgs = plan.pkgs;
11+ modules = [{
12+ # Package has no exposed modules which causes
13+ # haddock: No input file(s)
14+ packages.bytestring-builder.doHaddock = false;
15+ }];
16+ };
17+
18+ env = pkgSet.config.hsPkgs.shellFor {};
19+
20+ in
21+ stdenv.mkDerivation {
22+ name = "shell-for-test";
23+
24+ buildCommand = ''
25+ ########################################################################
26+ # test shell-for with an example program
27+
28+ cp ${./pkg/src}/*.hs .
29+
30+ printf "checking that the shell env has the dependencies...\n" >& 2
31+ ${env.ghc}/bin/runghc conduit-test.hs
32+
33+ touch $out
34+ '';
35+
36+ meta.platforms = platforms.all;
37+ meta.disabled = stdenv.hostPlatform.isMusl;
38+
39+ passthru = {
40+ # Used for debugging with nix repl
41+ inherit pkgSet;
42+
43+ # Used for testing externally with nix-shell (../tests.sh).
44+ inherit env;
45+ plan-nix = plan.nix;
46+ };
47+}