-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
32 lines (26 loc) · 715 Bytes
/
shell.nix
File metadata and controls
32 lines (26 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# shell.nix for nix-shell
# Overrideable ghc version by passing `compiler` argument
# Example:
# $ nix-shell shell.nix --argstr compiler ghc7103
#
# To list avaliable ghc version:
# $ nix-env -qaPA nixos.haskell.compiler
{ pkgs ? import <nixpkgs> {}, compiler ? "default" }:
with pkgs;
with (if compiler == "default"
then haskellPackages
else haskell.packages.${compiler});
let
ghc = ghcWithPackages (ps: with ps; [
gloss
]);
in
mkShell {
name = "${compiler}-sh";
buildInputs = [ ghc cabal-install ];
shellHook = ''
eval "$(egrep ^export "$(type -p ghc)")"
export PS1="\[\033[1;32m\][$name:\W]\n$ \[\033[0m\]"
export GHCRTS='-M1G'
'';
}