diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-02 15:19:14 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-02 15:19:14 +0200 |
commit | e4fe9710287960438856fa78b697ccae64b7e2eb (patch) | |
tree | 6d9283aa148a912f219acc6e0d9307f448736b69 /shell.nix | |
download | 2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar 2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.gz 2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.bz2 2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.tar.xz 2017-01-16_17:13:37-e4fe9710287960438856fa78b697ccae64b7e2eb.zip |
Build framework
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..294fea0 --- /dev/null +++ b/shell.nix | |||
@@ -0,0 +1,17 @@ | |||
1 | { pkgs ? (import <nixpkgs> {}) | ||
2 | , haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages | ||
3 | }: | ||
4 | |||
5 | let | ||
6 | ghc = (haskellPackages.ghcWithPackages (ps: (payload ++ depends ++ (with ps; [ hlint cabal2nix cabal-install ])))).override { ignoreCollisions = true; }; | ||
7 | payload = builtins.attrValues (import ./default.nix {}); | ||
8 | depends = builtins.concatLists (builtins.map (x: if builtins.hasAttr "nativeBuildInputs" x then x.nativeBuildInputs else []) (builtins.attrValues (import ./default.nix {}))); | ||
9 | in pkgs.stdenv.mkDerivation rec { | ||
10 | bareName = "sequence"; | ||
11 | name = "${bareName}-env"; | ||
12 | buildInputs = [ ghc ]; | ||
13 | shellHook = '' | ||
14 | eval $(egrep ^export ${ghc}/bin/ghc) | ||
15 | export PROMPT_INFO="${name}" | ||
16 | ''; | ||
17 | } | ||