-
-
Notifications
You must be signed in to change notification settings - Fork 414
/
Copy pathflake.nix
45 lines (41 loc) · 1.27 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
description = "Servant development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
mkDevShell = { compiler ? "ghc92", tutorial ? false }:
let
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (_: []);
docstuffs = pkgs.python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
in
pkgs.mkShell {
buildInputs = with pkgs; [
ghc
zlib
python3
wget
cabal-install
postgresql
openssl
stack
haskellPackages.hspec-discover
] ++ (if tutorial then [docstuffs postgresql] else []);
shellHook = ''
eval $(grep export ${ghc}/bin/ghc)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${pkgs.zlib}/lib";
'';
};
in
{
devShells = {
default = mkDevShell {};
tutorial = mkDevShell { tutorial = true; };
};
}
);
}