summaryrefslogtreecommitdiff
path: root/shell.nix
blob: c6a98c9581bc4cbde679d2426f637388f9dcf244 (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 ])))).override { ignoreCollisions = true; };
  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}"
  '';
}