{ pkgs ? import {} , ghc ? null #"ghc8102" , withHoogle ? false #, symantic-base ? null }: let haskellPackages = if ghc == null then pkgs.haskellPackages else pkgs.haskell.packages.${ghc}; hs = haskellPackages.extend (with pkgs.haskell.lib; hself: hsuper: { /* mkDerivation = drv: hsuper.mkDerivation ( # There is no much cache for other ghc, # hence build as little as possible. drv // pkgs.lib.optionalAttrs (ghc != null) { enableLibraryProfiling = false; doHaddock = false; doBenchmark = false; doCoverage = false; doHoogle = false; #doCheck = false; # Enable check here so that symantic-parser.getCabalDeps contains testHaskellDepends, # which are needed in the shell to run: # cabal repl --enable-tests symantic-parser-test # Wrapping symantic-parser in a doCheck (hence using overrideCabal) would not work. # And I have no idea why the version suffix must also be included. doCheck = builtins.match "symantic-parser.*" drv.pname != null; } ); */ symantic-base = hself.callCabal2nix "symantic-base" (pkgs.fetchgit { url = "git://git.sourcephile.fr/haskell/symantic-base"; sha256 = "sha256-I636Kl+S93BDX1xrEMQdf217pLeT6FeF4BBpj83sEgQ="; }) {}; symantic-parser = enableExecutableProfiling (doCheck (hself.callCabal2nix "symantic-parser" ./. {})); } // packageSourceOverrides { # symantic-parser = ./.; } hself hsuper ); in hs.symantic-parser // { shell = hs.shellFor { packages = p: [ p.symantic-parser ]; nativeBuildInputs = [ hs.cabal-install hs.haskell-language-server hs.hpc ]; buildInputs = [ #hs.ghcid #hs.ormolu hs.hlint #pkgs.nixpkgs-fmt ]; inherit withHoogle; }; }