summaryrefslogtreecommitdiff
path: root/shell.nix
blob: c6a13debee7dc5fea93077d9a6311bb24ef4053a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:

let
  inherit (nixpkgs) pkgs;

  haskellPackages = if compiler == "default"
                       then pkgs.haskellPackages
                       else pkgs.haskell.packages.${compiler};

  drv = haskellPackages.callPackage ./bar.nix {};
in
  pkgs.stdenv.lib.overrideDerivation drv.env (oldAttrs: {
    nativeBuildInputs = oldAttrs.nativeBuildInputs ++ (with pkgs; [ cabal2nix gup ]) ++ (with haskellPackages; [ hlint stack yesod-bin alex ]);
    shellHook = ''
      ${oldAttrs.shellHook}
      export PROMPT_INFO="${oldAttrs.name}"
    '';
  })