{ pkgs ? import {} , compiler ? "ghc864" }: let src = pkgs.nix-gitignore.gitignoreSource [] ./.; # Any overrides we require to the specified haskell package set haskellPackages = with pkgs.haskell.lib; pkgs.haskell.packages.${compiler}.override { overrides = self: super: { }; }; # Any packages to appear in the environment provisioned by nix-shell extraEnvPackages = with haskellPackages; [ ]; # Generate a haskell derivation using the cabal2nix tool on `package.yaml` drv = haskellPackages.callCabal2nix "" src {}; # Insert the extra environment packages into the environment generated by # cabal2nix envWithExtras = pkgs.lib.overrideDerivation drv.env (attrs: { buildInputs = attrs.buildInputs ++ extraEnvPackages; }); in drv // { env = envWithExtras; }