Merge pull request #1410 from akhesaCaro/improve_nix_shell
pinning nixpkgs and adding missing dependencies to shell.nix file
This commit is contained in:
commit
486f89da04
3 changed files with 34 additions and 18 deletions
|
@ -63,3 +63,9 @@ To compare with `reitit` (Clojure framework)
|
||||||
```
|
```
|
||||||
|
|
||||||
You can see the visualised results at https://www.techempower.com/benchmarks/#section=test
|
You can see the visualised results at https://www.techempower.com/benchmarks/#section=test
|
||||||
|
|
||||||
|
## Nix
|
||||||
|
|
||||||
|
A developer shell.nix file is provided in the `nix` directory
|
||||||
|
|
||||||
|
See [nix/README.md](nix/README.md)
|
||||||
|
|
|
@ -21,3 +21,9 @@ a particular ghc version, e.g:
|
||||||
``` sh
|
``` sh
|
||||||
$ nix-shell nix/shell.nix --argstr compiler ghcHEAD
|
$ nix-shell nix/shell.nix --argstr compiler ghcHEAD
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Possible GHC versions**
|
||||||
|
- `ghc822Binary`
|
||||||
|
- `ghc865`
|
||||||
|
- `ghc884`
|
||||||
|
- `ghc8102` - default
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
{ pkgs ? import <nixpkgs> {}
|
let nixos = fetchTarball {
|
||||||
, compiler ? "ghc822"
|
url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3505.12d9950bf47/nixexprs.tar.xz";
|
||||||
|
sha256 = "0fsl8bsdb8i536pfs4wrp0826h5l84xqlwx32sbz66jg4ykqp9lr";
|
||||||
|
}; in
|
||||||
|
|
||||||
|
{ compiler ? "ghc8102"
|
||||||
, tutorial ? false
|
, tutorial ? false
|
||||||
|
, pkgs ? import nixos { config = {}; }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
let
|
let
|
||||||
ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
|
ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
|
||||||
docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
|
docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
|
||||||
in
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
stdenv.mkDerivation {
|
name = "servant-dev";
|
||||||
name = "servant-dev";
|
buildInputs = [ ghc zlib python3 wget cabal-install postgresql openssl ]
|
||||||
buildInputs = [ ghc zlib python3 wget ]
|
++ (if tutorial then [docstuffs postgresql] else []);
|
||||||
++ (if tutorial then [docstuffs postgresql] else []);
|
shellHook = ''
|
||||||
shellHook = ''
|
eval $(grep export ${ghc}/bin/ghc)
|
||||||
eval $(grep export ${ghc}/bin/ghc)
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${zlib}/lib";
|
||||||
export LD_LIBRARY_PATH="${zlib}/lib";
|
'';
|
||||||
'';
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue