Skip to content

Instantly share code, notes, and snippets.

@alpmestan
Created November 23, 2018 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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