Skip to content

Commit 486f89d

Browse files
authored
Merge pull request #1410 from akhesaCaro/improve_nix_shell
pinning nixpkgs and adding missing dependencies to shell.nix file
2 parents bc61447 + 4a7a108 commit 486f89d

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ To compare with `reitit` (Clojure framework)
6363
```
6464

6565
You 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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)