forked from jeffa5/ocaml-grpc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
78 lines (68 loc) · 1.86 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
description = "A modular gRPC library";
inputs = {
nixpkgs = {
url = "github:sternenseemann/nixpkgs/ppx_deriving-5.1";
};
};
outputs = { self, nixpkgs }:
with import nixpkgs { system = "x86_64-linux"; };
let
h2-src = fetchFromGitHub {
owner = "jeffa5";
repo = "ocaml-h2";
rev = "36bd7bfa46fb0eb2bce184413f663a46a5e0dd3b";
sha256 = "sha256-8vsRpx0JVN6KHOVfKit6LhlQqGTO1ofRhfyDgJ7dGz0=";
};
hpack = ocamlPackages.buildDunePackage {
pname = "hpack";
version = "0.2.0";
src = h2-src;
useDune2 = true;
buildInputs = (with ocamlPackages; [ angstrom faraday ]);
};
h2 = ocamlPackages.buildDunePackage {
pname = "h2";
version = "0.7.0";
src = h2-src;
useDune2 = true;
buildInputs = (with ocamlPackages; [ hpack result httpaf psq base64 ]);
};
in
{
packages.x86_64-linux = rec {
grpc =
ocamlPackages.buildDunePackage {
pname = "grpc";
version = "0.1.0";
src = self;
useDune2 = true;
doCheck = true;
buildInputs = (with ocamlPackages; [ uri h2 ppx_deriving ]);
};
grpc-lwt =
ocamlPackages.buildDunePackage {
pname = "grpc-lwt";
version = "0.1.0";
src = self;
useDune2 = true;
doCheck = true;
buildInputs = (with ocamlPackages; [ ocaml-protoc lwt stringext h2 grpc ]);
};
};
defaultPackage.x86_64-linux = self.packages.x86_64-linux.grpc;
devShell.x86_64-linux = mkShell {
buildInputs = [
ocaml
opam
m4
pkgconfig
nixpkgs-fmt
rnix-lsp
];
shellHook = ''
eval $(opam env)
'';
};
};
}