git.iko.soy/typeable/servant
on master help sign in
add shell.nix for building servant (+ tutorial + cookbook, optionally)
c8dbceaAlp Mestanogullari
.gitignore−2
@@ -25,8 +25,6 @@ cabal.config
25*.hp
25*.hp
26Setup
26Setup
27.stack-work
27.stack-work
28−shell.nix
29−default.nix
30doc/_build
28doc/_build
31doc/venv
29doc/venv
32doc/tutorial/static/api.js
30doc/tutorial/static/api.js
nix/README.mdnew file+23
@@ -0,0 +1,23 @@
1+You can use the `shell.nix` from this directory
2+to build the servant packages or even the tutorial
3+or cookbook if you want to, optionally.
4+
5+Just the servant packages:
6+
7+``` sh
8+$ nix-shell nix/shell.nix
9+```
10+
11+Everything needed for the tutorial and the
12+cookbook too:
13+
14+``` sh
15+$ nix-shell nix/shell.nix --arg tutorial true
16+```
17+
18+The `shell.nix` file also supports specifying
19+a particular ghc version, e.g:
20+
21+``` sh
22+$ nix-shell nix/shell.nix --argstr compiler ghcHEAD
23+```
nix/shell.nixnew file+21
@@ -0,0 +1,21 @@
1+{ pkgs ? import <nixpkgs> {}
2+, compiler ? "ghc821"
3+, tutorial ? false
4+}:
5+
6+with pkgs;
7+
8+let
9+ ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
10+ docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
11+in
12+
13+stdenv.mkDerivation {
14+ name = "servant-dev";
15+ buildInputs = [ ghc zlib ]
16+ ++ (if tutorial then [docstuffs postgresql] else []);
17+ shellHook = ''
18+ eval $(grep export ${ghc}/bin/ghc)
19+ export LD_LIBRARY_PATH="${zlib}/lib";
20+ '';
21+}