Skip to content

Instantly share code, notes, and snippets.

@alpmestan
Created November 23, 2018 11:02
Show Gist options
  • Save alpmestan/9411fefaf7ef6491339f9a9cd14f0289 to your computer and use it in GitHub Desktop.
Save alpmestan/9411fefaf7ef6491339f9a9cd14f0289 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {}
, compiler ? "ghc822"
}:
with pkgs;
let
ghc = haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [ cabal-install ]);
in
stdenv.mkDerivation {
name = "cabal-env";
buildInputs = [ ghc zlib ];
shellHook = ''
eval $(grep export ${ghc}/bin/ghc)
export LD_LIBRARY_PATH="${zlib}/lib:$LD_LIBRARY_PATH";
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment