diff options
Diffstat (limited to 'Biz/Bild.nix')
-rw-r--r-- | Biz/Bild.nix | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 8d57d54..6279d2f 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -22,6 +22,12 @@ let #mkGhcjsPackageSet = nixpkgs.haskell.packages.${ghcjsCompiler}.ghcWithPackages; ghcPackageSetFull = mkGhcPackageSet haskellDeps; + ghcPackageSetBild = mkGhcPackageSet (hpkgs: with hpkgs; [ + aeson async base bytestring conduit conduit-extra containers directory + docopt filepath process protolude rainbow regex-applicative split tasty + tasty-hunit tasty-quickcheck text + wai # can remove when removed from Biz.Log + ]); in rec { inherit (nixpkgs) lib stdenv pkgs sources; @@ -30,11 +36,14 @@ in rec { bild = stdenv.mkDerivation { name = "bild"; src = ../.; - nativeBuildInputs = [ ghcPackageSetFull ]; + nativeBuildInputs = [ ghcPackageSetBild ]; buildInputs = [ nixpkgs.makeWrapper ]; strictDeps = true; buildPhase = '' - mkdir -p $out/bin + mkdir -p $out/bin $out/lib/ghc-${ghcPackageSetFull.version} + cp -r \ + ${ghcPackageSetFull}/lib/ghc-${ghcPackageSetFull.version}/package.conf.d \ + $out/lib/ghc-${ghcPackageSetFull.version} ghc \ -Werror \ -i. \ @@ -43,7 +52,10 @@ in rec { -o $out/bin/bild ''; installPhase = '' - wrapProgram $out/bin/bild --prefix PATH : ${lib.makeBinPath [ ghcPackageSetFull ]} + wrapProgram $out/bin/bild \ + --prefix PATH : ${lib.makeBinPath [ ghcPackageSetBild ]} \ + --set GHC_PACKAGE_PATH \ + $out/lib/ghc-${ghcPackageSetFull.version}/package.conf.d ''; }; @@ -59,11 +71,9 @@ in rec { # working directory: MAIN = "." + lib.strings.removePrefix (toString src) (toString main); buildPhase = '' - set -eux mkdir $out - : analyzing with bild - ${bild}/bin/bild --json "$MAIN" 1> $out/analysis.json 2> $out/stderr - set +eux + ${bild}/bin/bild --json "$MAIN" 1> $out/analysis.json \ + 2> >(tee -a $out/stderr >&2) ''; installPhase = "exit 0"; }; |