-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
100 lines (94 loc) · 2.62 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
description = "Discord API wrapper for OCaml";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs @ {
self,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
inherit (pkgs) ocamlPackages mkShell;
inherit (ocamlPackages) buildDunePackage;
version = "0.0.1";
in {
devShells = {
default = mkShell {
inputsFrom = [
self'.packages.default
];
buildInputs = [ocamlPackages.utop];
packages = builtins.attrValues {
inherit (pkgs) clang_17 clang-tools_17 pkg-config;
inherit (ocamlPackages) ocaml-lsp ocamlformat ocamlformat-rpc-lib odoc;
};
};
};
packages = {
default = buildDunePackage {
inherit version;
pname = "okitten";
propagatedBuildInputs = with ocamlPackages; [
self'.packages.websocket
self'.packages.websocket-lwt-unix
cohttp
cohttp-lwt-unix
conduit-lwt
dune-build-info
fmt
ipaddr
iso8601
logs
lwt
lwt_ppx
ppx_deriving
ppx_yojson_conv
yojson
pkgs.libev
];
src = ./.;
};
websocket-lwt-unix = buildDunePackage {
version = "2.16";
pname = "websocket-lwt-unix";
src = builtins.fetchGit {
url = "[email protected]:vbmithr/ocaml-websocket";
rev = "a5d7cb0710e6df49cc0c328b2ed28be4d1a397b4";
};
propagatedBuildInputs = with ocamlPackages; [
self'.packages.websocket
lwt_log
cohttp-lwt-unix
];
};
websocket = buildDunePackage {
version = "2.16";
pname = "websocket";
src = builtins.fetchGit {
url = "[email protected]:vbmithr/ocaml-websocket";
rev = "a5d7cb0710e6df49cc0c328b2ed28be4d1a397b4";
};
propagatedBuildInputs = with ocamlPackages; [
cohttp
base64
conduit
cohttp
ocplib-endian
astring
mirage-crypto-rng
];
};
};
};
};
}