From 4a7a1080a0dc385ec8c9cf0e5f0beac0aeb357bf Mon Sep 17 00:00:00 2001 From: akhesaCaro Date: Fri, 9 Apr 2021 17:09:03 +0200 Subject: [PATCH] pinning nixpkgs and adding missing dependencies --- README.md | 6 ++++++ nix/README.md | 6 ++++++ nix/shell.nix | 40 ++++++++++++++++++++++------------------ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 0d06a4e8..9ffb6311 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,9 @@ To compare with `reitit` (Clojure framework) ``` 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) diff --git a/nix/README.md b/nix/README.md index 56400fbd..4dfc519d 100644 --- a/nix/README.md +++ b/nix/README.md @@ -21,3 +21,9 @@ a particular ghc version, e.g: ``` sh $ nix-shell nix/shell.nix --argstr compiler ghcHEAD ``` + +**Possible GHC versions** +- `ghc822Binary` +- `ghc865` +- `ghc884` +- `ghc8102` - default diff --git a/nix/shell.nix b/nix/shell.nix index 4e43c606..5fa96923 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,21 +1,25 @@ -{ pkgs ? import {} -, compiler ? "ghc822" +let nixos = fetchTarball { + url = "https://releases.nixos.org/nixos/20.09/nixos-20.09.3505.12d9950bf47/nixexprs.tar.xz"; + sha256 = "0fsl8bsdb8i536pfs4wrp0826h5l84xqlwx32sbz66jg4ykqp9lr"; +}; in + +{ compiler ? "ghc8102" , tutorial ? false +, pkgs ? import nixos { config = {}; } }: + + with pkgs; -with pkgs; - -let - ghc = haskell.packages.${compiler}.ghcWithPackages (_: []); - docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]); -in - -stdenv.mkDerivation { - name = "servant-dev"; - buildInputs = [ ghc zlib python3 wget ] - ++ (if tutorial then [docstuffs postgresql] else []); - shellHook = '' - eval $(grep export ${ghc}/bin/ghc) - export LD_LIBRARY_PATH="${zlib}/lib"; - ''; -} + let + ghc = haskell.packages.${compiler}.ghcWithPackages (_: []); + docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]); + in + stdenv.mkDerivation { + name = "servant-dev"; + buildInputs = [ ghc zlib python3 wget cabal-install postgresql openssl ] + ++ (if tutorial then [docstuffs postgresql] else []); + shellHook = '' + eval $(grep export ${ghc}/bin/ghc) + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${zlib}/lib"; + ''; + }