summaryrefslogtreecommitdiff
path: root/shell.nix
blob: b0c704382fea02704ef0fc2f809510acb15d530c (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.override { overrides = self: super: { mkDerivation = args : super.mkDerivation (args // { enableLibraryProfiling = true; }); }; }
}:

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}"
  '';
}