summaryrefslogtreecommitdiff
path: root/shell.nix
blob: 32480ee617e8a3c759d780ae7985985396f74170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ pkgs ? (import <nixpkgs> {})
, haskellPackages ? (import ./default.nix { inherit pkgs; }).haskellPackages
}:

let
  ghc = haskellPackages.ghcWithPackages (ps: payload ++ depends ++ (with ps; [ hlint cabal2nix cabal-install ]));
  payload = builtins.attrValues (import ./default.nix {});
  depends = builtins.concatLists (builtins.map (x: if builtins.hasAttr "nativeBuildInputs" x then x.nativeBuildInputs else []) (builtins.attrValues (import ./default.nix {})));
in pkgs.stdenv.mkDerivation rec {
  bareName = "events";
  name = "${bareName}-env";
  buildInputs = [ ghc ];
  shellHook = ''
    eval $(egrep ^export ${ghc}/bin/ghc)
    export PROMPT_INFO="${name}"
  '';
}