Created
November 28, 2016 23:19
-
-
Save shlevy/2f6107e381c276cc077d92ef126f0150 to your computer and use it in GitHub Desktop.
ghc build env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
name=$(nix-instantiate "$@" -A name --eval | tr -d '\n"') | |
mkdir -p $HOME/.cache/envs | |
env=$HOME/.cache/envs/$name | |
nix-build "$@" -o $env | |
export PATH=$env/bin:$env/sbin:$PATH | |
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE+ }-I$env/include -L$env/lib" | |
bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
haskellPackages = pkgs.haskellPackages; | |
in pkgs.buildEnv { | |
name = "ghc-env"; | |
paths = with pkgs; [ | |
perl | |
gcc | |
gnumake | |
autoconf | |
automake | |
diffutils | |
xorg.lndir | |
gnused | |
python | |
pythonPackages.sphinx | |
libffi | |
ncurses.dev | |
ncurses | |
gmp.dev | |
gmp | |
(haskellPackages.ghcWithPackages (s: with s; [ | |
happy | |
alex | |
])) | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment