{ pkgs ? import {} , ghc ? "ghc901" , withHoogle ? false }: 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="; }) {}; */ # Relax upper bound to support ghc-9.0.1 /* bifunctors = doJailbreak hsuper.bifunctors; attoparsec = doJailbreak hsuper.attoparsec; assoc = doJailbreak hsuper.assoc; vector-binary-instances = doJailbreak hsuper.vector-binary-instances; vector-th-unbox = doJailbreak hsuper.vector-th-unbox; these = doJailbreak hsuper.these; quickcheck-instances = doJailbreak hsuper.quickcheck-instances; binary-orphans = doJailbreak hsuper.binary-orphans; text-short = doJailbreak hsuper.text-short; aeson = doJailbreak hsuper.aeson; */ #HsYAML = doJailbreak hsuper.HsYAML; #gitrev = doJailbreak hsuper.gitrev; #ghc-source-gen = doJailbreak hsuper.ghc-source-gen; data-fix = doJailbreak hsuper.data-fix; primitive = doJailbreak hsuper.primitive; assoc = doJailbreak hsuper.assoc; these = doJailbreak hsuper.these; dump-core = dontCheck (unmarkBroken hsuper.dump-core); 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 = [ pkgs.cabal-install #hs.cabal-install #hs.haskell-language-server #hs.hpc ]; buildInputs = [ #hs.ghcid #hs.ormolu #hs.hlint #pkgs.nixpkgs-fmt ]; inherit withHoogle; }; }