summaryrefslogtreecommitdiff
path: root/shell.nix
blob: 294fea07354b0a1cddf7f265f86bb1d989dc0784 (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 = "sequence";
  name = "${bareName}-env";
  buildInputs = [ ghc ];
  shellHook = ''
    eval $(egrep ^export ${ghc}/bin/ghc)
    export PROMPT_INFO="${name}"
  '';
}