2019-08-31 19:15:17 +02:00
|
|
|
{ nixpkgs ? import ./nixpkgs.nix {}, compiler ? "ghc865", withHoogle ? true }:
|
2019-08-25 19:28:10 +02:00
|
|
|
let
|
|
|
|
inherit (nixpkgs) pkgs;
|
|
|
|
|
2019-08-31 19:15:17 +02:00
|
|
|
pkg = import ./pkg.nix { inherit nixpkgs; };
|
2019-08-25 19:28:10 +02:00
|
|
|
|
|
|
|
packageSet = (
|
|
|
|
if compiler == "default"
|
|
|
|
then pkgs.haskellPackages
|
|
|
|
else pkgs.haskell.packages.${compiler}
|
2019-11-30 04:57:58 +01:00
|
|
|
).override {
|
|
|
|
overrides = import ./haskell-overlay.nix { inherit nixpkgs; };
|
|
|
|
};
|
2019-08-25 19:28:10 +02:00
|
|
|
|
|
|
|
haskellPackages = (
|
|
|
|
if withHoogle
|
|
|
|
then packageSet.override {
|
|
|
|
overrides = (self: super: {
|
|
|
|
ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
|
|
|
|
ghcWithPackages = self.ghc.withPackages;
|
2019-11-30 04:57:58 +01:00
|
|
|
# eww https://github.com/NixOS/nixpkgs/issues/16394
|
|
|
|
generic-arbitrary = pkgs.haskell.lib.appendPatch
|
|
|
|
super.generic-arbitrary
|
2019-11-30 05:01:36 +01:00
|
|
|
[ ./build/generic-arbitrary-export-garbitrary.patch ];
|
2019-08-25 19:28:10 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else packageSet
|
|
|
|
);
|
|
|
|
|
2019-08-31 19:15:17 +02:00
|
|
|
drv = haskellPackages.callPackage pkg {};
|
2019-08-25 19:28:10 +02:00
|
|
|
|
|
|
|
inherit (pkgs.haskell.lib) addBuildTools;
|
|
|
|
in
|
|
|
|
(addBuildTools drv (with haskellPackages; [ cabal-install ])).env
|