git.iko.soy/typeable/servant
on master help sign in
Merge pull request #1410 from akhesaCaro/improve_nix_shell

pinning nixpkgs and adding missing dependencies to shell.nix file

commit486f89da04be33a1e8953531bccfd1fea35e38bf authorCaroline GAUDREAU <caroline.gaudreau@gmail.com> dateSat 10 Apr 2021, 11:59 (6 years ago) parentbc614474a7a108
3 files changed+34−18
README.md+6 nix/README.md+6 nix/shell.nix+22−18
README.md+6
@@ -63,3 +63,9 @@ To compare with `reitit` (Clojure framework)
6363```
6464
6565You can see the visualised results at https://www.techempower.com/benchmarks/#section=test
66+
67+## Nix
68+
69+A developer shell.nix file is provided in the `nix` directory
70+
71+See [nix/README.md](nix/README.md)
nix/README.md+6
@@ -21,3 +21,9 @@ a particular ghc version, e.g:
2121``` sh
2222$ nix-shell nix/shell.nix --argstr compiler ghcHEAD
2323```
24+
25+**Possible GHC versions**
26+- `ghc822Binary`
27+- `ghc865`
28+- `ghc884`
29+- `ghc8102` - default
nix/shell.nix+22−18
@@ -1,21 +1,25 @@
1−{ pkgs ? import <nixpkgs> {}
2−, compiler ? "ghc822"
1+let nixos = fetchTarball {
2+ url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3505.12d9950bf47/nixexprs.tar.xz";
3+ sha256 = "0fsl8bsdb8i536pfs4wrp0826h5l84xqlwx32sbz66jg4ykqp9lr";
4+}; in
5+
6+{ compiler ? "ghc8102"
37, tutorial ? false
8+, pkgs ? import nixos { config = {}; }
49}:
10+
11+ with pkgs;
512
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 python3 wget ]
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−}
13+ let
14+ ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
15+ docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
16+ in
17+ stdenv.mkDerivation {
18+ name = "servant-dev";
19+ buildInputs = [ ghc zlib python3 wget cabal-install postgresql openssl ]
20+ ++ (if tutorial then [docstuffs postgresql] else []);
21+ shellHook = ''
22+ eval $(grep export ${ghc}/bin/ghc)
23+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${zlib}/lib";
24+ '';
25+ }