-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
145 lines (130 loc) · 4.74 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
description = "OCaml lib and bin projects to get started with nix flakes.";
inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.inputs.flake-utils.follows = "flake-utils";
# inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:nix-ocaml/nix-overlays";
outputs = { self, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".extend (final: prev: {
ocamlPackages = prev.ocaml-ng.ocamlPackages_5_1.overrideScope'
(ofinal: oprev: rec {
eio = with oprev;
buildDunePackage rec {
pname = "eio";
version = "0.11";
minimalOCamlVersion = "5.0";
src = prev.fetchurl {
url =
"https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
hash =
"sha256-DDN0IHRWJjFneIb0/koC+Wcs7JQpf/hcLthU21uqcao=";
};
propagatedBuildInputs = [
bigstringaf
cstruct
domain-local-await
fmt
hmap
lwt-dllist
mtime
optint
psq
];
checkInputs = [ alcotest crowbar mdx ];
nativeCheckInputs = [ mdx.bin ];
meta = {
homepage =
"https://github.com/ocaml-multicore/ocaml-${pname}";
changelog =
"https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md";
description = "Effects-Based Parallel IO for OCaml";
license = with prev.lib.licenses; [ isc ];
maintainers = with prev.lib.maintainers; [ toastal ];
};
};
eio_linux = oprev.eio_linux.override { eio = eio; };
eio_posix = oprev.eio_posix.override { eio = eio; };
eio_main = oprev.eio_main.override { eio = eio; };
mirage-crypto = oprev.mirage-crypto.overrideAttrs (_: _: rec {
version = "0.11.1";
src = prev.fetchurl {
url =
"https://github.com/mirage/mirage-crypto/releases/download/v${version}/mirage-crypto-${version}.tbz";
sha256 =
"sha256-DNoUeyCpK/cMXJ639VxnXQOrx2u9Sx8N2c9/w4AW0pw=";
};
});
mirage-crypto-rng = oprev.mirage-crypto-rng.override {
mirage-crypto = mirage-crypto;
};
mirage-crypto-rng-eio = oprev.buildDunePackage {
pname = "mirage-crypto-rng-eio";
inherit (mirage-crypto) src version;
dontDetectOcamlConflicts = true;
propagatedBuildInputs = [ eio mirage-crypto-rng oprev.mtime ];
};
tls = oprev.tls.overrideAttrs (_: _: rec {
version = "0.17.1";
src = prev.fetchurl {
url =
"https://github.com/mirleft/ocaml-tls/releases/download/v${version}/tls-${version}.tbz";
hash = "sha256-gBDStt4UjaIoaSgYHSM71yD6YPoVez1CULyg3QCMXT8=";
};
});
tls-eio = oprev.buildDunePackage {
pname = "tls-eio";
inherit (tls) src meta version;
dontDetectOcamlConflicts = true;
propagatedBuildInputs = [
tls
mirage-crypto-rng
mirage-crypto-rng-eio
oprev.x509
eio
];
};
});
});
opkgs = pkgs.ocamlPackages;
in
{
devShells.default = pkgs.mkShell {
dontDetectOcamlConflicts = true;
nativeBuildInputs = with opkgs; [
dune_3
utop
ocaml
mdx
odoc
ocamlformat
findlib
];
packages = with opkgs; [
eio
eio_main
ptime
menhir
menhirLib
tls
tls-eio
ipaddr
ca-certs
x509
ppxlib
mirage-crypto-rng
mirage-crypto-rng-eio
astring
base64
cmdliner
domain-name
fmt
cstruct
magic-mime
fpath
];
};
});
}