2021-09-12 10:49:43 +02:00
|
|
|
let nixos = fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz";
|
2021-04-09 17:09:03 +02:00
|
|
|
}; in
|
|
|
|
|
2021-09-12 10:49:43 +02:00
|
|
|
{ compiler ? "ghc8104"
|
2017-12-02 01:12:47 +01:00
|
|
|
, tutorial ? false
|
2021-04-09 17:09:03 +02:00
|
|
|
, pkgs ? import nixos { config = {}; }
|
2017-12-02 01:12:47 +01:00
|
|
|
}:
|
2021-04-09 17:09:03 +02:00
|
|
|
|
|
|
|
with pkgs;
|
2017-12-02 01:12:47 +01:00
|
|
|
|
2021-04-09 17:09:03 +02:00
|
|
|
let
|
|
|
|
ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
|
|
|
|
docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "servant-dev";
|
2021-10-02 13:09:51 +02:00
|
|
|
buildInputs = [ ghc zlib python3 wget cabal-install postgresql openssl stack haskellPackages.hspec-discover ]
|
2021-04-09 17:09:03 +02:00
|
|
|
++ (if tutorial then [docstuffs postgresql] else []);
|
|
|
|
shellHook = ''
|
|
|
|
eval $(grep export ${ghc}/bin/ghc)
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${zlib}/lib";
|
|
|
|
'';
|
|
|
|
}
|