Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Last active June 14, 2019 05:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puffnfresh/903b399d1e3ace6bf7258917def96d9b to your computer and use it in GitHub Desktop.
Save puffnfresh/903b399d1e3ace6bf7258917def96d9b to your computer and use it in GitHub Desktop.
ghc not found patch for haskell.nix
{ pkgs ? import <nixpkgs> {} }:
let
haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) { inherit pkgs; };
happyHack = config:
let inherit (config.hsPkgs) happy;
in "export happy_datadir=${happy.components.exes.happy}/share/${builtins.currentSystem}-ghc-${config.compiler.version}/${happy.identifier.name}-${happy.identifier.version}";
pkgSet = haskell.mkCabalProjectPkgSet {
plan-pkgs = import ./pkgs.nix;
modules = [
({ config, ... }:
{ packages.haskell-src.preBuild = happyHack config;
packages.pretty-show.preBuild = happyHack config;
nonReinstallablePkgs = [ "ghc" "ghc-boot" "ghci" "binary" "bytestring" "containers" "directory" "filepath" "hpc" "process" "time" "terminfo" "transformers" "unix" ];
})
];
};
in
pkgSet.config.hsPkgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment