Skip to content

Instantly share code, notes, and snippets.

@AleXoundOS
Last active April 6, 2019 21:23
Show Gist options
  • Save AleXoundOS/9a27b23504f0cd57b6c87e2cfcc107a4 to your computer and use it in GitHub Desktop.
Save AleXoundOS/9a27b23504f0cd57b6c87e2cfcc107a4 to your computer and use it in GitHub Desktop.
nix shell configuration for building stack project with zlib dependency using binary GHC distribution
with (import <nixpkgs> {});
let
buildInputs = [haskell.compiler.ghc822Binary pkgconfig zlib];
in stdenv.mkDerivation {
name = "myUsbZlibEnv";
inherit buildInputs;
# For unknown reason libz.so cannot be found for linking without this
# despite being present in buildInputs.
# I took inspiration for this from haskell-modules/generic-stack-builder.nix.
# And if buildStackProject supports somehow binary ghc (i.e. ghc822Binary),
# the following expression in not needed.
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment