about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/aches/default.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/aches/lwt.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/afl-persistent/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/algaeff/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alsa/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ao/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/apron/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/arp/default.nix67
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/asai/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/asetmap/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/astring/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atd/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atdgen/runtime.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/awa/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/b0/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bap/default.nix85
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/base64/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bdd/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bheap/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bindlib/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/binning/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biotk/default.nix56
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bistro/janestreet-0.16.patch205
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bjack/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bls12-381-signature/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bls12-381/gen.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bos/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/brisk-reconciler/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/brr/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bwd/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bytestring/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlp-streams/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/META6
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix77
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix57
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/capnp/default.nix56
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix10
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/default.nix73
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/git.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cfstream/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cfstream/git_commit.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cfstream/janestreet-0.16.patch36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/chrome-trace/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cil/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/clap/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/class_group_vdf/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cmarkit/default.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_0.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_1.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix63
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/top.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/coin/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/color/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/colors/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/lwt-unix.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/mirage.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/config-file/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/config/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/containers/data.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/containers/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix110
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cow/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cpu/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cpuid/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/crowbar/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cry/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ctypes/foreign.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ctypes_stubs_js/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/curly/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/curses/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dap/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dates_calc/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dbf/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dedukti/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/diet/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/directories/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dispatch/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/certify.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/client-lwt.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/client-mirage.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/client.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/dnssec.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/server.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolmen/loop.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolmen/type.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domain-local-await/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domain-local-timeout/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domain_shims/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domainslib/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dscheck/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dssi/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dtools/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/duff/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dum/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-rpc/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-site/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/duppy/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/duration/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dyn/default.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/earley/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eigen/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eio/default.nix72
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eio/linux.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eio/main.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eio/posix.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/either/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/elina/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix71
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eliom/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/elpi/atd_2_10.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix72
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/emile/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/encore/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/expat/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ezjsonm-encoding/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ezjsonm/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ezxmlm/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faad/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/facile/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ff/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ff/pbt.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ff/sig.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/base.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fiber/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fileutils/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fix/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/flac/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/flex/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fmt/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/frei0r/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functory/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gd/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gen/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gen_js_api/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gen_js_api/ojs.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/getopt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gg/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/mirage.nix96
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/paf.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/unix.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/github/data.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/github/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/github/jsoo.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/github/unix.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gluon/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gluten/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gluten/eio.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gluten/lwt-unix.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gluten/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gnuplot/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphics/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/cohttp.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gstreamer/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/h2/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hack_parallel/hack_parallel.patch68
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix89
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/lwt.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/mirage.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hashcons/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hex/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/http-mirage-client/default.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/httpaf/lwt-unix.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/index/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/integers/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/integers_stubs_js/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iomux/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iri/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin-watcher/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/chunk.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/containers.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-git.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/mirage.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/pack.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/tezos.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iter/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix465
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix898
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.15.nix1103
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.16.nix1267
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/bonsai_jsoo_4_0.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/incr_dom_jsoo_4_0.patch24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_15.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_16.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/sexp.patch30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/vcaml.patch22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch9
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/javalib/configure.sh.patch11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kcas/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ke/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kicadsch/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kqueue/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgl/META.patch18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch67
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix56
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix8
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/rsvg2.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix8
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix92
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lacaml/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ladspa/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lambdapi/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lame/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/landmarks-ppx/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/landmarks/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lastfm/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lem/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lens/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/letsencrypt/app.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix63
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/letsencrypt/dns.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/letsencrypt/mirage.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/libc/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lilv/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/linksem/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/linol/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/linol/lwt.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lo/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/logs/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lru/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lun/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lun/ppx.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lustre-v6/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lutils/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/luv/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwd/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwd/nottui.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt-canceler/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt-dllist/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt-exit/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt-watcher/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/cstruct.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mad/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/magic-trace/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/magic/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/markup/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mccs/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mec/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/memprof-limits/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/memtrace/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/menhir/sdk.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/merlin-extend/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metadata/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/rusage.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mew/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mew_vi/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/middleware/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mimic/happy-eyeballs.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/minttea/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/miou/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-channel/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/solo5.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/unix.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix57
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-device/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-net-xen/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-net/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-profile/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-protocols/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-random/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-time/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-time/unix.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mldoc/default.nix69
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mlgmp/META7
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mm/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mmap/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/morbig/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mparser/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mparser/pcre.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mrmime/default.nix78
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/msat/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/msgpck/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/multipart-form-data/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ninja_utils/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/note/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/notty/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/npy/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/num/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/num/enable-static.patch12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/META.patch16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix81
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix78
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix131
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lua/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-monadic/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-vdom/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlc-loc/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlformat/generic.nix68
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamline/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlmake/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlnat/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocf/ppx.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocolor/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-ppx-rpc/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix73
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsipersist/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsipersist/lib.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsipersist/pgsql.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsipersist/sqlite.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odate/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odig/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ogg/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/omd/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-core/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-format/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-repository/download-tool.patch37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-state/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opium/default.nix61
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opti/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/optint/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opus/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ordering/default.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/oseq/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otfed/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otr/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owee/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owl-base/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owl/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/paf/cohttp.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/paf/default.nix68
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parany/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/path_glob/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pbrt/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pcre/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix9
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piaf/default.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi/no-stream.patch14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/fix-paths.patch26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/poll/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/polynomial/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/portaudio/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/base.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/time2.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/types.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pp/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pp_loc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix52
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_blob/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix57
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/ppxlib.patch22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_monad/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_show/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix81
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix100
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pratter/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/prettym/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/printbox/text.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/process/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/progress/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/prometheus/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/promise_jsoo/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/psq/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptset/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pulseaudio/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pure-splitmix/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pyml/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/bytes.patch36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/lin.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/multicoretests-util.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/ppx_deriving_qcheck.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/stm.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/randomconv/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rdbg/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/re/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/react/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/readline/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/readline/dune.patch16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/console.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/dir.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/fp.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel-console.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/rely.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam0
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re1
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/dune4
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rebez/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reperf/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/repr/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/repr/ppx.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/res/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/json.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rio/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/riot/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rock/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rope/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rosetta/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/routes/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rusage/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sail/default.nix80
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/samplerate/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/saturn/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/saturn/lockfree.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch9
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sawja/configure.sh.patch11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sawja/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/secp256k1-internal/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/secp256k1/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix85
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sel/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/semaphore-compat/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/semver/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/seq/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/seq/src-base/META4
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/seqes/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sha/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/shine/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/simple-diff/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/slug/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch7
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/soundtouch/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/speex/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/spices/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/srt/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdune/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/streaming/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/taglib/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tar/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tar/unix.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix69
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tdigest/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/telegraml/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/telemetry/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/terminal/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos-base58/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezt/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/theora/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/thread-table/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/timed/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/timedesc/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/timedesc/tzdb.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/timedesc/tzlocal.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tiny_httpd/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/async.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/default.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/lwt.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/mirage.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/toml/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix59
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/torch/default.nix69
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/trace/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/trace/tef.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/trie/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsdl-image/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsdl-mixer/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsdl-ttf/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tty/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/twt/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/type_eq/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/type_id/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/unionFind/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/unisim_archisec/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/unix-errno/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/unstrctrd/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uri/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uring/default.nix52
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uuuu/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vector/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vg/default.nix63
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/visitors/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vorbis/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vpl-core/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/webmachine/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wtf8/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/x509/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xdg/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xenstore_transport/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xmlplaylist/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xtmpl/ppx.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xxhash/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yuscii/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yuujinchou/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/z3/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zed/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zelus-gtk/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zelus/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zipc/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix8
856 files changed, 29850 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/aches/default.nix b/nixpkgs/pkgs/development/ocaml-modules/aches/default.nix
new file mode 100644
index 000000000000..c590ecc04bdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/aches/default.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, ringo }:
+
+buildDunePackage {
+  pname = "aches";
+  inherit (ringo) src version;
+
+  propagatedBuildInputs = [
+    ringo
+  ];
+
+  meta = {
+    description = "Caches (bounded-size stores) for in-memory values and for resources";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/aches/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/aches/lwt.nix
new file mode 100644
index 000000000000..bfb57a5a91aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/aches/lwt.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, ringo, aches, lwt }:
+
+buildDunePackage {
+  pname = "aches-lwt";
+  inherit (ringo) src version;
+
+  propagatedBuildInputs = [
+    aches
+    lwt
+  ];
+
+  meta = {
+    description = "Caches (bounded-size stores) for Lwt promises";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/afl-persistent/default.nix b/nixpkgs/pkgs/development/ocaml-modules/afl-persistent/default.nix
new file mode 100644
index 000000000000..04d31c881561
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/afl-persistent/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, opaline }:
+
+stdenv.mkDerivation rec {
+  pname = "afl-persistent";
+  version = "1.3";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner  = "stedolan";
+    repo   = "ocaml-${pname}";
+    rev    = "v${version}";
+    sha256 = "06yyds2vcwlfr2nd3gvyrazlijjcrd1abnvkfpkaadgwdw3qam1i";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  # don't run tests in buildPhase
+  # don't overwrite test binary
+  postPatch = ''
+    sed -i 's/ && \.\/test$//' build.sh
+    sed -i '/^ocamlopt.*test.ml -o test$/ s/$/2/' build.sh
+    patchShebangs build.sh
+  '';
+
+  buildPhase = "./build.sh";
+  installPhase = ''
+    ${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install
+  '';
+
+  doCheck = true;
+  checkPhase = "./_build/test && ./_build/test2";
+
+  meta = with lib; {
+    homepage = "https://github.com/stedolan/ocaml-afl-persistent";
+    description = "persistent-mode afl-fuzz for ocaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix b/nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix
new file mode 100644
index 000000000000..f9f07aed0fba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, fetchurl, fetchpatch
+, astring, cmdliner, fmt, re, stdlib-shims, uutf, ocaml-syntax-shims
+}:
+
+buildDunePackage rec {
+  pname = "alcotest";
+  version = "1.7.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/alcotest/releases/download/${version}/alcotest-${version}.tbz";
+    hash = "sha256-gSus2zS0XoiZXgfXMGvasvckee8ZlmN/HV0fQWZ5At8=";
+  };
+
+  # Fix tests with OCaml 5.2
+  patches = fetchpatch {
+    url = "https://github.com/mirage/alcotest/commit/aa437168b258db97680021116af176c55e1bd53b.patch";
+    hash = "sha256-cytuJFg4Mft47LsAEcz2zvzyy1wNzMdeLK+cjaFANpo=";
+  };
+
+  nativeBuildInputs = [ ocaml-syntax-shims ];
+
+  propagatedBuildInputs = [ astring cmdliner fmt re stdlib-shims uutf ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/alcotest";
+    description = "Lightweight and colourful test framework";
+    license = licenses.isc;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix
new file mode 100644
index 000000000000..cffac7b674d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, alcotest, logs, lwt, fmt
+, re, cmdliner
+}:
+
+buildDunePackage {
+  pname = "alcotest-lwt";
+
+  inherit (alcotest) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ alcotest logs lwt fmt ];
+
+  doCheck = true;
+  checkInputs = [ re cmdliner ];
+
+  meta = alcotest.meta // {
+    description = "Lwt-based helpers for Alcotest";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix
new file mode 100644
index 000000000000..e27889b40462
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, alcotest, lwt, logs, mirage-clock, duration }:
+
+buildDunePackage {
+  pname = "alcotest-mirage";
+
+  inherit (alcotest) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ alcotest lwt logs mirage-clock duration ];
+
+  doCheck = true;
+
+  meta = alcotest.meta // {
+    description = "Mirage implementation for Alcotest";
+    maintainers = with lib.maintainers; [ ulrikstrid anmonteiro ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/algaeff/default.nix b/nixpkgs/pkgs/development/ocaml-modules/algaeff/default.nix
new file mode 100644
index 000000000000..a146e0f53f51
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/algaeff/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, alcotest
+, qcheck-core
+}:
+
+buildDunePackage rec {
+  pname = "algaeff";
+  version = "1.1.0";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = pname;
+    rev = version;
+    hash = "sha256-7kwQmoT8rpQWPHc+BZQi9fcZhgHxS99158ebXAXlpQ8=";
+  };
+
+  doCheck = true;
+  checkInputs = [ alcotest qcheck-core ];
+
+  meta = {
+    description = "Reusable Effects-Based Components";
+    homepage = "https://github.com/RedPRL/algaeff";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/alsa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/alsa/default.nix
new file mode 100644
index 000000000000..988ca8280dcc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alsa/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, alsa-lib }:
+
+buildDunePackage rec {
+  pname = "alsa";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-alsa";
+    rev = version;
+    sha256 = "1qy22g73qc311rmv41w005rdlj5mfnn4yj1dx1jhqzr31zixl8hj";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ alsa-lib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-alsa";
+    description = "OCaml interface for libasound2";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix b/nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix
new file mode 100644
index 000000000000..92dd90ff22cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, angstrom, async }:
+
+buildDunePackage rec {
+  pname = "angstrom-async";
+
+  inherit (angstrom) version src;
+
+  minimalOCamlVersion = "4.04.1";
+
+  propagatedBuildInputs = [ angstrom async ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (angstrom.meta) homepage license;
+    description = "Async support for Angstrom";
+    maintainers = with lib.maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix
new file mode 100644
index 000000000000..2867e4b1a813
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, angstrom, lwt }:
+
+buildDunePackage rec {
+  pname = "angstrom-lwt-unix";
+
+  inherit (angstrom) version src;
+
+  propagatedBuildInputs = [ angstrom lwt ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (angstrom.meta) homepage license;
+    description = "Lwt_unix support for Angstrom";
+    maintainers = with lib.maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix
new file mode 100644
index 000000000000..be3414546317
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, angstrom }:
+
+buildDunePackage rec {
+  pname = "angstrom-unix";
+
+  inherit (angstrom) version src;
+
+  propagatedBuildInputs = [ angstrom ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (angstrom.meta) homepage license;
+    description = "Unix support for Angstrom";
+    maintainers = with lib.maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix b/nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix
new file mode 100644
index 000000000000..a96848fba08f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, ocaml-syntax-shims, alcotest, bigstringaf, ppx_let, gitUpdater }:
+
+buildDunePackage rec {
+  pname = "angstrom";
+  version = "0.16.0";
+
+  minimalOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner  = "inhabitedtype";
+    repo   = pname;
+    rev    = version;
+    hash = "sha256-vilGto5ciyKzVJd72z4B+AvM1nf3x3O7DHXrK5SIajQ=";
+  };
+
+  checkInputs = [ alcotest ppx_let ];
+  buildInputs = [ ocaml-syntax-shims ];
+  propagatedBuildInputs = [ bigstringaf ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  passthru.updateScript = gitUpdater { };
+
+  meta = {
+    homepage = "https://github.com/inhabitedtype/angstrom";
+    description = "OCaml parser combinators built for speed and memory efficiency";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix
new file mode 100644
index 000000000000..7530e45ac853
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "ANSITerminal";
+  version = "0.8.5";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ANSITerminal/releases/download/${version}/ANSITerminal-${version}.tbz";
+    hash = "sha256-q3OyGLajAmfSu8QzEtzzE5gbiwvsVV2SsGuHZkst0w4=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace 'libraries unix bytes' 'libraries unix'
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Module allowing to use the colors and cursor movements on ANSI terminals";
+    longDescription = ''
+      ANSITerminal is a module allowing to use the colors and cursor
+      movements on ANSI terminals. It also works on the windows shell (but
+      this part is currently work in progress).
+    '';
+    homepage = "https://github.com/Chris00/ANSITerminal";
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ao/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ao/default.nix
new file mode 100644
index 000000000000..6abc7f98f639
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ao/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libao }:
+
+buildDunePackage rec {
+  pname = "ao";
+  version = "0.2.4";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ao";
+    rev = "v${version}";
+    sha256 = "sha256-HhJdb4i9B4gz3emgDCDT4riQuAsY4uP/47biu7EZ+sk=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libao ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-ao";
+    description = "OCaml bindings for libao";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/apron/default.nix b/nixpkgs/pkgs/development/ocaml-modules/apron/default.nix
new file mode 100644
index 000000000000..fb93fd2f1875
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/apron/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub, perl, gmp, mpfr, ppl, ocaml, findlib, camlidl, mlgmpidl
+, flint, pplite
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-apron";
+  version = "0.9.15";
+  src = fetchFromGitHub {
+    owner = "antoinemine";
+    repo = "apron";
+    rev = "v${version}";
+    hash = "sha256-gHLCurydxX1pS66DTAWUJGl9Yqu9RWRjkZh6lXzM7YY=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib perl ];
+  buildInputs = [ gmp mpfr ppl camlidl flint pplite ];
+  propagatedBuildInputs = [ mlgmpidl ];
+
+  outputs = [ "out" "dev" ];
+
+  configurePhase = ''
+    runHook preConfigure
+    ./configure -prefix $out ${lib.optionalString stdenv.isDarwin "--no-strip"}
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+    runHook postConfigure
+  '';
+
+  postInstall = ''
+    mkdir -p $dev/lib
+    mv $out/lib/ocaml $dev/lib/
+  '';
+
+  meta = {
+    license = lib.licenses.lgpl21;
+    homepage = "http://apron.cri.ensmp.fr/library/";
+    maintainers = [ lib.maintainers.vbgl ];
+    description = "Numerical abstract domain library";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/arp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/arp/default.nix
new file mode 100644
index 000000000000..a4facc6cddfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/arp/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, buildDunePackage
+, fetchurl
+, cstruct
+, duration
+, ethernet
+, ipaddr
+, logs
+, lwt
+, macaddr
+, mirage-time
+, alcotest
+, mirage-clock-unix
+, mirage-flow
+, mirage-random
+, mirage-random-test
+, mirage-time-unix
+, mirage-vnetif
+, bisect_ppx
+}:
+
+buildDunePackage rec {
+  pname = "arp";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-6jPFiene6jAPtivCugtVfP3+6k9A5gBoWzpoxoaPBvE=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs = [
+    bisect_ppx
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+    duration
+    ethernet
+    ipaddr
+    logs
+    lwt
+    macaddr
+    mirage-time
+  ];
+
+  ## NOTE: As of 18 april 2023 and ARP version 3.0.0, tests fail on Darwin.
+  doCheck = ! stdenv.isDarwin;
+  checkInputs = [
+    alcotest
+    mirage-clock-unix
+    mirage-flow
+    mirage-random
+    mirage-random-test
+    mirage-time-unix
+    mirage-vnetif
+  ];
+
+  meta = with lib; {
+    description = "Address Resolution Protocol purely in OCaml";
+    homepage = "https://github.com/mirage/arp";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/asai/default.nix b/nixpkgs/pkgs/development/ocaml-modules/asai/default.nix
new file mode 100644
index 000000000000..fd7c9c4e5c63
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/asai/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, algaeff
+, bwd
+, eio
+, eio_main
+, lsp
+, notty
+}:
+
+buildDunePackage rec {
+  pname = "asai";
+  version = "0.1.1";
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = pname;
+    rev = version;
+    hash = "sha256-Jd90WhSjK4K2amFA5uyGF57NzsgHA8QiccX6qtxO1rQ=";
+  };
+
+  propagatedBuildInputs = [
+    algaeff
+    bwd
+    lsp
+    eio
+    eio_main
+    notty
+  ];
+
+  meta = {
+    description = "Library for constructing and printing compiler diagnostics";
+    homepage = "https://redprl.org/asai/asai/";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/asetmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/asetmap/default.nix
new file mode 100644
index 000000000000..976de44959f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/asetmap/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, topkg
+, findlib
+, ocamlbuild
+, ocaml
+}:
+
+buildDunePackage rec {
+  pname = "asetmap";
+  version = "0.8.1";
+  src = fetchurl {
+    url = "https://github.com/dbuenzli/asetmap/archive/refs/tags/v${version}.tar.gz";
+    sha256 = "051ky0k62xp4inwi6isif56hx5ggazv4jrl7s5lpvn9cj8329frj";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ topkg findlib ocamlbuild ocaml ];
+  buildInputs = [ topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = { inherit (ocaml.meta) platforms; };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix b/nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix
new file mode 100644
index 000000000000..a8e8a9cc847f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, zarith, bigarray-compat, stdlib-shims, ptime, alcotest
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  pname = "asn1-combinators";
+  version = "0.2.6";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-asn1-combinators/releases/download/v${version}/asn1-combinators-v${version}.tbz";
+    sha256 = "sha256-ASreDYhp72IQY3UsHPjqAm9rxwL+0Q35r1ZojikbGpE=";
+  };
+
+  propagatedBuildInputs = [ cstruct zarith bigarray-compat stdlib-shims ptime ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirleft/ocaml-asn1-combinators";
+    description = "Combinators for expressing ASN.1 grammars in OCaml";
+    license = licenses.isc;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/astring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/astring/default.nix
new file mode 100644
index 000000000000..f7478f93b91c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/astring/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+
+let
+  # Use astring 0.8.3 for OCaml < 4.05
+  param =
+    if lib.versionAtLeast ocaml.version "4.05"
+    then {
+      version = "0.8.5";
+      sha256 = "1ykhg9gd3iy7zsgyiy2p9b1wkpqg9irw5pvcqs3sphq71iir4ml6";
+    } else {
+      version = "0.8.3";
+      sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0";
+    };
+in
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-astring";
+  inherit (param) version;
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/astring/releases/astring-${param.version}.tbz";
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    homepage = "https://erratique.ch/software/astring";
+    description = "Alternative String module for OCaml";
+    longDescription = ''
+      Astring exposes an alternative String module for OCaml. This module tries
+      to balance minimality and expressiveness for basic, index-free, string
+      processing and provides types and functions for substrings, string sets
+      and string maps.
+
+      Remaining compatible with the OCaml String module is a non-goal.
+      The String module exposed by Astring has exception safe functions, removes
+      deprecated and rarely used functions, alters some signatures and names,
+      adds a few missing functions and fully exploits OCaml's newfound string
+      immutability.
+    '';
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/atd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/atd/default.nix
new file mode 100644
index 000000000000..16944c7b38bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atd/default.nix
@@ -0,0 +1,24 @@
+{ lib, atdgen-codec-runtime, cmdliner, menhir, easy-format, buildDunePackage, re, yojson, nixosTests }:
+
+buildDunePackage rec {
+  pname = "atd";
+  inherit (atdgen-codec-runtime) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs = [ menhir ];
+  buildInputs = [ cmdliner ];
+  propagatedBuildInputs = [ easy-format re yojson ];
+
+  passthru.tests = {
+    smoke-test = nixosTests.atd;
+  };
+
+  meta = with lib; {
+    description = "Syntax for cross-language type definitions";
+    homepage = "https://github.com/mjambon/atd";
+    license = licenses.mit;
+    maintainers = with maintainers; [ aij ];
+    mainProgram = "atdcat";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix b/nixpkgs/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix
new file mode 100644
index 000000000000..d2a875080eab
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atdgen/codec-runtime.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "atdgen-codec-runtime";
+  version = "2.15.0";
+
+  src = fetchurl {
+    url = "https://github.com/ahrefs/atd/releases/download/${version}/atd-${version}.tbz";
+    hash = "sha256-ukJ5vtVNE9zz9nA6SzF0TbgV3yLAUC2ZZdbGdM4IOTM=";
+  };
+
+  meta = {
+    description = "Runtime for atdgen generated bucklescript converters";
+    homepage = "https://github.com/ahrefs/atd";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix
new file mode 100644
index 000000000000..60bca80fa6f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix
@@ -0,0 +1,22 @@
+{ buildDunePackage, alcotest, atd, atdgen-codec-runtime, atdgen-runtime, biniou, re, yojson
+, python3
+}:
+
+buildDunePackage {
+  pname = "atdgen";
+  inherit (atdgen-codec-runtime) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [ atd re ];
+
+  propagatedBuildInputs = [ atdgen-runtime ];
+
+  doCheck = true;
+  nativeCheckInputs = [ atd (python3.withPackages (ps: [ ps.jsonschema ]))];
+  checkInputs = [ alcotest atdgen-codec-runtime ];
+
+  meta = (builtins.removeAttrs atd.meta [ "mainProgram" ]) // {
+    description = "Generates efficient JSON serializers, deserializers and validators";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/atdgen/runtime.nix b/nixpkgs/pkgs/development/ocaml-modules/atdgen/runtime.nix
new file mode 100644
index 000000000000..c70d3752cdef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atdgen/runtime.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, atdgen-codec-runtime, biniou, yojson }:
+
+buildDunePackage rec {
+  pname = "atdgen-runtime";
+  inherit (atdgen-codec-runtime) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ biniou yojson ];
+
+  meta = atdgen-codec-runtime.meta // {
+    description = "Runtime library for code generated by atdgen";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/awa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/awa/default.nix
new file mode 100644
index 000000000000..559b4fe62c4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/awa/default.nix
@@ -0,0 +1,37 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_sexp_conv
+, mirage-crypto, mirage-crypto-ec, mirage-crypto-rng, mirage-crypto-pk
+, x509, cstruct, cstruct-unix, cstruct-sexp, sexplib, eqaf
+, rresult, mtime, logs, fmt, cmdliner, base64
+, zarith
+}:
+
+buildDunePackage rec {
+  pname = "awa";
+  version = "0.3.1";
+
+  minimalOCamlVersion = "4.10";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/awa-ssh/releases/download/v${version}/awa-${version}.tbz";
+    hash = "sha256-VejHFn07B/zoEG4LjLaen24ig9kAXtERl/pRo6UZCQk=";
+  };
+
+  propagatedBuildInputs = [
+    mirage-crypto mirage-crypto-ec mirage-crypto-rng mirage-crypto-pk x509
+    cstruct cstruct-sexp sexplib mtime
+    logs base64 zarith
+    ppx_sexp_conv eqaf
+  ];
+
+  doCheck = true;
+  checkInputs = [ cstruct-unix cmdliner fmt ];
+
+  meta = with lib; {
+    description = "SSH implementation in OCaml";
+    homepage = "https://github.com/mirage/awa-ssh";
+    changelog = "https://github.com/mirage/awa-ssh/raw/v${version}/CHANGES.md";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix
new file mode 100644
index 000000000000..ebf3ad23fc5b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, awa
+, cstruct, mtime, lwt, mirage-flow, mirage-clock, logs
+, duration, mirage-time
+}:
+
+buildDunePackage {
+  pname = "awa-mirage";
+
+  inherit (awa) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    awa cstruct mtime lwt mirage-flow mirage-clock logs
+    duration mirage-time
+  ];
+
+  inherit (awa) meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/b0/default.nix b/nixpkgs/pkgs/development/ocaml-modules/b0/default.nix
new file mode 100644
index 000000000000..e3c21c31e689
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/b0/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild, cmdliner }:
+
+let
+
+in lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+"b0 is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+
+  pname = "ocaml${ocaml.version}-b0";
+  version = "0.0.5";
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/b0-${version}.tbz";
+    sha256 = "sha256-ty04JQcP4RCme/VQw0ko2IBebWWX5cBU6nRTTeV1I/I=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg cmdliner ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "Software construction and deployment kit";
+    longDescription = ''
+      WARNING this package is unstable and work in progress, do not depend on
+      it.
+      B0 describes software construction and deployments using modular and
+      customizable definitions written in OCaml. B0 describes:
+      * Build environments.
+      * Software configuration, build and testing.
+      * Source and binary deployments.
+      * Software life-cycle procedures.
+      B0 also provides the B00 build library which provides abitrary build
+      abstraction with reliable and efficient incremental rebuilds. The B00
+      library can be – and has been – used on its own to devise domain specific
+      build systems.
+    '';
+    homepage = "https://erratique.ch/software/b0";
+    inherit (ocaml.meta) platforms;
+    license = licenses.isc;
+    maintainers = [ maintainers.Julow ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch b/nixpkgs/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch
new file mode 100644
index 000000000000..0b012848601f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch
@@ -0,0 +1,32 @@
+From e6f6d1529d1725e8c1ed3c96eecc4aea43417aea Mon Sep 17 00:00:00 2001
+From: Matthew Maurer <matthew.r.maurer@gmail.com>
+Date: Sun, 19 Apr 2020 15:50:01 -0700
+Subject: [PATCH] Remove attempt to work around libcurses dependency issues.
+
+BAP doesn't actually link against libcurses, LLVM does. By adding
+-lcurses to this file, we accidentally broke linking on any systems
+where LLVM got linked against libncurses (not libcurses) without a
+libcurses compatibility shim.
+
+Overall, we should get -l flags from llvm-config, not attempt to
+shoehorn them in later, as this is fragile.
+---
+ oasis/llvm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/oasis/llvm b/oasis/llvm
+index 966c407..fba3fb4 100644
+--- a/oasis/llvm
++++ b/oasis/llvm
+@@ -31,7 +31,7 @@ Library bap_llvm
+                  Bap_llvm_ogre_samples,
+                  Bap_llvm_ogre_types
+   CCOpt:         $cc_optimization
+-  CCLib:         $llvm_lib $cxxlibs $llvm_ldflags -lcurses
++  CCLib:         $llvm_lib $cxxlibs $llvm_ldflags -lncurses
+   CSources:      llvm_disasm.h,
+                  llvm_disasm.c,
+                  llvm_stubs.c,
+-- 
+2.22.0
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bap/default.nix
new file mode 100644
index 000000000000..bdbf9b65c3c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bap/default.nix
@@ -0,0 +1,85 @@
+{ lib, stdenv, fetchFromGitHub, fetchurl
+, ocaml, findlib, ocamlbuild, ocaml_oasis
+, bitstring, camlzip, cmdliner, core_kernel, ezjsonm, fileutils, mmap, lwt, ocamlgraph, ocurl, re, uri, zarith, piqi, piqi-ocaml, uuidm, llvm, frontc, ounit, ppx_jane, parsexp
+, utop, libxml2, ncurses
+, linenoise
+, ppx_bap
+, ppx_bitstring
+, yojson
+, which, makeWrapper, writeText
+, z3
+}:
+
+if lib.versionOlder ocaml.version "4.08"
+then throw "BAP is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-bap";
+  version = "2.5.0";
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = "bap";
+    rev = "v${version}";
+    sha256 = "1c30zxn0zyi0wypvjmik3fd6n6a8xjcb102qfnccn1af052bvsrd";
+  };
+
+  sigs = fetchurl {
+     url = "https://github.com/BinaryAnalysisPlatform/bap/releases/download/v${version}/sigs.zip";
+     sha256 = "0d69jd28z4g64mglq94kj5imhmk5f6sgcsh9q2nij3b0arpcliwk";
+  };
+
+  createFindlibDestdir = true;
+
+  setupHook = writeText "setupHook.sh" ''
+    export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}/"
+    export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}-llvm-plugins/"
+  '';
+
+  nativeBuildInputs = [ which makeWrapper ocaml findlib ocamlbuild ocaml_oasis ];
+
+  buildInputs = [ ocamlbuild
+                  linenoise
+                  ounit
+                  ppx_bitstring
+                  z3
+                  utop libxml2 ncurses ];
+
+  propagatedBuildInputs = [ bitstring camlzip cmdliner ppx_bap core_kernel ezjsonm fileutils mmap lwt ocamlgraph ocurl re uri zarith piqi parsexp
+                            piqi-ocaml uuidm frontc yojson ];
+
+  installPhase = ''
+    runHook preInstall
+    export OCAMLPATH=$OCAMLPATH:$OCAMLFIND_DESTDIR;
+    export PATH=$PATH:$out/bin
+    export CAML_LD_LIBRARY_PATH=''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}$OCAMLFIND_DESTDIR/bap-plugin-llvm/:$OCAMLFIND_DESTDIR/bap/
+    mkdir -p $out/lib/bap
+    make install
+    rm $out/bin/baptop
+    makeWrapper ${utop}/bin/utop $out/bin/baptop --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH --add-flags "-ppx ppx-bap -short-paths -require \"bap.top\""
+    wrapProgram $out/bin/bapbuild --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH
+    ln -s $sigs $out/share/bap/sigs.zip
+    runHook postInstall
+  '';
+
+  disableIda = "--disable-ida";
+  disableGhidra = "--disable-ghidra";
+
+  patches = [
+    ./curses_is_ncurses.patch
+  ];
+
+  preConfigure = ''
+    substituteInPlace oasis/elf-loader --replace bitstring.ppx ppx_bitstring
+  '';
+
+  configureFlags = [ "--enable-everything ${disableIda} ${disableGhidra}" "--with-llvm-config=${llvm.dev}/bin/llvm-config" ];
+
+  meta = with lib; {
+    description = "Platform for binary analysis. It is written in OCaml, but can be used from other languages";
+    homepage = "https://github.com/BinaryAnalysisPlatform/bap/";
+    license = licenses.mit;
+    maintainers = [ maintainers.maurer ];
+    mainProgram = "bap";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/base64/default.nix b/nixpkgs/pkgs/development/ocaml-modules/base64/default.nix
new file mode 100644
index 000000000000..be8dabf7f60e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/base64/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, ocaml, findlib, alcotest, bos, rresult }:
+
+buildDunePackage rec {
+  pname = "base64";
+  version = "3.5.1";
+
+  minimalOCamlVersion = "4.03";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-base64/releases/download/v${version}/base64-${version}.tbz";
+    hash = "sha256-2P7apZvRL+rnrMCLWSjdR4qsUj9MqNJARw0lAGUcZe0=";
+  };
+
+  nativeBuildInputs = [ findlib ];
+
+  # otherwise fmt breaks evaluation
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ alcotest bos rresult ];
+
+  meta = {
+    homepage = "https://github.com/mirage/ocaml-base64";
+    description = "Base64 encoding and decoding in OCaml";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix b/nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix
new file mode 100644
index 000000000000..2d013da25683
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, buildDunePackage, ocaml, qtest, qcheck, num, camlp-streams
+, doCheck ? lib.versionAtLeast ocaml.version "4.08"
+}:
+
+buildDunePackage rec {
+  pname = "batteries";
+  version = "3.8.0";
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-batteries-team";
+    repo = "batteries-included";
+    rev = "v${version}";
+    hash = "sha256-Ixqfo2F4VftrIVF8oBOx/rSiJZppiwXOjVQ3Tcelxac=";
+  };
+
+  nativeCheckInputs = [ qtest ];
+  checkInputs = [ qcheck ];
+  propagatedBuildInputs = [ camlp-streams num ];
+
+  inherit doCheck;
+  checkTarget = "test";
+
+  meta = {
+    homepage = "https://ocaml-batteries-team.github.io/batteries-included/hdoc2/";
+    description = "OCaml Batteries Included";
+    longDescription = ''
+      A community-driven effort to standardize on an consistent, documented,
+      and comprehensive development platform for the OCaml programming
+      language.
+    '';
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bdd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bdd/default.nix
new file mode 100644
index 000000000000..358d92d3505d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bdd/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, stdlib-shims
+}:
+
+buildDunePackage {
+  pname = "bdd";
+  version = "unstable-2022-07-14";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "backtracking";
+    repo = "ocaml-bdd";
+    rev = "6d1b1d3c24e5784b87e599a00230ce652acb2dcc";
+    hash = "sha256-3mJZlAFQsI7AgrNQOe6N94CDfX5gXYqQBooV0jcoYEA=";
+  };
+
+  # Fix build with OCaml 4.02
+  postPatch = ''
+    substituteInPlace lib/bdd.ml \
+      --replace "Buffer.truncate Format.stdbuf 0;" "Buffer.clear Format.stdbuf;"
+  '';
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  meta = with lib; {
+    description = "Quick implementation of a Binary Decision Diagrams (BDD) library for OCaml";
+    homepage = "https://github.com/backtracking/ocaml-bdd";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ wegank ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix b/nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix
new file mode 100644
index 000000000000..b0e17054eb53
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix
@@ -0,0 +1,17 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "benchmark";
+  version = "1.6";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ocaml-benchmark/releases/download/${version}/benchmark-${version}.tbz";
+    hash = "sha256-Mw19cYya/MEy52PVRYE/B6TnqCWw5tEz9CUrUfKAnPA=";
+  };
+
+  meta = {
+    homepage = "https://github.com/Chris00/ocaml-benchmark";
+    description = "Benchmark running times of code";
+    license = lib.licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bheap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bheap/default.nix
new file mode 100644
index 000000000000..49e5c336d90b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bheap/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, stdlib-shims }:
+
+buildDunePackage rec {
+  pname = "bheap";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "0dpnpla20lgiicrxl2432m2fcr6y68msw3pnjxqb11xw6yrdfhsz";
+  };
+
+  useDune2 = true;
+
+  doCheck = true;
+  checkInputs = [
+    stdlib-shims
+  ];
+
+  meta = with lib; {
+    description = "OCaml binary heap implementation by Jean-Christophe Filliatre";
+    license = licenses.lgpl21Only;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/backtracking/bheap";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix
new file mode 100644
index 000000000000..be343c444171
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "bigarray-compat";
+  version = "1.1.0";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-2JVopggK2JuXWEPu8qn12F1jQIJ9OV89XY1rHtUqLkI=";
+  };
+
+  meta = {
+    description = "Compatibility library to use Stdlib.Bigarray when possible";
+    inherit (src.meta) homepage;
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix
new file mode 100644
index 000000000000..a913b507eab4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl
+, alcotest, pkg-config
+}:
+
+buildDunePackage rec {
+  pname = "bigarray-overlap";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/overlap/releases/download/v${version}/bigarray-overlap-${version}.tbz";
+    hash = "sha256-L1IKxHAFTjNYg+upJUvyi2Z23bV3U8+1iyLPhK4aZuA=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  nativeBuildInputs = [ pkg-config ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/dinosaure/overlap";
+    description = "Minimal library to know that 2 bigarray share physically the same memory or not";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix
new file mode 100644
index 000000000000..650522363d31
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+
+buildDunePackage rec {
+  pname = "bigstring";
+  version = "0.3";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.03";
+
+  # Ensure compatibility with OCaml ≥ 5.0
+  preConfigure = lib.optional (lib.versionAtLeast ocaml.version "4.08") ''
+    substituteInPlace src/dune --replace '(libraries bytes bigarray)' ""
+  '';
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "ocaml-bigstring";
+    rev = version;
+    sha256 = "0bkxwdcswy80f6rmx5wjza92xzq4rdqsb4a9fm8aav8bdqx021n8";
+  };
+
+  # Circular dependency with bigstring-unix
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://github.com/c-cube/ocaml-bigstring";
+    description = "Bigstring built on top of bigarrays, and convenient functions";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix
new file mode 100644
index 000000000000..1e5d2baed0c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigarray-compat, pkg-config }:
+
+buildDunePackage rec {
+  pname = "bigstringaf";
+  version = "0.9.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    hash = "sha256-HXPjnE56auy2MI6HV2XuBX/VeqsO50HFzTul17lKEqE=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = {
+    description = "Bigstring intrinsics and fast blits based on memcpy/memmove";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bindlib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bindlib/default.nix
new file mode 100644
index 000000000000..c0d8dd54a37b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bindlib/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, earley
+, timed
+}:
+
+buildDunePackage rec {
+  pname = "bindlib";
+  version = "6.0.0";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "rlepigre";
+    repo = "ocaml-${pname}";
+    rev = version;
+    hash = "sha256-058yMbz9ExvgNG/kY9tPk70XSeVRSSKVg4n4F4fmPu4=";
+  };
+
+  checkInputs = [ earley timed ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://rlepigre.github.io/ocaml-bindlib";
+    description = "Efficient binder representation in Ocaml";
+    license = licenses.gpl3;
+    changelog = "https://github.com/rlepigre/ocaml-bindlib/raw/${version}/CHANGELOG.md";
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix b/nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix
new file mode 100644
index 000000000000..2c58a4081401
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage, camlp-streams, easy-format }:
+
+buildDunePackage rec {
+  pname = "biniou";
+  version = "1.2.2";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-community/biniou/releases/download/${version}/biniou-${version}.tbz";
+    hash = "sha256-i/P/F80Oyy1rbR2UywjvCJ1Eyu+W6brmvmg51Cj6MY8=";
+  };
+
+  propagatedBuildInputs = [ camlp-streams easy-format ];
+
+  meta = {
+    description = "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
+    homepage = "https://github.com/ocaml-community/biniou";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "bdump";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/binning/default.nix b/nixpkgs/pkgs/development/ocaml-modules/binning/default.nix
new file mode 100644
index 000000000000..bf448970ef61
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/binning/default.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildDunePackage
+, fetchurl
+}:
+
+buildDunePackage rec {
+  pname = "binning";
+  version = "0.0.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/pveber/binning/releases/download/v${version}/binning-v${version}.tbz";
+    hash = "sha256-eG+xctsbc7lQ5pFOUtJ8rjNW/06gygwLADq7yc8Yf/c=";
+  };
+
+  meta = {
+    description = "Datastructure to accumulate values in bins";
+    license = lib.licenses.cecill-b;
+    homepage = "https://github.com/pveber/binning/";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix
new file mode 100644
index 000000000000..5fa482acc6d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub, fetchpatch
+, ounit, async, base64, camlzip, cfstream
+, core, ppx_jane, ppx_sexp_conv, rresult, uri, xmlm
+}:
+
+buildDunePackage rec {
+  pname = "biocaml";
+  version = "0.11.2";
+
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "biocaml";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "01yw12yixs45ya1scpb9jy2f7dw1mbj7741xib2xpq3kkc1hc21s";
+  };
+
+  patches = fetchpatch {
+    url = "https://github.com/biocaml/biocaml/commit/3ef74d0eb4bb48d2fb7dd8b66fb3ad8fe0aa4d78.patch";
+    sha256 = "0rcvf8gwq7sz15mghl9ing722rl2zpnqif9dfxrnpdxiv0rl0731";
+  };
+
+  buildInputs = [ ppx_jane ppx_sexp_conv ];
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ async base64 camlzip cfstream core rresult uri xmlm ];
+
+  meta = with lib; {
+    description = "Bioinformatics library for Ocaml";
+    homepage = "http://${pname}.org";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/biotk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/biotk/default.nix
new file mode 100644
index 000000000000..33a98f71cb67
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biotk/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, angstrom-unix
+, binning
+, ocaml-crunch
+, camlzip
+, core_kernel
+, core_unix
+, csvfields
+, fmt
+, gsl
+, ppx_csv_conv
+, ppx_deriving
+, rresult
+, tyxml
+, uri
+, vg
+}:
+
+buildDunePackage rec {
+  pname = "biotk";
+  version = "0.2.0";
+
+  minimalOCamlVersion = "4.13";
+
+  src = fetchurl {
+    url = "https://github.com/pveber/biotk/releases/download/v${version}/biotk-${version}.tbz";
+    hash = "sha256-FQvbVj5MmraSN6AmOckKgJ/LB14E/pCsPvPvNppcv7A=";
+  };
+
+  nativeBuildInputs = [ ocaml-crunch ];
+
+  buildInputs = [ ppx_csv_conv ];
+
+  propagatedBuildInputs = [
+    angstrom-unix
+    binning
+    camlzip
+    core_kernel
+    core_unix
+    csvfields
+    fmt
+    gsl
+    ppx_deriving
+    rresult
+    tyxml
+    uri
+    vg
+  ];
+
+  meta = {
+    description = "Toolkit for bioinformatics in OCaml";
+    license = lib.licenses.cecill-c;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix
new file mode 100644
index 000000000000..ae70482fd4b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, cmdliner, ppxlib }:
+
+buildDunePackage rec {
+  pname = "bisect_ppx";
+  version = "2.8.3";
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = "bisect_ppx";
+    rev = version;
+    hash = "sha256-3qXobZLPivFDtls/3WNqDuAgWgO+tslJV47kjQPoi6o=";
+  };
+
+  minimalOCamlVersion = "4.11";
+
+  buildInputs = [
+    cmdliner
+    ppxlib
+  ];
+
+  meta = with lib; {
+    description = "Bisect_ppx is a code coverage tool for OCaml and Reason. It helps you test thoroughly by showing what's not tested";
+    homepage = "https://github.com/aantron/bisect_ppx";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+    mainProgram = "bisect-ppx-report";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix
new file mode 100644
index 000000000000..bb424a5ce9ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, base64
+, bos
+, core
+, core_kernel
+, core_unix ? null
+, lwt_react
+, ocamlgraph
+, ppx_sexp_conv
+, rresult
+, sexplib
+, tyxml
+}:
+
+buildDunePackage rec {
+  pname = "bistro";
+  version = "unstable-2022-05-07";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "pveber";
+    repo = pname;
+    rev = "d363bd2d8257babbcb6db15bd83fd6465df7c268";
+    sha256 = "0g11324j1s2631zzf7zxc8s0nqd4fwvcni0kbvfpfxg96gy2wwfm";
+  };
+
+  patches = [ ./janestreet-0.16.patch ];
+
+  propagatedBuildInputs = [
+    base64
+    bos
+    core
+    core_kernel
+    core_unix
+    lwt_react
+    ocamlgraph
+    ppx_sexp_conv
+    rresult
+    sexplib
+    tyxml
+  ];
+
+  minimalOCamlVersion = "4.12";
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Build and execute typed scientific workflows";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bistro/janestreet-0.16.patch b/nixpkgs/pkgs/development/ocaml-modules/bistro/janestreet-0.16.patch
new file mode 100644
index 000000000000..bf3b41eb4ac8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bistro/janestreet-0.16.patch
@@ -0,0 +1,205 @@
+diff --git a/lib/engine/scheduler.ml b/lib/engine/scheduler.ml
+index e32bd0f..93b566b 100644
+--- a/lib/engine/scheduler.ml
++++ b/lib/engine/scheduler.ml
+@@ -601,7 +601,7 @@ module Make(Backend : Backend) = struct
+               )
+         )
+       | Trywith tw -> (
+-          match Table.find sched.traces (Workflow.id tw.w) with
++          match Hashtbl.find sched.traces (Workflow.id tw.w) with
+           | Some eventual_trace -> (
+               eventual_trace >>= function
+               | Ok (Run r) ->
+@@ -667,10 +667,10 @@ module Make(Backend : Backend) = struct
+   let register_build sched ~id ~build_trace =
+     let open Eval_thread.Infix in
+     (
+-      match Table.find sched.traces id with
++      match Hashtbl.find sched.traces id with
+       | None ->
+         let trace = build_trace () in
+-        Table.set sched.traces ~key:id ~data:trace ;
++        Hashtbl.set sched.traces ~key:id ~data:trace ;
+         trace
+       | Some trace -> trace
+     ) >>= fun trace ->
+@@ -854,7 +854,7 @@ module Make(Backend : Backend) = struct
+         Eval_thread.join l.elts ~f:(build ?target sched)
+       | Trywith tw -> (
+           build sched ?target tw.w >> fun w_result ->
+-          match Table.find sched.traces (Workflow.id tw.w) with
++          match Hashtbl.find sched.traces (Workflow.id tw.w) with
+           | Some eventual_trace -> (
+               eventual_trace >> function
+               | Ok (Run r) when run_trywith_recovery r.details ->
+diff --git a/lib/multinode/bistro_multinode.ml b/lib/multinode/bistro_multinode.ml
+index 01dc5ac..3fc6b0e 100644
+--- a/lib/multinode/bistro_multinode.ml
++++ b/lib/multinode/bistro_multinode.ml
+@@ -130,7 +130,7 @@ module Server = struct
+       let search (type s) (table : s String.Table.t) ~f =
+         let module M = struct exception Found of string * s end in
+         try
+-          String.Table.fold table ~init:() ~f:(fun ~key ~data () -> if f ~key ~data then raise (M.Found (key, data))) ;
++          Hashtbl.fold table ~init:() ~f:(fun ~key ~data () -> if f ~key ~data then raise (M.Found (key, data))) ;
+           None
+         with M.Found (k, v) -> Some (k, v)
+ 
+@@ -145,7 +145,7 @@ module Server = struct
+               match allocation_attempt with
+               | None -> Some elt
+               | Some (worker_id, (Resource curr)) ->
+-                String.Table.set pool.available ~key:worker_id ~data:(Resource { np = curr.np - np ; mem = curr.mem - mem }) ;
++                Hashtbl.set pool.available ~key:worker_id ~data:(Resource { np = curr.np - np ; mem = curr.mem - mem }) ;
+                 Lwt.wakeup u (worker_id, Resource { np ; mem }) ;
+                 None
+             )
+@@ -163,12 +163,12 @@ module Server = struct
+         t
+ 
+       let add_worker pool (Worker { id ; np ; mem ; _ }) =
+-        match String.Table.add pool.available ~key:id ~data:(Allocator.Resource { np ; mem }) with
++        match Hashtbl.add pool.available ~key:id ~data:(Allocator.Resource { np ; mem }) with
+         | `Ok -> allocation_pass pool
+         | `Duplicate -> failwith "A worker has been added twice"
+ 
+       let release pool worker_id (Allocator.Resource { np ; mem }) =
+-        String.Table.update pool.available worker_id ~f:(function
++        Hashtbl.update pool.available worker_id ~f:(function
+             | None -> failwith "Tried to release resources of inexistent worker"
+             | Some (Resource r) -> Resource { np = r.np + np ; mem = r.mem + mem }
+           )
+@@ -235,13 +235,13 @@ module Server = struct
+       | Subscript { np ; mem } ->
+         let id = new_id () in
+         let w = create_worker ~np ~mem id in
+-        String.Table.set state.workers ~key:id ~data:w ;
++        Hashtbl.set state.workers ~key:id ~data:w ;
+         Worker_allocator.add_worker state.alloc w ;
+         log (Logger.Debug (sprintf "new worker %s" id)) ;
+         Lwt.return (Client_id id)
+ 
+       | Get_job { client_id } -> (
+-          match String.Table.find state.workers client_id with
++          match Hashtbl.find state.workers client_id with
+           | None -> Lwt.return None
+           | Some (Worker worker) ->
+             Lwt.choose [
+@@ -250,22 +250,22 @@ module Server = struct
+             ] >>= function
+             | `Job wp ->
+               let workflow_id = workflow_id_of_job_waiter wp in
+-              String.Table.set worker.running_jobs ~key:workflow_id ~data:wp ;
++              Hashtbl.set worker.running_jobs ~key:workflow_id ~data:wp ;
+               Lwt.return (Some (job_of_job_waiter wp))
+             | `Stop -> Lwt.return None
+         )
+ 
+       | Plugin_result r ->
+-        let Worker worker = String.Table.find_exn state.workers r.client_id in
++        let Worker worker = Hashtbl.find_exn state.workers r.client_id in
+         Lwt.return (
+-          match String.Table.find_exn worker.running_jobs r.workflow_id with
++          match Hashtbl.find_exn worker.running_jobs r.workflow_id with
+           | Waiting_plugin wp -> Lwt.wakeup wp.waiter r.result
+           | Waiting_shell_command _ -> assert false (* should never happen *)
+         )
+       | Shell_command_result r ->
+-        let Worker worker = String.Table.find_exn state.workers r.client_id in
++        let Worker worker = Hashtbl.find_exn state.workers r.client_id in
+         Lwt.return (
+-          match String.Table.find_exn worker.running_jobs r.workflow_id with
++          match Hashtbl.find_exn worker.running_jobs r.workflow_id with
+           | Waiting_plugin _ -> assert false (* should never happen *)
+           | Waiting_shell_command wp -> Lwt.wakeup wp.waiter r.result
+         )
+@@ -307,7 +307,7 @@ module Server = struct
+ 
+     let request_resource backend req =
+       Worker_allocator.request backend.state.alloc req >|= fun (worker_id, resource) ->
+-      String.Table.find_exn backend.state.workers worker_id, resource
++      Hashtbl.find_exn backend.state.workers worker_id, resource
+ 
+     let release_resource backend worker_id res =
+       Worker_allocator.release backend.state.alloc worker_id res
+@@ -334,7 +334,7 @@ module Server = struct
+          *   loop () *)
+ 
+     let eval backend { worker_id ; workflow_id } f x =
+-      let Worker worker = String.Table.find_exn backend.state.workers worker_id in
++      let Worker worker = Hashtbl.find_exn backend.state.workers worker_id in
+       let f () = f x in
+       let t, u = Lwt.wait () in
+       let job_waiter = Waiting_plugin { waiter = u ; f ; workflow_id } in
+@@ -342,7 +342,7 @@ module Server = struct
+       t
+ 
+     let run_shell_command backend { worker_id ; workflow_id } cmd =
+-      let Worker worker = String.Table.find_exn backend.state.workers worker_id in
++      let Worker worker = Hashtbl.find_exn backend.state.workers worker_id in
+       let t, u = Lwt.wait () in
+       let job = Waiting_shell_command { waiter = u ; cmd ; workflow_id } in
+       Lwt_queue.push worker.pending_jobs job ;
+diff --git a/lib/utils/dot_output.ml b/lib/utils/dot_output.ml
+index 90c299f..d13fceb 100644
+--- a/lib/utils/dot_output.ml
++++ b/lib/utils/dot_output.ml
+@@ -24,7 +24,7 @@ module G = struct
+   (* let successors   g u = fold_succ (fun h t -> h :: t) g u [] *)
+ 
+   let rec of_workflow_aux seen acc u =
+-    if S.mem seen u then (seen, acc)
++    if Set.mem seen u then (seen, acc)
+     else (
+       let deps = W.Any.deps u in
+       let seen, acc =
+@@ -34,7 +34,7 @@ module G = struct
+       in
+       let acc = add_vertex acc u in
+       let acc = List.fold deps ~init:acc ~f:(fun acc v -> add_edge acc u v) in
+-      let seen = S.add seen u in
++      let seen = Set.add seen u in
+       seen, acc
+     )
+ 
+@@ -109,7 +109,7 @@ let dot_output ?db oc g ~needed =
+     ]
+   in
+   let vertex_attributes u =
+-    let needed = (match db with None -> true | Some _ -> false) || S.mem needed u in
++    let needed = (match db with None -> true | Some _ -> false) || Set.mem needed u in
+     let color = if needed then black else light_gray in
+     let shape = `Shape (shape u) in
+     let W.Any w = u in
+@@ -141,7 +141,7 @@ let dot_output ?db oc g ~needed =
+       | _ -> []
+     in
+     let color =
+-      if (match db with None -> true | Some _ -> false) || (S.mem needed u && not (already_done u))
++      if (match db with None -> true | Some _ -> false) || (Set.mem needed u && not (already_done u))
+       then black else light_gray in
+     style @ [ `Color color ]
+   in
+diff --git a/lib/utils/repo.ml b/lib/utils/repo.ml
+index 06abcd5..206a99e 100644
+--- a/lib/utils/repo.ml
++++ b/lib/utils/repo.ml
+@@ -160,7 +160,7 @@ let protected_set repo =
+     | Select s -> fold_path_workflow acc (W.Any s.dir)
+     | Input _ -> acc
+     | Shell _
+-    | Plugin _ -> String.Set.add acc (W.id w)
++    | Plugin _ -> Set.add acc (W.id w)
+     | Trywith tw ->
+       fold_path_workflow (fold_path_workflow acc (W.Any tw.w)) (W.Any tw.failsafe)
+     | Ifelse ie ->
+@@ -187,7 +187,7 @@ let cache_clip_fold ~bistro_dir repo ~f ~init =
+   let protected = protected_set repo in
+   let db = Db.init_exn bistro_dir in
+   Db.fold_cache db ~init ~f:(fun acc id ->
+-      f db acc (if String.Set.mem protected id then `Protected id else `Unprotected id)
++      f db acc (if Set.mem protected id then `Protected id else `Unprotected id)
+     )
+ 
+ let cache_clip_dry_run ~bistro_dir repo =
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix
new file mode 100644
index 000000000000..4644d4cca861
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, stdlib-shims }:
+
+buildDunePackage rec {
+  pname = "bitstring";
+  version = "4.1.1";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "xguerin";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-eO7/S9PoMybZPnQQ+q9qbqKpYO4Foc9OjW4uiwwNds8=";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  meta = with lib; {
+    description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml";
+    homepage = "https://github.com/xguerin/bitstring";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix
new file mode 100644
index 000000000000..87370ef64b20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, ocaml
+, bitstring, ppxlib
+, ounit
+}:
+
+if lib.versionOlder ppxlib.version "0.18.0"
+then throw "ppx_bitstring is not available with ppxlib-${ppxlib.version}"
+else
+
+buildDunePackage rec {
+  pname = "ppx_bitstring";
+  inherit (bitstring) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [ bitstring ppxlib ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit ];
+
+  meta = bitstring.meta // {
+    description = "Bitstrings and bitstring matching for OCaml - PPX extension";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix
new file mode 100644
index 000000000000..1369ed078d6e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, which, ocaml, findlib }:
+
+if lib.versionOlder ocaml.version "4.02"
+then throw "bitv is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-bitv";
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "backtracking";
+    repo = "bitv";
+    rev = version;
+    sha256 = "sha256-sZwq6c10hBBS9tGvKlWD9GE3JBrZPByfDrXE6xIPcG4=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook which ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "Bit vector library for OCaml";
+    license = lib.licenses.lgpl21;
+    homepage = "https://github.com/backtracking/bitv";
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bjack/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bjack/default.nix
new file mode 100644
index 000000000000..197d31638d61
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bjack/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, Accelerate, CoreAudio, dune-configurator, libsamplerate, libjack2 }:
+
+buildDunePackage rec {
+  pname = "bjack";
+  version = "0.1.6";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-bjack";
+    rev = "v${version}";
+    hash = "sha256-jIxxqBVWphWYyLh+24rTxk4WWfPPdGCvNdevFJEKw70=";
+  };
+
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ Accelerate CoreAudio ];
+  propagatedBuildInputs = [ libsamplerate libjack2 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-bjack";
+    description = "Blocking API for the jack audio connection kit";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bls12-381-signature/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bls12-381-signature/default.nix
new file mode 100644
index 000000000000..e7ca964750e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bls12-381-signature/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, fetchzip
+, buildDunePackage
+, bls12-381
+, alcotest
+, bisect_ppx
+, integers_stubs_js
+,
+}:
+
+buildDunePackage rec {
+  pname = "bls12-381-signature";
+  version = "1.0.0";
+  src = fetchzip {
+    url = "https://gitlab.com/nomadic-labs/cryptography/ocaml-${pname}/-/archive/${version}/ocaml-bls12-381-signature-${version}.tar.bz2";
+    sha256 = "sha256-KaUpAT+BWxmUP5obi4loR9vVUeQmz3p3zG3CBolUuL4=";
+  };
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ bls12-381 ];
+
+  checkInputs = [ alcotest bisect_ppx integers_stubs_js ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Implementation of BLS signatures for the pairing-friendly curve BLS12-381";
+    license = lib.licenses.mit;
+    homepage = "https://gitlab.com/nomadic-labs/cryptography/ocaml-bls12-381-signature";
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix
new file mode 100644
index 000000000000..65b1a476f9dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildDunePackage
+, fetchFromGitLab
+, zarith
+, zarith_stubs_js ? null
+, integers_stubs_js
+, integers
+, hex
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "bls12-381";
+  version = "6.1.0";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "cryptography/ocaml-bls12-381";
+    rev = version;
+    sha256 = "sha256-z2ZSOrXgm+XjdrY91vqxXSKhA0DyJz6JkkNljDZznX8=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  postPatch = ''
+    patchShebangs ./src/*.sh
+  '';
+
+  propagatedBuildInputs = [
+    zarith
+    zarith_stubs_js
+    integers_stubs_js
+    hex
+    integers
+  ];
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "	https://nomadic-labs.gitlab.io/cryptography/ocaml-bls12-381/bls12-381/";
+    description = "Implementation of BLS12-381 and some cryptographic primitives built on top of it";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bls12-381/gen.nix b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/gen.nix
new file mode 100644
index 000000000000..2eaf616a77b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/gen.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitLab, buildDunePackage, ff-sig, zarith }:
+
+buildDunePackage rec {
+  pname = "bls12-381-gen";
+  version = "0.4.4";
+
+  src = fetchFromGitLab {
+    owner = "dannywillems";
+    repo = "ocaml-bls12-381";
+    rev = "${version}-legacy";
+    sha256 = "qocIfQdv9rniOUykRulu2zWsqkzT0OrsGczgVKALRuk=";
+  };
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    ff-sig
+    zarith
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/dannywillems/ocaml-bls12-381";
+    description = "Functors to generate BLS12-381 primitives based on stubs";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bos/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bos/default.nix
new file mode 100644
index 000000000000..9f7ce539e18a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bos/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, astring, fmt, fpath, logs, rresult
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-bos";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/bos/releases/bos-${version}.tbz";
+    sha256 = "sha256-2NYueGsQ1pfgRXIFqO7eqifrzJDxhV8Y3xkMrC49jzc=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ astring fmt fpath logs rresult ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "Basic OS interaction for OCaml";
+    homepage = "https://erratique.ch/software/bos";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/brisk-reconciler/default.nix b/nixpkgs/pkgs/development/ocaml-modules/brisk-reconciler/default.nix
new file mode 100644
index 000000000000..688d78e4c8d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/brisk-reconciler/default.nix
@@ -0,0 +1,35 @@
+{ buildDunePackage, fetchFromGitHub, lib, reason, ppxlib }:
+
+buildDunePackage rec {
+  pname = "brisk-reconciler";
+  version = "unstable-2020-12-02";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "briskml";
+    repo = "brisk-reconciler";
+    rev = "c9d5c4cf5dd17ff2da994de2c3b0f34c72778f70";
+    sha256 = "sha256-AAB4ZzBnwfwFXOAqX/sIT6imOl70F0YNMt96SWOOE9w=";
+  };
+
+  nativeBuildInputs = [ reason ];
+
+  buildInputs = [
+    ppxlib
+  ];
+
+  meta = with lib; {
+    description = "React.js-like reconciler implemented in OCaml/Reason";
+    longDescription = ''
+      Easily model any `tree-shaped state` with simple `stateful functions`.
+
+      Definitions:
+      * tree-shaped state: Any tree shaped-state like the DOM tree, app navigation state, or even rich text document!
+      * stateful functions: Functions that maintain state over time. Imagine that you can take any variable in your function and manage its value over the function's invocation. Now, imagine that any function invocation really creates its own "instance" of the function which will track this state separately from other invocations of this function.
+    '';
+    homepage = "https://github.com/briskml/brisk-reconciler";
+    maintainers = with maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/brr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/brr/default.nix
new file mode 100644
index 000000000000..e010bedebb0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/brr/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchurl
+, ocaml, findlib, ocamlbuild, topkg
+, js_of_ocaml-compiler
+, js_of_ocaml-toplevel
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-brr";
+  version = "0.0.6";
+  src = fetchurl {
+    url = "https://erratique.ch/software/brr/releases/brr-${version}.tbz";
+    hash = "sha256-paYZlzujXsG1S+s/4/kAPBlDuV1Ljorw7okAu4qaAV0=";
+  };
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+  propagatedBuildInputs = [ js_of_ocaml-compiler js_of_ocaml-toplevel ];
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    homepage = "https://erratique.ch/software/brr";
+    description = "Toolkit for programming browsers in OCaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bwd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bwd/default.nix
new file mode 100644
index 000000000000..af606763e22b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bwd/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, qcheck-core }:
+
+buildDunePackage rec {
+  pname = "bwd";
+  version = "2.3.0";
+
+  minimalOCamlVersion = "4.12";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = "ocaml-bwd";
+    rev = version;
+    hash = "sha256-rzn0U/D6kPNsH5hBTElc3d1jfKbgKbjA2JHicpaJtu4=";
+  };
+
+  doCheck = true;
+  checkInputs = [ qcheck-core ];
+
+  meta = {
+    description = "Backward Lists";
+    homepage = "https://github.com/RedPRL/ocaml-bwd";
+    changelog = "https://github.com/RedPRL/ocaml-bwd/blob/${version}/CHANGELOG.markdown";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bytestring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bytestring/default.nix
new file mode 100644
index 000000000000..3714846ee6b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bytestring/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppxlib
+, rio
+, sedlex
+, spices
+, uutf
+, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "bytestring";
+  version = "0.0.8";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/riot-ml/riot/releases/download/${version}/riot-${version}.tbz";
+    hash = "sha256-SsiDz53b9bMIT9Q3IwDdB3WKy98WSd9fiieU41qZpeE=";
+  };
+
+  propagatedBuildInputs = [
+    ppxlib
+    sedlex
+    spices
+    rio
+    uutf
+  ];
+
+  checkInputs = [
+    qcheck
+  ];
+
+  # Checks fail with OCaml 5.2
+  doCheck = false;
+
+  meta = {
+    description = "Efficient, immutable, pattern-matchable, UTF friendly byte strings";
+    homepage = "https://github.com/riot-ml/riot";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix
new file mode 100644
index 000000000000..7e5f256a1a74
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }:
+
+if lib.versionOlder ocaml.version "4.02"
+|| lib.versionAtLeast ocaml.version "5.0"
+then throw "bz2 is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-bz2";
+  version = "0.7.0";
+
+  src = fetchFromGitLab {
+    owner = "irill";
+    repo = "camlbz2";
+    rev = version;
+    sha256 = "sha256-jBFEkLN2fbC3LxTu7C0iuhvNg64duuckBHWZoBxrV/U=";
+  };
+
+  autoreconfFlags = [ "-I" "." ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    ocaml
+    findlib
+  ];
+
+  propagatedBuildInputs = [
+    bzip2
+  ];
+
+  strictDeps = true;
+
+  preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs";
+
+  meta = with lib; {
+    description = "OCaml bindings for the libbz2 (AKA, bzip2) (de)compression library";
+    downloadPage = "https://gitlab.com/irill/camlbz2";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix
new file mode 100644
index 000000000000..308fcf3ac4c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, mirage-crypto
+, mirage-clock
+, x509
+, logs
+, fmt
+, bos
+, astring
+, cmdliner
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "ca-certs-nss";
+  version = "3.101";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ca-certs-nss/releases/download/v${version}/ca-certs-nss-${version}.tbz";
+    hash = "sha256-XE3201P5JXWMRLhCwAa6zwMHEwZjg3ORIKii7tmx/hI=";
+  };
+
+  propagatedBuildInputs = [
+    mirage-crypto
+    mirage-clock
+    x509
+  ];
+
+  buildInputs = [
+    logs
+    fmt
+    bos
+    astring
+    cmdliner
+  ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = with lib; {
+    description = "X.509 trust anchors extracted from Mozilla's NSS";
+    homepage = "https://github.com/mirage/ca-certs-nss";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+    mainProgram = "extract-from-certdata";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix
new file mode 100644
index 000000000000..185944f412e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildDunePackage, fetchurl
+, bos, fpath, ptime, mirage-crypto, x509, astring, logs
+, cacert, alcotest, fmt
+}:
+
+buildDunePackage rec {
+  pname = "ca-certs";
+  version = "0.2.3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ca-certs/releases/download/v${version}/ca-certs-${version}.tbz";
+    hash = "sha256-0tjWRX2RXvbXg974Lzvl7C9W+S4gIU9Y7dY8nC/GDpw=";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ bos fpath ptime mirage-crypto x509 astring logs ];
+
+  doCheck = true;
+  checkInputs = [
+    cacert    # for /etc/ssl/certs/ca-bundle.crt
+    alcotest
+    fmt
+  ];
+
+  meta = with lib; {
+    description = "Detect root CA certificates from the operating system";
+    maintainers = [ maintainers.sternenseemann ];
+    license = licenses.isc;
+    homepage = "https://github.com/mirage/ca-certs";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix
new file mode 100644
index 000000000000..0b560f2004f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchurl, buildDunePackage, ocaml, dune-configurator, pkg-config, cairo
+, ApplicationServices }:
+
+buildDunePackage rec {
+  pname = "cairo2";
+  version = "0.6.4";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tbz";
+    sha256 = "sha256-QDVzUtcgXTpXNYVWQ4MMs0Xy24OP+dGaUyAYdg1GigU=";
+  };
+
+  minimalOCamlVersion = "4.02";
+  useDune2 = true;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ cairo dune-configurator ] ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
+
+  doCheck = !(stdenv.isDarwin
+  # https://github.com/Chris00/ocaml-cairo/issues/19
+  || lib.versionAtLeast ocaml.version "4.10");
+
+  meta = with lib; {
+    homepage = "https://github.com/Chris00/ocaml-cairo";
+    description = "Binding to Cairo, a 2D Vector Graphics Library";
+    longDescription = ''
+      This is a binding to Cairo, a 2D graphics library with support for
+      multiple output devices. Currently supported output targets include
+      the X Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.
+    '';
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ jirkamarsik vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix b/nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix
new file mode 100644
index 000000000000..fcd8058d64c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, re }:
+
+buildDunePackage rec {
+  pname = "calendar";
+  version = "3.0.0";
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-+VQzi6pEMqzV1ZR84Yjdu4jsJEWtx+7bd6PQGX7TiEs=";
+  };
+
+  propagatedBuildInputs = [ re ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Library for handling dates and times";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.gal_bolle ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix b/nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix
new file mode 100644
index 000000000000..68ba880a7987
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+, eqaf
+, fmt
+}:
+
+buildDunePackage rec {
+  pname = "callipyge";
+  version = "0.2";
+
+  src = fetchurl {
+    url = "https://github.com/oklm-wsh/Callipyge/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-T/94a88xvK51TggjXecdKc9kyTE9aIyueIt5T24sZB0=";
+  };
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ fmt eqaf ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/oklm-wsh/Callipyge";
+    description = "Curve25519 in OCaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ fufexan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix
new file mode 100644
index 000000000000..b1d3d51c8666
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitLab, buildDunePackage, findlib, dune-configurator, cppo
+, graphics, lablgtk, stdio
+}:
+
+buildDunePackage rec {
+  pname = "camlimages";
+  version = "5.0.4";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitLab {
+    owner = "camlspotter";
+    repo = pname;
+    rev = version;
+    sha256 = "1m2c76ghisg73dikz2ifdkrbkgiwa0hcmp21f2fm2rkbf02rq3f4";
+  };
+
+  postPatch = ''
+    substituteInPlace core/{images,units}.ml --replace String.lowercase String.lowercase_ascii
+  '';
+
+  nativeBuildInputs = [ cppo ];
+  buildInputs = [ dune-configurator findlib graphics lablgtk stdio ];
+
+  meta = with lib; {
+    branch = "5.0";
+    inherit (src.meta) homepage;
+    description = "OCaml image processing library";
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.vbgl maintainers.mt-caret ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlp-streams/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camlp-streams/default.nix
new file mode 100644
index 000000000000..1e2a71cc0b9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlp-streams/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "camlp-streams";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-kHuFBqu0mjFv53sOtmFZcX2reo5ToaOpItP7P53bfGQ=";
+  };
+
+  meta = {
+    description = "Stream and Genlex libraries for use with Camlp4 and Camlp5";
+    license = lib.licenses.lgpl21Only;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix
new file mode 100644
index 000000000000..dad901ba9c10
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib }:
+
+if lib.versionOlder ocaml.version "4.10"
+then throw "camlpdf is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "2.7";
+  pname = "ocaml${ocaml.version}-camlpdf";
+
+  src = fetchFromGitHub {
+    owner = "johnwhitington";
+    repo = "camlpdf";
+    rev = "v${version}";
+    hash = "sha256-SVmLWffB7GF+Bu0tj5fIvQVMRh6uV3u2G3rC4cVH2Gw=";
+  };
+
+  nativeBuildInputs = [ which ocaml findlib ];
+
+  strictDeps = true;
+
+  preInstall = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+  '';
+
+  meta = with lib; {
+    description = "OCaml library for reading, writing and modifying PDF files";
+    homepage = "https://github.com/johnwhitington/camlpdf";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [vbgl];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlzip/META b/nixpkgs/pkgs/development/ocaml-modules/camlzip/META
new file mode 100644
index 000000000000..44c5168ae518
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlzip/META
@@ -0,0 +1,6 @@
+version="@VERSION@"
+description="reading and writing ZIP, JAR and GZIP files"
+requires="unix"
+archive(byte)="zip.cma"
+archive(native)="zip.cmxa"
+linkopts = ""
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix
new file mode 100644
index 000000000000..3b038f4dfec3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix
@@ -0,0 +1,77 @@
+{lib, stdenv, fetchurl, zlib, ocaml, findlib}:
+
+let
+  common = {
+      patches = [];
+      postPatchInit = ''
+        cp META-zip META-camlzip
+        echo 'directory="../zip"' >> META-camlzip
+      '';
+  };
+  param =
+    if lib.versionAtLeast ocaml.version "4.07"
+    then common // {
+      version = "1.11";
+      url = "https://github.com/xavierleroy/camlzip/archive/rel111.tar.gz";
+      sha256 = "sha256-/7vF3j4cE9wOWScjdtIy0u3pGzJ1UQY9R/3bdPHV7Tc=";
+    } else if lib.versionAtLeast ocaml.version "4.02"
+    then common // {
+      version = "1.10";
+      url = "https://github.com/xavierleroy/camlzip/archive/rel110.tar.gz";
+      sha256 = "X0YcczaQ3lFeJEiTIgjSSZ1zi32KFMtmZsP0FFpyfbI=";
+    } else {
+      version = "1.05";
+      download_id = "1037";
+      url = "http://forge.ocamlcore.org/frs/download.php/${param.download_id}/camlzip-${param.version}.tar.gz";
+      sha256 = "930b70c736ab5a7ed1b05220102310a0a2241564786657abe418e834a538d06b";
+      patches = [./makefile_1_05.patch];
+      postPatchInit = ''
+        substitute ${./META} META --subst-var-by VERSION "${param.version}"
+      '';
+    };
+in
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-camlzip";
+  version = param.version;
+
+  src = fetchurl {
+    inherit (param) url;
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  propagatedBuildInputs = [zlib];
+
+  strictDeps = true;
+
+  inherit (param) patches;
+
+  createFindlibDestdir = true;
+
+  postPatch = param.postPatchInit + ''
+    substituteInPlace Makefile \
+      --subst-var-by ZLIB_LIBDIR "${zlib.out}/lib" \
+      --subst-var-by ZLIB_INCLUDE "${zlib.dev}/include"
+  '';
+
+  buildFlags = [ "all" "allopt" ];
+
+  postInstall = ''
+    ln -s $out/lib/ocaml/${ocaml.version}/site-lib/{,caml}zip
+  '';
+
+  meta = with lib; {
+    homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip";
+    description = "Library for handling ZIP and GZIP files in OCaml";
+    longDescription = ''
+      This Objective Caml library provides easy access to compressed files in
+      ZIP and GZIP format, as well as to Java JAR files.  It provides functions
+      for reading from and writing to compressed files in these formats.
+    '';
+    license = "LGPL+linking exceptions";
+    inherit (ocaml.meta) platforms;
+    maintainers = with maintainers; [ maggesi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch b/nixpkgs/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch
new file mode 100644
index 000000000000..87d0c8bec334
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch
@@ -0,0 +1,54 @@
+diff -Nuar camlzip-1.04/Makefile camlzip-1.04.nixpkgs/Makefile
+--- camlzip-1.04/Makefile	2002-04-22 17:28:57.000000000 +0200
++++ camlzip-1.04.nixpkgs/Makefile	2010-12-12 18:30:49.000000000 +0100
+@@ -4,14 +4,10 @@
+ ZLIB_LIB=-lz
+ 
+ # The directory containing the Zlib library (libz.a or libz.so)
+-ZLIB_LIBDIR=/usr/local/lib
++ZLIB_LIBDIR=@ZLIB_LIBDIR@
+ 
+ # The directory containing the Zlib header file (zlib.h)
+-ZLIB_INCLUDE=/usr/local/include
+-
+-# Where to install the library.  By default: sub-directory 'zip' of
+-# OCaml's standard library directory.
+-INSTALLDIR=`$(OCAMLC) -where`/zip
++ZLIB_INCLUDE=@ZLIB_INCLUDE@
+ 
+ ### End of configuration section
+ 
+@@ -19,10 +15,13 @@
+ OCAMLOPT=ocamlopt
+ OCAMLDEP=ocamldep
+ OCAMLMKLIB=ocamlmklib
++OCAMLFIND=ocamlfind 
+ 
+ OBJS=zlib.cmo zip.cmo gzip.cmo
+ C_OBJS=zlibstubs.o
+ 
++LIBINSTALL_FILES = $(wildcard *.mli *.cmi *.cma *.cmxa *.a *.so)
++
+ all: libcamlzip.a zip.cma
+ 
+ allopt: libcamlzip.a zip.cmxa
+@@ -55,18 +54,7 @@
+ 	rm -f *.o *.a
+ 
+ install:
+-	mkdir -p $(INSTALLDIR)
+-	cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR)
+-	if test -f dllcamlzip.so; then \
+-	  cp dllcamlzip.so $(INSTALLDIR); \
+-          ldconf=`$(OCAMLC) -where`/ld.conf; \
+-          installdir=$(INSTALLDIR); \
+-          if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \
+-          then echo $$installdir >> $$ldconf; fi \
+-        fi
+-
+-installopt:
+-	cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR)
++	$(OCAMLFIND) install zip META $(LIBINSTALL_FILES)
+ 
+ depend:
+ 	gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix b/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix
new file mode 100644
index 000000000000..658daf61c81a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix
@@ -0,0 +1,32 @@
+{stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, camlp4}:
+
+stdenv.mkDerivation {
+  pname = "camomile";
+  version = "0.8.5";
+
+  src = fetchurl {
+    url = "https://github.com/yoriyuki/Camomile/releases/download/rel-0.8.5/camomile-0.8.5.tar.bz2";
+    sha256 = "003ikpvpaliy5hblhckfmln34zqz0mk3y2m1fqvbjngh3h2np045";
+  };
+
+  patches = [ (fetchpatch {
+    url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/camomile/camomile.0.8.5/files/4.05-typing-fix.patch";
+    sha256 = "167279lia6qx62mdcyc5rjsi4gf4yi52wn9mhgd9y1v3754z7fwb";
+  })];
+
+  nativeBuildInputs = [ocaml findlib camlp4 ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://github.com/yoriyuki/Camomile/tree/master/Camomile";
+    description = "Comprehensive Unicode library for OCaml";
+    license = lib.licenses.lgpl21;
+    inherit (ocaml.meta) platforms;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix
new file mode 100644
index 000000000000..e4856062adb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, darwin, fetchFromGitHub, buildDunePackage, ocaml, cppo
+, camlp-streams, dune-site
+, version ? if lib.versionAtLeast ocaml.version "4.08" then "2.0.0" else "1.0.2"
+}:
+
+let params =
+  {
+    "1.0.2" = lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+      "camomile 1 is not available for OCaml ${ocaml.version}" {
+      src = fetchFromGitHub {
+        owner = "yoriyuki";
+        repo = "camomile";
+        rev = version;
+        sha256 = "00i910qjv6bpk0nkafp5fg97isqas0bwjf7m6rz11rsxilpalzad";
+      };
+
+      nativeBuildInputs = [ cppo ];
+
+      configurePhase = ''
+        runHook preConfigure
+        ocaml configure.ml --share $out/share/camomile
+        runHook postConfigure
+      '';
+
+      postInstall = ''
+        echo "version = \"${version}\"" >> $out/lib/ocaml/${ocaml.version}/site-lib/camomile/META
+      '';
+
+    };
+
+    "2.0.0" = {
+      src = fetchFromGitHub {
+        owner = "ocaml-community";
+        repo = "camomile";
+        rev = "v${version}";
+        hash = "sha256-HklX+VPD0Ta3Knv++dBT2rhsDSlDRH90k4Cj1YtWIa8=";
+      };
+
+      nativeBuildInputs = lib.optional stdenv.isDarwin darwin.sigtool;
+
+      propagatedBuildInputs = [ camlp-streams dune-site ];
+    };
+  }
+; in
+
+
+buildDunePackage (params."${version}" // {
+  pname = "camomile";
+  inherit version;
+
+  meta = {
+    homepage = "https://github.com/ocaml-community/Camomile";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.lgpl21;
+    description = "Unicode library for OCaml";
+  };
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/capnp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/capnp/default.nix
new file mode 100644
index 000000000000..2d405dceaab1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/capnp/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, base_quickcheck ? null
+, capnproto
+, ocplib-endian
+, ounit2
+, res
+, result
+, stdint
+, stdio
+}:
+
+buildDunePackage rec {
+  pname = "capnp";
+  version = "3.6.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "capnproto";
+    repo = "capnp-ocaml";
+    rev = "v${version}";
+    hash = "sha256-G4B1llsHnGcuGIarDB248QMaRBvS47IEQB5B93wY7nA=";
+  };
+
+  nativeBuildInputs = [
+    capnproto
+  ];
+
+  buildInputs = [
+    stdio
+  ];
+
+  propagatedBuildInputs = [
+    ocplib-endian
+    res
+    result
+    stdint
+  ];
+
+  checkInputs = [
+    base_quickcheck
+    ounit2
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "OCaml code generation plugin for the Cap'n Proto serialization framework";
+    homepage = "https://github.com/capnproto/capnp-ocaml";
+    changelog = "https://github.com/capnproto/capnp-ocaml/blob/${version}/CHANGES.md";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix
new file mode 100644
index 000000000000..22755be193df
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, async_kernel, async_unix, caqti, core_kernel }:
+
+buildDunePackage {
+  pname = "caqti-async";
+  inherit (caqti) version src;
+
+  minimalOCamlVersion = "4.14";
+
+  propagatedBuildInputs = [ async_kernel async_unix caqti core_kernel ];
+
+  meta = caqti.meta // { description = "Async support for Caqti"; };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix
new file mode 100644
index 000000000000..218f4cf3c120
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, angstrom
+, bigstringaf
+, domain-name
+, dune-site
+, ipaddr
+, logs
+, lwt-dllist
+, mtime
+, ptime
+, uri
+}:
+
+buildDunePackage rec {
+  pname = "caqti";
+  version = "2.1.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/paurkedal/ocaml-caqti/releases/download/v${version}/caqti-v${version}.tbz";
+    hash = "sha256-SDpTX0HiZBkX/BgyzkrRX/w/ToKDsbMBiiYXNJWDCQo=";
+  };
+
+  buildInputs = [ dune-site ];
+  propagatedBuildInputs = [ angstrom bigstringaf domain-name ipaddr logs lwt-dllist mtime ptime uri ];
+
+  # Checks depend on caqti-driver-sqlite3 (circural dependency)
+  doCheck = false;
+
+  meta = {
+    description = "Unified interface to relational database libraries";
+    license = with lib.licenses; [ lgpl3Plus ocamlLgplLinkingException ];
+    maintainers = with lib.maintainers; [ bcc32 ];
+    homepage = "https://github.com/paurkedal/ocaml-caqti";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix
new file mode 100644
index 000000000000..bff515eff381
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, caqti, mariadb }:
+
+buildDunePackage {
+  pname = "caqti-driver-mariadb";
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti mariadb ];
+
+  meta = caqti.meta // {
+    description = "MariaDB driver for Caqti using C bindings";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix
new file mode 100644
index 000000000000..f33e38fab8df
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, caqti, postgresql }:
+
+buildDunePackage {
+  pname = "caqti-driver-postgresql";
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti postgresql ];
+
+  meta = caqti.meta // {
+    description = "PostgreSQL driver for Caqti based on C bindings";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix
new file mode 100644
index 000000000000..ddac07f7fcfb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, caqti, ocaml_sqlite3, alcotest }:
+
+buildDunePackage {
+  pname = "caqti-driver-sqlite3";
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti ocaml_sqlite3 ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = caqti.meta // {
+    description = "Sqlite3 driver for Caqti using C bindings";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix
new file mode 100644
index 000000000000..3dd94fc0e310
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, caqti, findlib }:
+
+buildDunePackage {
+  pname = "caqti-dynload";
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti findlib ];
+
+  meta = caqti.meta // {
+    description = "Dynamic linking of Caqti drivers using findlib.dynload";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix
new file mode 100644
index 000000000000..d06421136280
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix
@@ -0,0 +1,10 @@
+{ lib, buildDunePackage, caqti, logs, lwt }:
+
+buildDunePackage {
+  pname = "caqti-lwt";
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti logs lwt ];
+
+  meta = caqti.meta // { description = "Lwt support for Caqti"; };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix b/nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix
new file mode 100644
index 000000000000..26b0887f20e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, calendar, caqti }:
+
+buildDunePackage {
+  pname = "caqti-type-calendar";
+  inherit (caqti) src version;
+
+  propagatedBuildInputs = [ calendar caqti ];
+
+  meta = caqti.meta // {
+    description = "Date and time field types using the calendar library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch b/nixpkgs/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch
new file mode 100644
index 000000000000..8c7176ee16c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch
@@ -0,0 +1,13 @@
+diff --git a/bin/fiber/fiber.ml b/bin/fiber/fiber.ml
+index 188a92cc9..6087a8687 100644
+--- a/bin/fiber/fiber.ml
++++ b/bin/fiber/fiber.ml
+@@ -129,7 +129,7 @@ let worker pool =
+ 
+ let get_concurrency () =
+   try
+-    let ic = Unix.open_process_in "getconf _NPROCESSORS_ONLN" in
++    let ic = Unix.open_process_in "@getconf@/bin/getconf _NPROCESSORS_ONLN" in
+     let close () = ignore (Unix.close_process_in ic) in
+     let sc = Scanf.Scanning.from_channel ic in
+     try
diff --git a/nixpkgs/pkgs/development/ocaml-modules/carton/default.nix b/nixpkgs/pkgs/development/ocaml-modules/carton/default.nix
new file mode 100644
index 000000000000..7ba02d68ff5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/default.nix
@@ -0,0 +1,73 @@
+{ lib, buildDunePackage, fetchurl
+, ke, duff, decompress, cstruct, optint, bigstringaf
+, checkseum, logs, psq, fmt
+, result, rresult, fpath, base64, bos, digestif, alcotest
+, crowbar, alcotest-lwt, lwt, findlib, mirage-flow, cmdliner, hxd
+, getconf, substituteAll
+}:
+
+buildDunePackage rec {
+  pname = "carton";
+  version = "0.7.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-git/releases/download/${pname}-v${version}/git-${pname}-v${version}.tbz";
+    hash = "sha256-vWkBJdP4ZpRCEwzrFMzsdHay4VyiXix/+1qzk+7yDvk=";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./carton-find-getconf.patch;
+      getconf = "${getconf}";
+    })
+  ];
+
+  # remove changelogs for mimic and the git* packages
+  postPatch = ''
+    rm CHANGES.md
+  '';
+
+  buildInputs = [
+    cmdliner
+    digestif
+    result
+    rresult
+    fpath
+    bos
+    hxd
+  ];
+  propagatedBuildInputs = [
+    ke
+    duff
+    decompress
+    cstruct
+    optint
+    bigstringaf
+    checkseum
+    logs
+    psq
+    fmt
+  ];
+
+  doCheck = true;
+  nativeBuildInputs = [
+    findlib
+  ];
+  checkInputs = [
+    base64
+    alcotest
+    alcotest-lwt
+    crowbar
+    lwt
+    mirage-flow
+  ];
+
+  meta = with lib; {
+    description = "Implementation of PACKv2 file in OCaml";
+    license = licenses.mit;
+    homepage = "https://github.com/mirage/ocaml-git";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/carton/git.nix b/nixpkgs/pkgs/development/ocaml-modules/carton/git.nix
new file mode 100644
index 000000000000..b361ee1447b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/git.nix
@@ -0,0 +1,27 @@
+{ buildDunePackage, carton, carton-lwt
+, bigstringaf, lwt, fpath, result
+, fmt, decompress, astring
+, alcotest, alcotest-lwt, cstruct, logs
+, mirage-flow, rresult, ke
+}:
+
+buildDunePackage {
+  pname = "carton-git";
+
+  inherit (carton) version src postPatch;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    carton
+    carton-lwt
+    bigstringaf
+    lwt
+    fpath
+    result
+    fmt
+    decompress
+    astring
+  ];
+
+  inherit (carton) meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix
new file mode 100644
index 000000000000..cf07eca552ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix
@@ -0,0 +1,49 @@
+{ buildDunePackage, carton
+, lwt, decompress, optint, bigstringaf
+, alcotest, alcotest-lwt, cstruct, fmt, logs
+, mirage-flow, result, rresult
+, ke, base64, bos, checkseum, digestif, fpath
+, stdlib-shims
+, git-binary # pkgs.git
+}:
+
+buildDunePackage {
+  pname = "carton-lwt";
+
+  inherit (carton) version src postPatch;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    carton
+    lwt
+    decompress
+    optint
+    bigstringaf
+  ];
+
+  # Tests fail with git 2.41
+  # see https://github.com/mirage/ocaml-git/issues/617
+  doCheck = false;
+  nativeCheckInputs = [
+    git-binary
+  ];
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    cstruct
+    fmt
+    logs
+    mirage-flow
+    result
+    rresult
+    ke
+    base64
+    bos
+    checkseum
+    digestif
+    fpath
+    stdlib-shims
+  ];
+
+  inherit (carton) meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cfstream/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cfstream/default.nix
new file mode 100644
index 000000000000..ba69c40de016
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cfstream/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, m4, camlp-streams, core_kernel, ounit }:
+
+buildDunePackage rec {
+  pname = "cfstream";
+  version = "1.3.2";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "biocaml";
+    repo   = pname;
+    rev    = version;
+    hash = "sha256-iSg0QsTcU0MT/Cletl+hW6bKyH0jkp7Jixqu8H59UmQ=";
+  };
+
+  patches = [ ./git_commit.patch ./janestreet-0.16.patch ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ m4 ];
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ camlp-streams core_kernel ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Simple Core-inspired wrapper for standard library Stream module";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cfstream/git_commit.patch b/nixpkgs/pkgs/development/ocaml-modules/cfstream/git_commit.patch
new file mode 100644
index 000000000000..596cfdc70927
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cfstream/git_commit.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/dune b/lib/dune
+index 2266b87..344c704 100644
+--- a/lib/dune
++++ b/lib/dune
+@@ -8,7 +8,7 @@
+ (rule
+  (targets GIT_COMMIT)
+  (deps (:x ../bin/git_commit.sh))
+- (action (with-stdout-to %{targets} (run %{x})))
++ (action (with-stdout-to %{targets} (run echo None)))
+ )
+ 
+ (rule
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cfstream/janestreet-0.16.patch b/nixpkgs/pkgs/development/ocaml-modules/cfstream/janestreet-0.16.patch
new file mode 100644
index 000000000000..afc665f30426
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cfstream/janestreet-0.16.patch
@@ -0,0 +1,36 @@
+diff --git a/lib/CFStream_stream.ml b/lib/CFStream_stream.ml
+index 25c0e5a..94da2e3 100644
+--- a/lib/CFStream_stream.ml
++++ b/lib/CFStream_stream.ml
+@@ -287,7 +287,7 @@ let group_aux xs map eq =
+ ;;
+ 
+ let group xs ~f = group_aux xs f Poly.( = )
+-let group_by xs ~eq = group_aux xs ident eq
++let group_by xs ~eq = group_aux xs Fn.id eq
+ 
+ let chunk2 xs =
+   from (fun _ ->
+@@ -615,11 +615,11 @@ let to_hashtbl xs =
+ let of_map t = of_list (Map.to_alist t)
+ 
+ let to_map xs =
+-  fold xs ~init:Map.Poly.empty ~f:(fun accu (key, data) -> Map.Poly.set accu ~key ~data)
++  fold xs ~init:Map.Poly.empty ~f:(fun accu (key, data) -> Map.set accu ~key ~data)
+ ;;
+ 
+ let of_set t = of_list (Set.to_list t)
+-let to_set xs = fold xs ~init:Set.Poly.empty ~f:(fun accu e -> Set.Poly.add accu e)
++let to_set xs = fold xs ~init:Set.Poly.empty ~f:(fun accu e -> Set.add accu e)
+ 
+ module Infix = struct
+   let ( -- ) x y = range x ~until:y
+@@ -660,7 +660,7 @@ module Result = struct
+       | M.E e -> Result.Error e
+     ;;
+ 
+-    let all xs ~f = all_gen ident xs ~f
++    let all xs ~f = all_gen Fn.id xs ~f
+     let all' xs ~f = all_gen (fun x -> Ok x) xs ~f
+     let to_exn = result_to_exn
+ 
diff --git a/nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix b/nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix
new file mode 100644
index 000000000000..28aaad1c46d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, fetchpatch
+, ocaml
+
+, alcotest
+, cstruct
+, mirage-crypto
+}:
+
+buildDunePackage rec {
+  pname = "chacha";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "abeaumont";
+    repo = "ocaml-chacha";
+    rev = version;
+    hash = "sha256-PmeiFloU0k3SqOK1VjaliiCEzDzrzyMSasgnO5fJS1k=";
+  };
+
+  # Ensure compatibility with cstruct ≥ 6.1.0
+  patches = [ (fetchpatch {
+    url = "https://github.com/abeaumont/ocaml-chacha/commit/fbe4a0a808226229728a68f278adf370251196fd.patch";
+    sha256 = "sha256-y7X9toFDrgdv3qmFmUs7K7QS+Gy45rRLulKy48m7uqc=";
+  })];
+
+  minimalOCamlVersion = "4.02";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ cstruct mirage-crypto ];
+
+  # alcotest isn't available for OCaml < 4.05 due to fmt
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/abeaumont/ocaml-chacha";
+    description = "ChaCha20, ChaCha12 and ChaCha8 encryption functions, in OCaml";
+    longDescription = ''
+      An OCaml implementation of ChaCha functions, both ChaCha20 and the reduced
+      ChaCha8 and ChaCha12 functions. The hot loop is implemented in C for efficiency
+      reasons.
+    '';
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ fufexan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix b/nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix
new file mode 100644
index 000000000000..7e3a17ac5600
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix
@@ -0,0 +1,40 @@
+{ lib, fetchurl, buildDunePackage, ocaml, dune-configurator
+, optint
+, fmt, rresult, bos, fpath, astring, alcotest
+}:
+
+buildDunePackage rec {
+  version = "0.5.2";
+  pname = "checkseum";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/checkseum/releases/download/v${version}/checkseum-${version}.tbz";
+    hash = "sha256-nl5P1EBctKi03wCHdUMlGDPgimSZ70LMuNulgt8Nr8g=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [
+    optint
+  ];
+
+  checkInputs = [
+    alcotest
+    bos
+    astring
+    fmt
+    fpath
+    rresult
+  ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
+    homepage = "https://github.com/mirage/checkseum";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "checkseum.checkseum";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/chrome-trace/default.nix b/nixpkgs/pkgs/development/ocaml-modules/chrome-trace/default.nix
new file mode 100644
index 000000000000..9c427d343758
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/chrome-trace/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, dune_3 }:
+
+buildDunePackage rec {
+  pname = "chrome-trace";
+  inherit (dune_3) src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    description = "Chrome trace event generation library";
+    inherit (dune_3.meta) homepage;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cil/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cil/default.nix
new file mode 100644
index 000000000000..4cedb1291e1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cil/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, perl, ocaml, findlib, ocamlbuild }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "cil is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-cil";
+  version = "1.7.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cil/cil-${version}.tar.gz";
+    sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9";
+  };
+
+  nativeBuildInputs = [ perl ocaml findlib ocamlbuild ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  preConfigure = ''
+    substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)'
+    export FORCE_PERL_PREFIX=1
+  '';
+  prefixKey = "-prefix=";
+
+  meta = with lib; {
+    homepage = "http://kerneis.github.io/cil/";
+    description = "Front-end for the C programming language that facilitates program analysis and transformation";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/clap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/clap/default.nix
new file mode 100644
index 000000000000..83d420c80f33
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/clap/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+}:
+
+buildDunePackage rec {
+  pname = "clap";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "rbardou";
+    repo = pname;
+    rev = version;
+    hash = "sha256-IEol27AVYs55ntvNprBxOk3/EsBKAdPkF3Td3w9qOJg=";
+  };
+
+  meta = {
+    description = "Command-Line Argument Parsing, imperative style with a consumption mechanism";
+    license = lib.licenses.mit;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/class_group_vdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/class_group_vdf/default.nix
new file mode 100644
index 000000000000..57f8023f79f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/class_group_vdf/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, lib, fetchFromGitLab, buildDunePackage
+, gmp, pkg-config, dune-configurator
+, zarith, integers
+, alcotest, bisect_ppx
+}:
+
+buildDunePackage (rec {
+  pname = "class_group_vdf";
+  version = "0.0.4";
+  duneVersion = "3";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs/cryptography";
+    repo = "ocaml-chia-vdf";
+    rev = "v${version}";
+    sha256 = "sha256-KvpnX2DTUyfKARNWHC2lLBGH2Ou2GfRKjw05lu4jbBs=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs = [
+    gmp
+    pkg-config
+    dune-configurator
+  ];
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    zarith
+    integers
+  ];
+
+  checkInputs = [
+    alcotest
+    bisect_ppx
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Verifiable Delay Functions bindings to Chia's VDF";
+    homepage = "https://gitlab.com/nomadic-labs/tezos";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
+# Darwin sdk on intel target 10.12 (2016) at the time of writing. It is likely that host will be at least 10.14 (2018). This fix allow it to build and run on 10.14 and build on 10.12 (but don't run).
+// lib.optionalAttrs (lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.14" && stdenv.hostPlatform.isMacOS && stdenv.hostPlatform.isx86_64) {
+  preHook = ''
+    export MACOSX_DEPLOYMENT_TARGET=10.14
+  '';
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cmarkit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cmarkit/default.nix
new file mode 100644
index 000000000000..e2b6d054db10
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cmarkit/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, cmdliner
+, fetchurl
+, findlib
+, ocaml
+, ocamlbuild
+, topkg
+}:
+
+if lib.versionOlder ocaml.version "4.14.0"
+then throw "cmarkit is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "cmarkit";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/cmarkit/releases/cmarkit-${version}.tbz";
+    hash = "sha256-RouM5iU7VeTT0+4yhBgdEmxROeP/X31iqDjd1VI7z5c=";
+  };
+
+  nativeBuildInputs = [
+    ocaml
+    findlib
+    ocamlbuild
+    topkg
+  ];
+
+  buildInputs = [
+    topkg
+    cmdliner
+  ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "CommonMark parser and renderer for OCaml";
+    homepage = "https://erratique.ch/software/cmarkit";
+    changelog = "https://github.com/dbuenzli/cmarkit/blob/v${version}/CHANGES.md";
+    license = licenses.isc;
+    maintainers = [ ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_0.nix b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_0.nix
new file mode 100644
index 000000000000..0265ed18ecb3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_0.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
+
+assert (lib.versionAtLeast ocaml.version "4.03");
+
+stdenv.mkDerivation rec {
+  pname = "cmdliner";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
+    sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
+  };
+
+  nativeBuildInputs = [ ocaml ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+  installTargets = "install install-doc";
+  installFlags = [
+    "LIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/${pname}"
+    "DOCDIR=$(out)/share/doc/${pname}"
+  ];
+  postInstall = ''
+    mv $out/lib/ocaml/${ocaml.version}/site-lib/${pname}/{opam,${pname}.opam}
+  '';
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/cmdliner";
+    description = "OCaml module for the declarative definition of command line interfaces";
+    license = licenses.isc;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_1.nix b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_1.nix
new file mode 100644
index 000000000000..67d55bc756a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/1_1.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "cmdliner 1.1 is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "cmdliner";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
+    sha256 = "sha256-joGA9XO0QPanqMII2rLK5KgjhP7HMtInhNG7bmQWjLs=";
+  };
+
+  nativeBuildInputs = [ ocaml ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+  installTargets = "install install-doc";
+  installFlags = [
+    "LIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/${pname}"
+    "DOCDIR=$(out)/share/doc/${pname}"
+  ];
+  postInstall = ''
+    mv $out/lib/ocaml/${ocaml.version}/site-lib/${pname}/{opam,${pname}.opam}
+  '';
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/cmdliner";
+    description = "OCaml module for the declarative definition of command line interfaces";
+    license = licenses.isc;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix
new file mode 100644
index 000000000000..3236d4775070
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix
@@ -0,0 +1,63 @@
+{ lib
+, buildDunePackage
+, ppx_sexp_conv
+, base
+, async
+, async_kernel
+, async_unix
+, cohttp
+, conduit-async
+, core_unix ? null
+, uri
+, uri-sexp
+, logs
+, fmt
+, sexplib0
+, ipaddr
+, magic-mime
+, ounit
+, mirage-crypto
+, core
+}:
+
+buildDunePackage {
+  pname = "cohttp-async";
+
+  inherit (cohttp)
+    version
+    src
+    ;
+
+  duneVersion = "3";
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    cohttp
+    conduit-async
+    async_kernel
+    async_unix
+    async
+    base
+    core_unix
+    magic-mime
+    logs
+    fmt
+    sexplib0
+    uri
+    uri-sexp
+    ipaddr
+  ];
+
+  # Examples don't compile with core 0.15.  See https://github.com/mirage/ocaml-cohttp/pull/864.
+  doCheck = false;
+  checkInputs = [
+    ounit
+    mirage-crypto
+    core
+  ];
+
+  meta = cohttp.meta // {
+    description = "CoHTTP implementation for the Async concurrency library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix
new file mode 100644
index 000000000000..f95c44f66725
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_sexp_conv, base64, jsonm, re, stringext, uri-sexp
+, ocaml, fmt, alcotest
+, crowbar
+}:
+
+buildDunePackage rec {
+  pname = "cohttp";
+  version = "5.3.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-${version}.tbz";
+    hash = "sha256-9eJz08Lyn/R71+Ftsj4fPWzQGkC+ACCJhbxDTIjUV2s=";
+  };
+
+  postPatch = ''
+    substituteInPlace cohttp/src/dune --replace 'bytes base64' 'base64'
+  '';
+
+  buildInputs = [ jsonm ppx_sexp_conv ];
+
+  propagatedBuildInputs = [ base64 re stringext uri-sexp ];
+
+  doCheck = true;
+  checkInputs = [ fmt alcotest crowbar ];
+
+  meta = {
+    description = "HTTP(S) library for Lwt, Async and Mirage";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/mirage/ocaml-cohttp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix
new file mode 100644
index 000000000000..611abb7751ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-jsoo.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage
+, cohttp, cohttp-lwt, logs, lwt, js_of_ocaml, js_of_ocaml-ppx, js_of_ocaml-lwt
+, nodejs, lwt_ppx
+}:
+
+buildDunePackage {
+  pname = "cohttp-lwt-jsoo";
+  inherit (cohttp-lwt) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    cohttp
+    cohttp-lwt
+    logs
+    lwt
+    js_of_ocaml
+    js_of_ocaml-ppx
+    js_of_ocaml-lwt
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    nodejs
+    lwt_ppx
+  ];
+
+  meta = cohttp-lwt.meta // {
+    description = "CoHTTP implementation for the Js_of_ocaml JavaScript compiler";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix
new file mode 100644
index 000000000000..b360cf0e587e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, cohttp-lwt
+, conduit-lwt-unix, conduit-lwt, ppx_sexp_conv
+, cmdliner, fmt, logs, magic-mime
+, ounit
+, cacert
+}:
+
+buildDunePackage {
+  pname = "cohttp-lwt-unix";
+  inherit (cohttp-lwt) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [ cmdliner ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    cohttp-lwt
+    conduit-lwt
+    conduit-lwt-unix
+    fmt
+    logs
+    magic-mime
+  ];
+
+  # TODO(@sternenseemann): fail for unknown reason
+  # https://github.com/mirage/ocaml-cohttp/issues/675#issuecomment-830692742
+  doCheck = false;
+  checkInputs = [ ounit cacert ];
+
+  meta = cohttp-lwt.meta // {
+    description = "CoHTTP implementation for Unix and Windows using Lwt";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix
new file mode 100644
index 000000000000..42e1d3808639
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, cohttp, lwt, uri, ppx_sexp_conv, logs, sexplib0 }:
+
+buildDunePackage {
+  pname = "cohttp-lwt";
+  inherit (cohttp)
+    version
+    src
+    ;
+
+  duneVersion = "3";
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    cohttp lwt logs sexplib0 uri
+  ];
+
+  meta = cohttp.meta // {
+    description = "CoHTTP implementation using the Lwt concurrency library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix
new file mode 100644
index 000000000000..3b1c82194973
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix
@@ -0,0 +1,25 @@
+{ buildDunePackage, cohttp, cohttp-lwt
+, mirage-flow, mirage-channel, mirage-kv
+, conduit, conduit-mirage, lwt
+, astring, magic-mime
+, ppx_sexp_conv
+}:
+
+buildDunePackage {
+  pname = "cohttp-mirage";
+
+  inherit (cohttp) version src;
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    mirage-flow mirage-channel conduit conduit-mirage mirage-kv
+    lwt cohttp cohttp-lwt astring magic-mime
+  ];
+
+  meta = cohttp.meta // {
+    description = "CoHTTP implementation for the MirageOS unikernel";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cohttp/top.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/top.nix
new file mode 100644
index 000000000000..0a8f54871b1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/top.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, cohttp }:
+
+buildDunePackage {
+  pname = "cohttp-top";
+  inherit (cohttp) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ cohttp ];
+
+  doCheck = true;
+
+  meta = cohttp.meta // {
+    description = "CoHTTP toplevel pretty printers for HTTP types";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/coin/default.nix b/nixpkgs/pkgs/development/ocaml-modules/coin/default.nix
new file mode 100644
index 000000000000..3b746ccfbdce
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/coin/default.nix
@@ -0,0 +1,36 @@
+{ buildDunePackage
+, fetchurl
+, findlib
+, lib
+, ocaml
+, re
+}:
+
+buildDunePackage rec {
+  pname = "coin";
+  version = "0.1.4";
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/coin/releases/download/v${version}/coin-${version}.tbz";
+    sha256 = "sha256:0069qqswd1ik5ay3d5q1v1pz0ql31kblfsnv0ax0z8jwvacp3ack";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace 'ocaml} ' \
+      'ocaml} -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib '
+  '';
+
+  nativeBuildInputs = [ findlib ];
+  buildInputs = [ re ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Library to normalize an KOI8-{U,R} input to Unicode";
+    homepage = "https://github.com/mirage/coin";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    mainProgram = "coin.generate";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/color/default.nix b/nixpkgs/pkgs/development/ocaml-modules/color/default.nix
new file mode 100644
index 000000000000..84d2f11d8629
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/color/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, gg
+}:
+
+buildDunePackage rec {
+  pname = "color";
+  version = "0.2.0";
+
+  useDune2 = true;
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/anuragsoni/color/releases/download/${version}/color-${version}.tbz";
+    sha256 = "0wg3a36i1a7fnz5pf57qzbdghwr6dzp7nnxyrz9m9765lxsn65ph";
+  };
+
+  propagatedBuildInputs = [
+    gg
+  ];
+
+  meta = with lib; {
+    description = "Converts between different color formats";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fgaz ];
+    homepage = "https://github.com/anuragsoni/color";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/colors/default.nix b/nixpkgs/pkgs/development/ocaml-modules/colors/default.nix
new file mode 100644
index 000000000000..00ae0ff7cfe1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/colors/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, mdx
+}:
+
+buildDunePackage rec {
+  pname = "colors";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.13";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/colors/releases/download/${version}/colors-${version}.tbz";
+    hash = "sha256-fY1j9FODVnifwsI8qkKm0QSmssgWqYFXJ7y8o7/KmEY=";
+  };
+
+  doCheck = true;
+
+  checkInputs = [
+    mdx
+  ];
+
+  nativeCheckInputs = [
+    mdx.bin
+  ];
+
+  meta = {
+    description = "Pure OCaml library for manipulating colors across color spaces";
+    homepage = "https://github.com/leostera/colors";
+    changelog = "https://github.com/leostera/colors/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix b/nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix
new file mode 100644
index 000000000000..9522dc552e8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, async, async_ssl ? null, ppx_sexp_conv, ppx_here, uri, conduit
+, core, ipaddr, ipaddr-sexp, sexplib
+}:
+
+buildDunePackage {
+  pname = "conduit-async";
+  inherit (conduit)
+    version
+    src
+    ;
+
+  buildInputs = [ ppx_sexp_conv ppx_here ];
+
+  propagatedBuildInputs = [
+    async
+    async_ssl
+    conduit
+    uri
+    ipaddr
+    ipaddr-sexp
+    core
+    sexplib
+  ];
+
+  meta = conduit.meta // {
+    description = "Network connection establishment library for Async";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix
new file mode 100644
index 000000000000..a9fbb02c5fe9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_sexp_conv, sexplib, astring, uri
+, ipaddr, ipaddr-sexp
+}:
+
+buildDunePackage rec {
+  pname = "conduit";
+  version = "6.2.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-conduit/releases/download/v${version}/conduit-${version}.tbz";
+    hash = "sha256-WdXntiQ3vkibC3nOEf+QrATvOcaD5M78qFh6/cL1W7s=";
+  };
+
+  propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri ppx_sexp_conv ];
+
+  meta = {
+    description = "Network connection establishment library";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ alexfmpe vbgl ];
+    homepage = "https://github.com/mirage/ocaml-conduit";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
new file mode 100644
index 000000000000..144325e6c2b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage
+, conduit-lwt, ppx_sexp_conv, lwt, uri, ipaddr, ipaddr-sexp, ca-certs, logs
+, lwt_ssl, tls, lwt_log, ssl
+}:
+
+buildDunePackage {
+  pname = "conduit-lwt-unix";
+  inherit (conduit-lwt) version src;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    conduit-lwt
+    lwt
+    uri
+    ipaddr
+    ipaddr-sexp
+    tls
+    ca-certs
+    logs
+    lwt_ssl
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt_log
+    ssl
+  ];
+
+  meta = conduit-lwt.meta // {
+    description = "Network connection establishment library for Lwt_unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt.nix
new file mode 100644
index 000000000000..bc64a7869e57
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, ppx_sexp_conv, conduit, lwt, sexplib }:
+
+buildDunePackage {
+  pname = "conduit-lwt";
+  inherit (conduit) version src;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [ conduit lwt sexplib ];
+
+  meta = conduit.meta // {
+    description = "Network connection establishment library for Lwt";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/conduit/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/conduit/mirage.nix
new file mode 100644
index 000000000000..c4a7b304a6e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/mirage.nix
@@ -0,0 +1,25 @@
+{ buildDunePackage, conduit-lwt
+, ppx_sexp_conv, sexplib, uri, cstruct, mirage-flow
+, mirage-flow-combinators, mirage-random, mirage-time, mirage-clock
+, dns-client-mirage, vchan, xenstore, tls, tls-mirage, ipaddr, ipaddr-sexp
+, tcpip, ca-certs-nss
+}:
+
+buildDunePackage {
+  pname = "conduit-mirage";
+
+  inherit (conduit-lwt) version src;
+
+  nativeBuildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    sexplib uri cstruct mirage-clock mirage-flow
+    mirage-flow-combinators mirage-random mirage-time
+    dns-client-mirage conduit-lwt vchan xenstore tls tls-mirage
+    ipaddr ipaddr-sexp tcpip ca-certs-nss
+  ];
+
+  meta = conduit-lwt.meta // {
+    description = "Network connection establishment library for MirageOS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/config-file/default.nix b/nixpkgs/pkgs/development/ocaml-modules/config-file/default.nix
new file mode 100644
index 000000000000..46d513f62dde
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/config-file/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, camlp4 }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-config-file";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz";
+    sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
+  };
+
+  nativeBuildInputs = [ ocaml findlib camlp4 ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://config-file.forge.ocamlcore.org/";
+    platforms = ocaml.meta.platforms or [ ];
+    description = "OCaml library used to manage the configuration file(s) of an application";
+    license = lib.licenses.lgpl2Plus;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/config/default.nix b/nixpkgs/pkgs/development/ocaml-modules/config/default.nix
new file mode 100644
index 000000000000..43ad500602ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/config/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppxlib
+, spices
+}:
+
+buildDunePackage rec {
+  pname = "config";
+  version = "0.0.3";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-sys/config.ml/releases/download/${version}/config-${version}.tbz";
+    hash = "sha256-bcRCfLX2ro8vnQTJiX2aYGJC+eD26vkPynMYg817YFM=";
+  };
+
+  propagatedBuildInputs = [
+    ppxlib
+    spices
+  ];
+
+  meta = {
+    description = "Ergonomic, lightweight conditional compilation through attributes";
+    homepage = "https://github.com/ocaml-sys/config.ml";
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/containers/data.nix b/nixpkgs/pkgs/development/ocaml-modules/containers/data.nix
new file mode 100644
index 000000000000..5d0950494522
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/containers/data.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage, containers
+, ocaml
+, dune-configurator
+, gen, iter, qcheck-core
+, mdx
+}:
+
+buildDunePackage {
+  pname = "containers-data";
+
+  inherit (containers) src version;
+
+  doCheck = containers.doCheck && ocaml.meta.branch != "5.0";
+
+  buildInputs = [ dune-configurator ];
+  nativeCheckInputs = [ mdx.bin ];
+  checkInputs = [ gen iter qcheck-core ];
+
+  propagatedBuildInputs = [ containers ];
+
+  meta = containers.meta // {
+    description = "Set of advanced datatypes for containers";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/containers/default.nix b/nixpkgs/pkgs/development/ocaml-modules/containers/default.nix
new file mode 100644
index 000000000000..252a61369feb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/containers/default.nix
@@ -0,0 +1,42 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml
+, dune-configurator
+, either, seq
+, gen, iter, qcheck-core, uutf, yojson
+}:
+
+buildDunePackage rec {
+  version = "3.13.1";
+  pname = "containers";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "ocaml-containers";
+    rev = "v${version}";
+    hash = "sha256-jkXh/dBRotWXvA77M/+tm39qsCiBsH/HSs+Y9D9QCek=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ either seq ];
+
+  checkInputs = [ gen iter qcheck-core uutf yojson ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    homepage = "https://github.com/c-cube/ocaml-containers";
+    description = "Modular standard library focused on data structures";
+    longDescription = ''
+      Containers is a standard library (BSD license) focused on data structures,
+      combinators and iterators, without dependencies on unix. Every module is
+      independent and is prefixed with 'CC' in the global namespace. Some modules
+      extend the stdlib (e.g. CCList provides safe map/fold_right/append, and
+      additional functions on lists).
+
+      It also features optional libraries for dealing with strings, and
+      helpers for unix and threads.
+    '';
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix
new file mode 100644
index 000000000000..cf322e74760d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix
@@ -0,0 +1,110 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, bos
+, bwd
+, cmdliner
+, containers
+, ezjsonm
+, findlib
+, menhir
+, menhirLib
+, ppx_deriving
+, ppxlib
+, uuseg
+, uutf
+, yuujinchou
+, ounit2
+, qcheck
+, qcheck-core
+}:
+
+let
+  bantorra = buildDunePackage rec {
+    pname = "bantorra";
+    version = "unstable-2022-05-08";
+    src = fetchFromGitHub {
+      owner = "RedPRL";
+      repo = "bantorra";
+      rev = "d05c34295727dd06d0ac4416dc2e258732e8593d";
+      hash = "sha256-s6lUTs3VRl6YhLAn3PO4aniANhFp8ytoTsFAgcOlee4=";
+    };
+
+    propagatedBuildInputs = [ bos ezjsonm findlib ];
+
+    meta = {
+      description = "Extensible Library Management and Path Resolution";
+      homepage = "https://github.com/RedPRL/bantorra";
+      license = lib.licenses.asl20;
+    };
+  };
+  kado = buildDunePackage rec {
+    pname = "kado";
+    version = "unstable-2023-10-03";
+    src = fetchFromGitHub {
+      owner = "RedPRL";
+      repo = "kado";
+      rev = "6b2e9ba2095e294e6e0fc6febc280d80c5799c2b";
+      hash = "sha256-fP6Ade3mJeyOMjuDIvrW88m6E3jfb2z3L8ufgloz4Tc=";
+    };
+
+    propagatedBuildInputs = [ bwd ];
+
+    doCheck = true;
+    checkInputs = [ qcheck-core ];
+
+    meta = {
+      description = "Cofibrations in Cartecian Cubical Type Theory";
+      homepage = "https://github.com/RedPRL/kado";
+      license = lib.licenses.asl20;
+    };
+  };
+in
+
+buildDunePackage {
+  pname = "cooltt";
+  version = "unstable-2023-10-03";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = "cooltt";
+    rev = "a5eaf4db195b5166a7102d47d42724f59cf3de19";
+    hash = "sha256-48bEf59rtPRrCRjab7+GxppjfR2c87HjQ+uKY2Bag0I=";
+  };
+
+  nativeBuildInputs = [
+    menhir
+  ];
+
+  buildInputs = [
+    cmdliner
+    ppxlib
+  ];
+
+  propagatedBuildInputs = [
+    bantorra
+    bwd
+    ezjsonm
+    kado
+    menhirLib
+    ppx_deriving
+    uuseg
+    uutf
+    yuujinchou
+    containers
+  ];
+
+  checkInputs = [
+    ounit2
+    qcheck
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/RedPRL/cooltt";
+    description = "Cool implementation of normalization by evaluation (nbe) & elaboration for Cartesian cubical type theory";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ moni ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cow/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cow/default.nix
new file mode 100644
index 000000000000..eade22efc6e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cow/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage, alcotest
+, uri, xmlm, omd, ezjsonm
+}:
+
+buildDunePackage rec {
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  version = "2.4.0";
+  pname = "cow";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cow/releases/download/v${version}/cow-v${version}.tbz";
+    sha256 = "1x77lwpskda4zyikwxh500xjn90pgdwz6jm7ca7f36pyav4vl6zx";
+  };
+
+  propagatedBuildInputs = [ xmlm uri ezjsonm omd ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Caml on the Web";
+    longDescription = ''
+      Writing web-applications requires a lot of skills: HTML, XML, JSON and
+      Markdown, to name but a few! This library provides OCaml combinators
+      for these web formats.
+    '';
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
new file mode 100644
index 000000000000..30167f1c2ae2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
+
+if lib.versionOlder ocaml.version "4.10"
+then throw "cpdf is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-cpdf";
+  version = "2.7";
+
+  src = fetchFromGitHub {
+    owner = "johnwhitington";
+    repo = "cpdf-source";
+    rev = "v${version}";
+    hash = "sha256-Tm+xvL2HNdQsD04I9eR9tLL0bs5Ls2q+IndLV/p9sHs=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ ncurses ];
+  propagatedBuildInputs = [ camlpdf ];
+
+  strictDeps = true;
+
+  preInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR
+    mkdir -p $out/bin
+    cp cpdf $out/bin
+    mkdir -p $out/share/
+    cp -r doc $out/share
+    cp cpdfmanual.pdf $out/share/doc/cpdf/
+  '';
+
+  meta = with lib; {
+    description = "PDF Command Line Tools";
+    homepage = "https://www.coherentpdf.com/";
+    license = licenses.unfree;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "cpdf";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cpu/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cpu/default.nix
new file mode 100644
index 000000000000..a61a597b2093
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cpu/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, autoconf }:
+
+buildDunePackage rec {
+  pname = "cpu";
+  version = "2.0.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "UnixJunkie";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "1vir6gh1bhvxgj2fcn69c38yhw3jgk7dyikmw789m5ld2csnyjiv";
+  };
+
+  preConfigure = ''
+    autoconf
+    autoheader
+  '';
+
+  nativeBuildInputs = [ autoconf ];
+
+  hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow";
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Core pinning library";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cpuid/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cpuid/default.nix
new file mode 100644
index 000000000000..a0c28bc92d9a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cpuid/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "cpuid";
+  version = "0.1.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/cpuid/releases/download/v${version}/cpuid-v${version}.tbz";
+    sha256 = "08ng4mva6qblb5ipkrxbr0my7ndkc4qwcbswkqgbgir864s74m93";
+  };
+
+  meta = {
+    homepage = "https://github.com/pqwy/cpuid";
+    description = "Detect CPU features from OCaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/crowbar/default.nix b/nixpkgs/pkgs/development/ocaml-modules/crowbar/default.nix
new file mode 100644
index 000000000000..d321abfe9daa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/crowbar/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, ocplib-endian, cmdliner, afl-persistent
+, calendar, fpath, pprint, uutf, uunf, uucp }:
+
+buildDunePackage rec {
+  pname = "crowbar";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner  = "stedolan";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "sha256-0jjwiOZ9Ut+dv5Iw4xNvf396WTehT1VClxY9VHicw4U=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  # disable xmldiff tests, so we don't need to package unmaintained and legacy pkgs
+  postPatch = "rm -rf examples/xmldiff";
+
+  propagatedBuildInputs = [ ocplib-endian cmdliner afl-persistent ];
+  checkInputs = [ calendar fpath pprint uutf uunf uucp ];
+  # uunf is broken on aarch64
+  doCheck = !stdenv.isAarch64;
+
+  meta = with lib; {
+    description = "Property fuzzing for OCaml";
+    homepage = "https://github.com/stedolan/crowbar";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cry/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cry/default.nix
new file mode 100644
index 000000000000..83a1d269060e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cry/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "cry";
+  version = "1.0.3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-cry";
+    rev = "v${version}";
+    hash = "sha256-ea6f2xTVmYekPmzAKasA9mNG4Voxw2MCkfZ9LB9gwbo=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace-warn bytes ""
+  '';
+
+  minimalOCamlVersion = "4.12";
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-cry";
+    description = "OCaml client for the various icecast & shoutcast source protocols";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix
new file mode 100644
index 000000000000..60f64c340543
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix
@@ -0,0 +1,39 @@
+{stdenv, lib, fetchurl, ocaml, findlib}:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "cryptgps is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  pname = "ocaml-cryptgps";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "http://download.camlcity.org/download/cryptgps-0.2.1.tar.gz";
+    sha256 = "1mp7i42cm9w9grmcsa69m3h1ycpn6a48p43y4xj8rsc12x9nav3s";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  strictDeps = true;
+
+  dontConfigure = true;	# Skip configure phase
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://projects.camlcity.org/projects/cryptgps.html";
+    description = "Cryptographic functions for OCaml";
+    longDescription = ''
+      This library implements the symmetric cryptographic algorithms
+      Blowfish, DES, and 3DES. The algorithms are written in O'Caml,
+      i.e. this is not a binding to some C library, but the implementation
+      itself.
+    '';
+    license = lib.licenses.mit;
+    inherit (ocaml.meta) platforms;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix
new file mode 100644
index 000000000000..e104f94d13a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub, zlib, dune-configurator, zarith }:
+
+buildDunePackage rec {
+  pname = "cryptokit";
+  version = "1.19";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "xavierleroy";
+    repo = "cryptokit";
+    rev = "release${lib.replaceStrings ["."] [""] version}";
+    hash = "sha256-8RRAPFgL2pqKotc1I3fIB9q2cNi46SP8pt+0rZM+QUc=";
+  };
+
+  # dont do autotools configuration, but do trigger findlib's preConfigure hook
+  configurePhase = ''
+    runHook preConfigure
+    runHook postConfigure
+  '';
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ zarith zlib ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://pauillac.inria.fr/~xleroy/software.html";
+    description = "Library of cryptographic primitives for OCaml";
+    license = lib.licenses.lgpl2Only;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix
new file mode 100644
index 000000000000..df0a530e062f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, liquidsoap }:
+
+buildDunePackage rec {
+  pname = "csexp";
+  version = "1.5.2";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-dune/csexp/releases/download/${version}/csexp-${version}.tbz";
+    hash = "sha256-GhTdBLtDeaQZkCSFUGKMd5E6nAfzw1wTcLaWDml3h/8=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  passthru.tests = {
+    inherit liquidsoap;
+  };
+
+  meta = with lib; {
+    description = "Minimal support for Canonical S-expressions";
+    homepage = "https://github.com/ocaml-dune/csexp";
+    changelog = "https://github.com/ocaml-dune/csexp/raw/${version}/CHANGES.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix
new file mode 100644
index 000000000000..1fe020f6490b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage, cstruct, async_unix, async, core }:
+
+buildDunePackage rec {
+  pname = "cstruct-async";
+  inherit (cstruct) src version meta;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    async_unix
+    async
+    cstruct
+    core
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix
new file mode 100644
index 000000000000..9877adbcf81a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, fmt, alcotest, crowbar }:
+
+buildDunePackage rec {
+  pname = "cstruct";
+  version = "6.2.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-${version}.tbz";
+    hash = "sha256-mngHM5JYDoNJFI+jq0sbLpidydMNB0AbBMlrfGDwPmI=";
+  };
+
+  buildInputs = [ fmt ];
+
+  doCheck = true;
+  checkInputs = [ alcotest crowbar ];
+
+  meta = {
+    description = "Access C-like structures directly from OCaml";
+    license = lib.licenses.isc;
+    homepage = "https://github.com/mirage/ocaml-cstruct";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix
new file mode 100644
index 000000000000..3aa70e5c9986
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage, cstruct, lwt }:
+
+if lib.versionOlder (cstruct.version or "1") "3"
+then cstruct
+else
+
+  buildDunePackage {
+    pname = "cstruct-lwt";
+    inherit (cstruct) version src meta;
+
+    minimalOCamlVersion = "4.08";
+    duneVersion = "3";
+
+    propagatedBuildInputs = [ cstruct lwt ];
+  }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix
new file mode 100644
index 000000000000..1cae0cc3dea4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, ocaml, cstruct, sexplib, ppxlib
+, ocaml-migrate-parsetree-2
+, ounit, cppo, ppx_sexp_conv, cstruct-unix, cstruct-sexp
+}:
+
+if lib.versionOlder (cstruct.version or "1") "3"
+then cstruct
+else
+
+  buildDunePackage {
+    pname = "ppx_cstruct";
+    inherit (cstruct) version src meta;
+
+    minimalOCamlVersion = "4.08";
+
+    propagatedBuildInputs = [ cstruct ppxlib sexplib ];
+
+    doCheck = !lib.versionAtLeast ocaml.version "5.1";
+    nativeCheckInputs = [ cppo ];
+    checkInputs = [ ounit ppx_sexp_conv cstruct-sexp cstruct-unix ocaml-migrate-parsetree-2 ];
+  }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix
new file mode 100644
index 000000000000..3b28cda15afc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }:
+
+if lib.versionOlder (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage rec {
+  pname = "cstruct-sexp";
+  inherit (cstruct) version src meta;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  propagatedBuildInputs = [ cstruct sexplib ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix
new file mode 100644
index 000000000000..40467a77a57f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage, cstruct }:
+
+if lib.versionOlder (cstruct.version or "1") "3"
+then cstruct
+else
+
+  buildDunePackage {
+    pname = "cstruct-unix";
+    inherit (cstruct) version src meta;
+
+    minimalOCamlVersion = "4.08";
+    duneVersion = "3";
+
+    propagatedBuildInputs = [ cstruct ];
+  }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix b/nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix
new file mode 100644
index 000000000000..f5a6f458bfa2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix
@@ -0,0 +1,19 @@
+{ lib, ocamlPackages }:
+
+let inherit (ocamlPackages) buildDunePackage csv uutf; in
+
+buildDunePackage {
+  pname = "csvtool";
+  inherit (csv) src version;
+
+  duneVersion = "3";
+
+  buildInputs = [ csv uutf ];
+
+  doCheck = true;
+
+  meta = csv.meta // {
+    description = "Command line tool for handling CSV files";
+    mainProgram = "csvtool";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/csv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/csv/default.nix
new file mode 100644
index 000000000000..0846a3579855
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "csv";
+  version = "2.4";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ocaml-${pname}/releases/download/${version}/csv-${version}.tbz";
+    sha256 = "13m9n8mdss6jfbiw7d5bybxn4n85vmg4zw7dc968qrgjfy0w9zhk";
+  };
+
+  preConfigure = ''
+    substituteInPlace src/dune --replace '(libraries bytes)' ""
+  '';
+
+  duneVersion = "3";
+
+  meta = {
+    description = "Pure OCaml library to read and write CSV files";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/Chris00/ocaml-csv";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix
new file mode 100644
index 000000000000..8e91decfd65f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, csv, lwt }:
+
+buildDunePackage {
+  pname = "csv-lwt";
+  inherit (csv) src version meta;
+
+  preConfigure = ''
+    substituteInPlace lwt/dune --replace '(libraries   bytes' '(libraries '
+  '';
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ csv lwt ];
+
+  doCheck = true;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix
new file mode 100644
index 000000000000..fa7bf6a587f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, ocaml
+, fetchFromGitHub
+, buildDunePackage
+, dune-configurator
+, integers
+, bigarray-compat
+, ounit2
+}:
+
+buildDunePackage rec {
+  pname = "ctypes";
+  version = "0.22.0";
+
+  src = fetchFromGitHub {
+    owner = "ocamllabs";
+    repo = "ocaml-ctypes";
+    rev = version;
+    hash = "sha256-xgDKupQuakjHTbjoap/r2aAjNQUpH9K4HmeLbbgw1x4=";
+  };
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ integers bigarray-compat ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit2 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ocamllabs/ocaml-ctypes";
+    description = "Library for binding to C libraries using pure OCaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ctypes/foreign.nix b/nixpkgs/pkgs/development/ocaml-modules/ctypes/foreign.nix
new file mode 100644
index 000000000000..5c9efad790f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ctypes/foreign.nix
@@ -0,0 +1,23 @@
+{ buildDunePackage
+, ctypes
+, dune-configurator
+, libffi
+, ounit2
+, lwt
+}:
+
+buildDunePackage rec {
+  pname = "ctypes-foreign";
+
+  inherit (ctypes) version src doCheck;
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ ctypes libffi ];
+
+  checkInputs = [ ounit2 lwt ];
+
+  meta = ctypes.meta // {
+    description = "Dynamic access to foreign C libraries using Ctypes";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ctypes_stubs_js/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ctypes_stubs_js/default.nix
new file mode 100644
index 000000000000..c8913ce9bb0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ctypes_stubs_js/default.nix
@@ -0,0 +1,39 @@
+{
+  lib, fetchFromGitLab, buildDunePackage
+, integers_stubs_js, ctypes, ppx_expect
+, js_of_ocaml-compiler
+, nodejs
+}:
+
+buildDunePackage rec {
+  pname = "ctypes_stubs_js";
+  version = "0.1";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-OJIzg2hnwkXkQHd4bRR051eLf4HNWa/XExxbj46SyUs=";
+  };
+
+  propagatedBuildInputs = [ integers_stubs_js ];
+  nativeCheckInputs = [
+    nodejs
+    js_of_ocaml-compiler
+  ];
+  checkInputs = [
+    ctypes
+    ppx_expect
+  ];
+  doCheck = true;
+
+  meta = {
+    description = "Js_of_ocaml Javascript stubs for the OCaml ctypes library";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bezmuth ];
+    homepage = "https://gitlab.com/nomadic-labs/ctypes_stubs_js";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix
new file mode 100644
index 000000000000..1be0a0e49ce2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, ocaml, fetchFromGitLab, extlib, ounit2 }:
+
+buildDunePackage rec {
+  pname = "cudf";
+  version = "0.10";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitLab {
+    owner = "irill";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-E4KXKnso/Q3ZwcYpKPgvswNR9qd/lafKljPMxfStedM=";
+  };
+
+  propagatedBuildInputs = [
+    extlib
+  ];
+
+  checkInputs = [
+    ounit2
+  ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    description = "Library for CUDF format";
+    homepage = "https://www.mancoosi.org/cudf/";
+    downloadPage = "https://gforge.inria.fr/projects/cudf/";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/curly/default.nix b/nixpkgs/pkgs/development/ocaml-modules/curly/default.nix
new file mode 100644
index 000000000000..03918c0d4829
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/curly/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, buildDunePackage, fetchurl, ocaml
+, result, alcotest, cohttp-lwt-unix, odoc, curl, cacert
+}:
+
+buildDunePackage rec {
+  pname = "curly";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.03";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
+    hash = "sha256-Qn/PKBNOcMt3dk2f7uJD8x0yo4RHobXSjTQck7fcXTw=";
+  };
+
+  propagatedBuildInputs = [ result ];
+  nativeCheckInputs = [ cacert ];
+  checkInputs = [ alcotest cohttp-lwt-unix ];
+  # test dependencies are only available for >= 4.08
+  # https://github.com/mirage/ca-certs/issues/16
+  doCheck = lib.versionAtLeast ocaml.version "4.08"
+    # Some test fails in macOS sandbox
+    # > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
+    && !stdenv.isDarwin;
+
+  postPatch = ''
+    substituteInPlace src/curly.ml \
+      --replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
+    '';
+
+  meta = with lib; {
+    description = "Curly is a brain dead wrapper around the curl command line utility";
+    homepage = "https://github.com/rgrinberg/curly";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/curses/default.nix b/nixpkgs/pkgs/development/ocaml-modules/curses/default.nix
new file mode 100644
index 000000000000..23c098aedcb5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/curses/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-curses";
+  version = "1.0.8";
+
+  src = fetchFromGitHub {
+    owner = "mbacarella";
+    repo = "curses";
+    rev = version;
+    sha256 = "0yy3wf8i7jgvzdc40bni7mvpkvclq97cgb5fw265mrjj0iqpkqpd";
+  };
+
+  strictDeps = true;
+
+  propagatedBuildInputs = [ ncurses ];
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  # Fix build for recent ncurses versions
+  env.NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1";
+
+  createFindlibDestdir = true;
+
+  postPatch = ''
+    substituteInPlace curses.ml --replace "pp gcc" "pp $CC"
+  '';
+
+  buildPhase = "make all opt";
+
+  meta = with lib; {
+    description = "OCaml Bindings to curses/ncurses";
+    homepage = "https://github.com/mbacarella/curses";
+    license = licenses.lgpl21Plus;
+    changelog = "https://github.com/mbacarella/curses/raw/${version}/CHANGES";
+    maintainers = [ ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dap/default.nix
new file mode 100644
index 000000000000..054020ba64e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dap/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchurl
+, angstrom-lwt-unix, lwt, logs, lwt_ppx, ppx_deriving_yojson, ppx_expect, ppx_here, react
+}:
+
+buildDunePackage rec {
+  pname = "dap";
+  version = "1.0.6";
+  duneVersion = "3";
+  src = fetchurl {
+    url = "https://github.com/hackwaly/ocaml-dap/releases/download/${version}/dap-${version}.tbz";
+    sha256 = "1zq0f8429m38a4x3h9n3rv7n1vsfjbs72pfi5902a89qwyilkcp0";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [
+    lwt_ppx
+  ];
+
+  propagatedBuildInputs = [
+    angstrom-lwt-unix
+    logs
+    lwt
+    ppx_deriving_yojson
+    ppx_expect
+    ppx_here
+    react
+  ];
+
+  meta = {
+    description = "Debug adapter protocol";
+    homepage = "https://github.com/hackwaly/ocaml-dap";
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix b/nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix
new file mode 100644
index 000000000000..c9a102366fdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildDunePackage
+, ppx_hash
+, bigstringaf
+, either
+, ezjsonm
+, zarith
+, zarith_stubs_js ? null
+, hex
+, json-data-encoding
+, json-data-encoding-bson
+, alcotest
+, crowbar
+, ppx_expect
+}:
+
+buildDunePackage rec {
+  pname = "data-encoding";
+  inherit (json-data-encoding) src version;
+
+  minimalOCamlVersion = "4.10";
+
+  propagatedBuildInputs = [
+    bigstringaf
+    either
+    ezjsonm
+    ppx_hash
+    zarith
+    zarith_stubs_js
+    hex
+    json-data-encoding
+    json-data-encoding-bson
+  ];
+
+  buildInputs = [
+    ppx_expect
+  ];
+
+  meta = {
+    homepage = "https://gitlab.com/nomadic-labs/data-encoding";
+    description = "Library of JSON and binary encoding combinators";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dates_calc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dates_calc/default.nix
new file mode 100644
index 000000000000..d577cd61664a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dates_calc/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, alcotest, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "dates_calc";
+  version = "0.0.4";
+
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "catalalang";
+    repo = "dates-calc";
+    rev = version;
+    sha256 = "sha256-tpKOoPVXkg/k+NW5R8A4fGAKhdMn9UcqMogCjafJuw4=";
+  };
+
+  propagatedBuildInputs = [];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    qcheck
+  ];
+
+  meta = {
+    description = "Date calculation library";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/catalalang/dates-calc";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dbf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dbf/default.nix
new file mode 100644
index 000000000000..664cb5dead17
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dbf/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchFromGitHub, ppx_cstruct, rresult, cstruct-unix
+, core_kernel }:
+
+buildDunePackage rec {
+  pname = "dbf";
+  version = "0.1.1";
+
+  minimalOCamlVersion = "4.08";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "pveber";
+    repo = "dbf";
+    rev = version;
+    hash = "sha256-h1K5YDLbXGEJi/quKXvSR0gZ+WkBzut7AsVFv+Bm8/g=";
+  };
+
+  buildInputs = [ ppx_cstruct ];
+  propagatedBuildInputs = [ rresult cstruct-unix core_kernel ];
+
+  meta = with lib; {
+    description = "DBF format parsing";
+    homepage = "https://github.com/pveber/dbf";
+    license = licenses.isc;
+    maintainers = [ maintainers.deltadelta ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix b/nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix
new file mode 100644
index 000000000000..b20ef17d08b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage
+, checkseum, optint, cmdliner
+, bigstringaf, alcotest, camlzip, base64, ctypes, fmt, crowbar, rresult
+, astring, bos
+}:
+
+buildDunePackage rec {
+  pname = "decompress";
+  version = "1.5.3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/decompress/releases/download/v${version}/decompress-${version}.tbz";
+    hash = "sha256-+R5peL7/P8thRA0y98mcmfHoZUtPsYQIdB02A1NzrGA=";
+  };
+
+  buildInputs = [ cmdliner ];
+  propagatedBuildInputs = [ optint checkseum ];
+  checkInputs = [ alcotest astring bigstringaf bos ctypes fmt camlzip base64 crowbar rresult ];
+  doCheck = true;
+
+  meta = {
+    description = "Pure OCaml implementation of Zlib";
+    homepage = "https://github.com/mirage/decompress";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "decompress.pipe";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dedukti/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dedukti/default.nix
new file mode 100644
index 000000000000..8f6305824f4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dedukti/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, cmdliner
+, menhir
+}:
+
+buildDunePackage rec {
+  pname = "dedukti";
+  version = "2.7";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "Deducteam";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-SFxbgq2znO+OCEFzuekVquvtOEuCQanseKy+iZAeWbc=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  buildInputs = [ cmdliner ];
+
+  doCheck = false;  # requires `tezt`
+
+  meta = with lib; {
+    homepage = "https://deducteam.github.io";
+    description = "Logical framework based on the λΠ-calculus modulo rewriting";
+    license = licenses.cecill-b;
+    changelog = "https://github.com/Deducteam/Dedukti/raw/${version}/CHANGELOG.md";
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/diet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/diet/default.nix
new file mode 100644
index 000000000000..5be9cde83661
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/diet/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, ocaml, stdlib-shims, ounit }:
+
+buildDunePackage rec {
+  pname = "diet";
+  version = "0.4";
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz";
+    sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-diet";
+    description = "Simple implementation of Discrete Interval Encoding Trees";
+    license = licenses.isc;
+    maintainers = with maintainers; [ ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix b/nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix
new file mode 100644
index 000000000000..4bdc9f2e5ca2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix
@@ -0,0 +1,33 @@
+{ lib, ocaml, fetchurl, buildDunePackage
+, eqaf
+, alcotest, astring, bos, findlib, fpath
+}:
+
+buildDunePackage rec {
+  pname = "digestif";
+  version = "1.1.4";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/digestif/releases/download/v${version}/digestif-${version}.tbz";
+    hash = "sha256-w3k+cg8NqAVPYobFRcghp/6+iC5/TlSX7ImxWjU1EeE=";
+  };
+
+  propagatedBuildInputs = [ eqaf ];
+
+  checkInputs = [ alcotest astring bos fpath ];
+  doCheck = true;
+
+  postCheck = ''
+    ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ test/test_runes.ml
+  '';
+
+  meta = {
+    description = "Simple hash algorithms in OCaml";
+    homepage = "https://github.com/mirage/digestif";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/directories/default.nix b/nixpkgs/pkgs/development/ocaml-modules/directories/default.nix
new file mode 100644
index 000000000000..79f994458ca6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/directories/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "directories";
+  version = "0.5";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "ocamlpro";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-31CGhmmfOORJ1ewgp+IU+p1+f2kfX/W+lxK7EGU62vc=";
+  };
+
+  meta = {
+    homepage = "https://github.com/ocamlpro/directories";
+    description = "OCaml library that provides configuration, cache and data paths (and more!) following the suitable conventions on Linux, macOS and Windows";
+    longDescription = ''
+      directories is an OCaml library that provides configuration, cache and
+      data paths (and more!) following the suitable conventions on Linux, macOS
+      and Windows. It is inspired by similar libraries for other languages such
+      as directories-jvm.
+
+      The following conventions are used: XDG Base Directory Specification and
+      xdg-user-dirs on Linux, Known Folders on Windows, Standard Directories on
+      macOS.
+    '';
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ bcc32 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dispatch/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dispatch/default.nix
new file mode 100644
index 000000000000..958574f3d973
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dispatch/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, alcotest, result }:
+
+buildDunePackage rec {
+  pname = "dispatch";
+  version = "0.5.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "ocaml-dispatch";
+    rev = version;
+    sha256 = "12r39ylbxc297cbwjadhd1ghxnwwcdzfjk68r97wim8hcgzxyxv4";
+  };
+
+  propagatedBuildInputs = [ result ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    inherit (src.meta) homepage;
+    license = lib.licenses.bsd3;
+    description = "Path-based dispatching for client- and server-side applications";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/certify.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/certify.nix
new file mode 100644
index 000000000000..3260e139fbbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/certify.nix
@@ -0,0 +1,35 @@
+{ buildDunePackage, dns, dns-tsig, dns-mirage, randomconv, x509
+, mirage-random, mirage-time, mirage-clock
+, logs, mirage-crypto-pk, mirage-crypto-rng, mirage-crypto-ec, lwt
+, tcpip
+}:
+
+buildDunePackage {
+  pname = "dns-certify";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    dns-tsig
+    dns-mirage
+    randomconv
+    x509
+    mirage-random
+    mirage-time
+    mirage-clock
+    logs
+    mirage-crypto-pk
+    mirage-crypto-rng
+    mirage-crypto-ec
+    lwt
+    tcpip
+  ];
+
+  doCheck = true;
+
+  meta = dns.meta // {
+    description = "MirageOS let's encrypt certificate retrieval";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix
new file mode 100644
index 000000000000..8c1ff57bc9b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix
@@ -0,0 +1,50 @@
+{ buildDunePackage, dns, dns-tsig, dns-client-lwt, dns-server, dns-certify, dnssec
+, bos, cmdliner, fpath, x509, mirage-crypto, mirage-crypto-pk
+, mirage-crypto-rng, hex, ptime, mtime, logs, fmt, ipaddr, lwt
+, randomconv, alcotest
+}:
+
+buildDunePackage {
+  pname = "dns-cli";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  # no need to propagate as this is primarily
+  # an executable package
+  buildInputs = [
+    dns
+    dns-tsig
+    dns-client-lwt
+    dns-server
+    dns-certify
+    dnssec
+    bos
+    cmdliner
+    fpath
+    x509
+    mirage-crypto
+    mirage-crypto-pk
+    mirage-crypto-rng
+    hex
+    ptime
+    mtime
+    logs
+    fmt
+    ipaddr
+    lwt
+    randomconv
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+  ];
+
+  meta = dns.meta // {
+    description = "Unix command line utilities using uDNS";
+    mainProgram = "odns";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/client-lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/client-lwt.nix
new file mode 100644
index 000000000000..f17b8ed0759c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/client-lwt.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, dns, dns-client, lwt, mirage-clock, mirage-time
+, mirage-random, mirage-crypto-rng, mtime, randomconv
+, cstruct, fmt, logs, rresult, domain-name, ipaddr, alcotest
+, ca-certs, ca-certs-nss
+, happy-eyeballs
+, tcpip
+, tls-lwt
+}:
+
+buildDunePackage {
+  pname = "dns-client-lwt";
+  inherit (dns) src version;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    dns-client
+    ipaddr
+    lwt
+    ca-certs
+    happy-eyeballs
+    tls-lwt
+    mtime
+    mirage-crypto-rng
+  ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = dns-client.meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/client-mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/client-mirage.nix
new file mode 100644
index 000000000000..2e0768d2b7ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/client-mirage.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, dns, dns-client, lwt, mirage-clock, mirage-time
+, mirage-random, mirage-crypto-rng, mtime, randomconv
+, cstruct, fmt, logs, rresult, domain-name, ipaddr, alcotest
+, ca-certs, ca-certs-nss
+, happy-eyeballs
+, tcpip
+, tls, tls-mirage
+}:
+
+buildDunePackage {
+  pname = "dns-client-mirage";
+  inherit (dns) src version;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns-client
+    domain-name
+    ipaddr
+    lwt
+    mirage-random
+    mirage-time
+    mirage-clock
+    ca-certs-nss
+    happy-eyeballs
+    tcpip
+    tls
+    tls-mirage
+  ];
+  doCheck = true;
+
+  meta = dns-client.meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/client.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/client.nix
new file mode 100644
index 000000000000..bc859945e4e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/client.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, dns, lwt, mirage-clock, mirage-time
+, mirage-random, mirage-crypto-rng, mtime, randomconv
+, cstruct, fmt, logs, rresult, domain-name, ipaddr, alcotest
+, ca-certs, ca-certs-nss
+, happy-eyeballs
+, tcpip
+, tls, tls-mirage
+}:
+
+buildDunePackage {
+  pname = "dns-client";
+  inherit (dns) src version;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    randomconv
+    domain-name
+    mtime
+    mirage-crypto-rng
+  ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = dns.meta // {
+    description = "Pure DNS resolver API";
+    mainProgram = "dns-client.unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/default.nix
new file mode 100644
index 000000000000..a4f197274500
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+, cstruct
+, domain-name
+, duration
+, gmap
+, ipaddr
+, logs
+, lru
+, metrics
+, ptime
+, fmt
+, base64
+}:
+
+buildDunePackage rec {
+  pname = "dns";
+  version = "7.0.1";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-dns/releases/download/v${version}/dns-${version}.tbz";
+    hash = "sha256-vDe1U1NbbIPcD1AmMG265ke7651C64mds7KcFHUN4fU=";
+  };
+
+  propagatedBuildInputs = [ fmt logs ptime domain-name gmap cstruct ipaddr lru duration metrics base64 ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Domain Name System (DNS) library";
+    homepage = "https://github.com/mirage/ocaml-dns";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/dnssec.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/dnssec.nix
new file mode 100644
index 000000000000..de2a76052384
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/dnssec.nix
@@ -0,0 +1,38 @@
+{ buildDunePackage
+, cstruct
+, dns
+, mirage-crypto
+, mirage-crypto-pk
+, mirage-crypto-ec
+, domain-name
+, logs
+, alcotest
+, base64
+}:
+
+buildDunePackage {
+  pname = "dnssec";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    cstruct
+    dns
+    mirage-crypto
+    mirage-crypto-pk
+    mirage-crypto-ec
+    domain-name
+    logs
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    base64
+  ];
+
+  meta = dns.meta // {
+    description = "DNSSec support for OCaml-DNS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix
new file mode 100644
index 000000000000..aba32efe5245
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, dns, ipaddr, lwt, tcpip }:
+
+buildDunePackage {
+  pname = "dns-mirage";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    ipaddr
+    lwt
+    tcpip
+  ];
+
+  meta = dns.meta // {
+    description = "Opinionated Domain Name System (DNS) library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix
new file mode 100644
index 000000000000..dd46a1534ed3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix
@@ -0,0 +1,50 @@
+{ buildDunePackage
+, dns
+, dns-server
+, dns-mirage
+, lru
+, duration
+, randomconv
+, lwt
+, mirage-time
+, mirage-clock
+, mirage-random
+, tcpip
+, tls
+, tls-mirage
+, dnssec
+, alcotest
+}:
+
+buildDunePackage {
+  pname = "dns-resolver";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    dns-server
+    dns-mirage
+    dnssec
+    lru
+    duration
+    randomconv
+    lwt
+    mirage-time
+    mirage-clock
+    mirage-random
+    tcpip
+    tls
+    tls-mirage
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+  ];
+
+  meta = dns.meta // {
+    description = "DNS resolver business logic";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/server.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/server.nix
new file mode 100644
index 000000000000..049cf507e3ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/server.nix
@@ -0,0 +1,44 @@
+{ buildDunePackage
+, dns
+, dns-mirage
+, randomconv
+, duration
+, lwt
+, mirage-time
+, mirage-clock
+, metrics
+, alcotest
+, mirage-crypto-rng
+, dns-tsig
+, base64
+}:
+
+buildDunePackage {
+  pname = "dns-server";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    dns-mirage
+    randomconv
+    duration
+    lwt
+    mirage-time
+    mirage-clock
+    metrics
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    mirage-crypto-rng
+    dns-tsig
+    base64
+  ];
+
+  meta = dns.meta // {
+    description = "DNS server, primary and secondary";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix
new file mode 100644
index 000000000000..343f4925b18f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix
@@ -0,0 +1,34 @@
+{ buildDunePackage, dns, dns-client-mirage, dns-mirage, dns-resolver, dns-tsig
+, dns-server, duration, randomconv, lwt, mirage-time, mirage-clock
+, mirage-random, tcpip, metrics
+}:
+
+buildDunePackage {
+  pname = "dns-stub";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    dns
+    dns-client-mirage
+    dns-mirage
+    dns-resolver
+    dns-tsig
+    dns-server
+    duration
+    randomconv
+    lwt
+    mirage-time
+    mirage-clock
+    mirage-random
+    tcpip
+    metrics
+  ];
+
+  doCheck = true;
+
+  meta = dns.meta // {
+    description = "DNS stub resolver";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix
new file mode 100644
index 000000000000..3ecc90d39853
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix
@@ -0,0 +1,23 @@
+{ buildDunePackage, dns, mirage-crypto, base64, alcotest }:
+
+buildDunePackage {
+  pname = "dns-tsig";
+
+  inherit (dns) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    mirage-crypto
+    dns
+    base64
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+  ];
+
+  meta = dns.meta // {
+    description = "TSIG support for DNS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix
new file mode 100644
index 000000000000..fede56388a77
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage
+, menhir, menhirLib
+, fmt
+, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "dolmen";
+  version = "0.9";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/Gbury/dolmen/releases/download/v${version}/dolmen-${version}.tbz";
+    hash = "sha256-AD21OFS6zDoz+lXtac95gXwQNppPfGvpRK8dzDZXigo=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [ menhirLib fmt ];
+
+  doCheck = true;
+
+  checkInputs = [ qcheck ];
+
+  meta = {
+    description = "OCaml library providing clean and flexible parsers for input languages";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/Gbury/dolmen";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dolmen/loop.nix b/nixpkgs/pkgs/development/ocaml-modules/dolmen/loop.nix
new file mode 100644
index 000000000000..19349bcb6e6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolmen/loop.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, dolmen, dolmen_type
+, gen
+, pp_loc
+}:
+
+buildDunePackage {
+  pname = "dolmen_loop";
+  inherit (dolmen) src version;
+
+  propagatedBuildInputs = [ dolmen dolmen_type gen pp_loc ];
+
+  meta = dolmen.meta // {
+    description = "Tool library for automated deduction tools";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dolmen/type.nix b/nixpkgs/pkgs/development/ocaml-modules/dolmen/type.nix
new file mode 100644
index 000000000000..79b84fd1f0f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolmen/type.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, dolmen
+, spelll
+, uutf
+}:
+
+buildDunePackage {
+  pname = "dolmen_type";
+  inherit (dolmen) src version;
+
+  propagatedBuildInputs = [ dolmen spelll uutf ];
+
+  meta = dolmen.meta // {
+    description = "Typechecker for automated deduction languages";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix
new file mode 100644
index 000000000000..cd3b0bffd290
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "dolog";
+  version = "6.0.0";
+
+  src = fetchFromGitHub {
+    owner = "UnixJunkie";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-g68260mcb4G4wX8y4T0MTaXsYnM9wn2d0V1VCdSFZjY=";
+  };
+
+  meta = {
+    homepage = "https://github.com/UnixJunkie/dolog";
+    description = "Minimalistic lazy logger in OCaml";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/domain-local-await/default.nix b/nixpkgs/pkgs/development/ocaml-modules/domain-local-await/default.nix
new file mode 100644
index 000000000000..9b90e87aa517
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domain-local-await/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+, domain_shims
+, mdx
+, thread-table
+}:
+
+buildDunePackage rec {
+  pname = "domain-local-await";
+  version = "1.0.1";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    hash = "sha256-KVIRPFPLB+KwVLLchs5yk5Ex2rggfI8xOa2yPmTN+m8=";
+  };
+
+  propagatedBuildInputs = [
+    thread-table
+  ];
+
+  doCheck = true;
+
+  checkInputs = [
+    alcotest
+    domain_shims
+    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 = "Scheduler independent blocking mechanism";
+    license = with lib.licenses; [ isc ];
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/domain-local-timeout/default.nix b/nixpkgs/pkgs/development/ocaml-modules/domain-local-timeout/default.nix
new file mode 100644
index 000000000000..a8ba771399b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domain-local-timeout/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, ocaml, fetchurl
+, mtime, psq, thread-table
+, alcotest, mdx
+, domain-local-await
+}:
+
+buildDunePackage rec {
+  pname = "domain-local-timeout";
+  version = "1.0.1";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/domain-local-timeout/releases/download/${version}/domain-local-timeout-${version}.tbz";
+    hash = "sha256-6sCqUkOjN8E+7OLUwVQntkv0vrQDkGDV8KNqDhVm0d8=";
+  };
+
+  propagatedBuildInputs = [ mtime psq thread-table ];
+
+  doCheck = lib.versionAtLeast ocaml.version "5.0";
+  nativeCheckInputs = [ mdx.bin ];
+  checkInputs = [ alcotest domain-local-await mdx ];
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/domain-local-timeout";
+    description = "Scheduler independent timeout mechanism";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix b/nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix
new file mode 100644
index 000000000000..d518f18571c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, ocaml, fetchurl
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "domain-name";
+  version = "0.4.0";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/domain-name/releases/download/v${version}/domain-name-${version}.tbz";
+    sha256 = "sha256-pcBuIoRYlSAZc+gS/jAZJ00duBwKeHPabIAHxK0hCMU=";
+  };
+
+  minimalOCamlVersion = "4.04";
+  duneVersion = "3";
+
+  checkInputs = [ alcotest ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    homepage = "https://github.com/hannesm/domain-name";
+    description = "RFC 1035 Internet domain names";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/domain_shims/default.nix b/nixpkgs/pkgs/development/ocaml-modules/domain_shims/default.nix
new file mode 100644
index 000000000000..4ccc6bbe90bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domain_shims/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "domain_shims";
+  version = "0.1.0";
+
+  src = fetchFromGitLab {
+    owner = "gasche";
+    repo = "domain-shims";
+    rev = version;
+    hash = "sha256-/5Cw+M0A1rnT7gFqzryd4Z0tylN0kZgSBXtn9jr8u1c=";
+  };
+
+  minimalOCamlVersion = "4.12";
+
+  meta = {
+    homepage = "https://gitlab.com/gasche/domain-shims/";
+    description = "Non-parallel implementation of Domains compatible with OCaml 4";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/domainslib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/domainslib/default.nix
new file mode 100644
index 000000000000..096ba5434996
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domainslib/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, saturn
+, domain-local-await
+, kcas
+, mirage-clock-unix
+, qcheck-stm
+}:
+
+buildDunePackage rec {
+  pname = "domainslib";
+  version = "0.5.1";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/domainslib/releases/download/${version}/domainslib-${version}.tbz";
+    hash = "sha256-KMJd+6XZmUSXNsXW/KXgvnFtgY9vODeW3vhL77mDXQE=";
+  };
+
+  propagatedBuildInputs = [ domain-local-await saturn ];
+
+  doCheck = true;
+  checkInputs = [ kcas mirage-clock-unix qcheck-stm ];
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/domainslib";
+    description = "Nested-parallel programming";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix
new file mode 100644
index 000000000000..4210dde025c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix
@@ -0,0 +1,53 @@
+{ lib, buildDunePackage, fetchFromGitLab
+, ocamlgraph, parmap, re, stdlib-shims
+, base64, extlib, cudf
+, ocaml, ounit
+}:
+
+buildDunePackage rec {
+  pname = "dose3";
+  version = "7.0.0";
+
+  src = fetchFromGitLab {
+    owner = "irill";
+    repo = "dose3";
+    rev = version;
+    sha256 = "sha256-K0fYSAWV48Rers/foDrEIqieyJ0PvpXkuYrFrZGBkkE=";
+  };
+
+  minimalOCamlVersion = "4.07";
+
+  buildInputs = [
+    parmap
+  ];
+
+  propagatedBuildInputs = [
+    base64
+    cudf
+    extlib
+    ocamlgraph
+    re
+    stdlib-shims
+  ];
+
+  checkInputs = [
+    ounit
+  ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    description = "Dose library (part of Mancoosi tools)";
+    downloadPage = "https://gitlab.com/irill/dose3/";
+    homepage = "https://www.mancoosi.org/software/";
+    license = licenses.lgpl3Plus;
+    longDescription = ''
+      The dose suite provides libraries for handling package meta-data, and various tools for analyzing package relationships in a large package repository.
+      * dose-builddebcheck checks, given a collection of source package stanzas and a collection of binary package stanzas of Debian packages, whether the build-dependencies of each source package can be satisfied by the binary packages.
+      * dose-distcheck checks for every package of a distribution whether it is possible to satisfy its dependencies and conflicts within this distribution.
+      * ceve, a general metadata parser supporting different input formats (Debian, rpm, and others) and different output formats.
+      * dose-outdated, a Debian-specific tool for finding packages that are not installable with respect to a package repository, and that can only be made installable again by fixing the package itself.
+      * dose-challenged, a Debian-specific tool for checking which packages will certainly become uninstallable when some existing package is upgraded to a newer version.
+      * dose-deb-coinstall, a Debian-specific tool for checking whether a set of packages can be installed all together.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dscheck/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dscheck/default.nix
new file mode 100644
index 000000000000..a2dd8bd9d2a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dscheck/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage
+, containers
+, oseq
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "dscheck";
+  version = "0.4.0";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/dscheck/releases/download/${version}/dscheck-${version}.tbz";
+    hash = "sha256-WWqa2O1y7krpIcxG7KLprn9SIQoWGSD3lgpXLZ9P9kA=";
+  };
+
+  propagatedBuildInputs = [ containers oseq ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Traced atomics";
+    homepage = "https://github.com/ocaml-multicore/dscheck";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dssi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dssi/default.nix
new file mode 100644
index 000000000000..b8235cef9690
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dssi/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ladspa, alsa-lib }:
+
+buildDunePackage rec {
+  pname = "dssi";
+  version = "0.1.5";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-dssi";
+    rev = "v${version}";
+    sha256 = "1frbmx1aznwp60r6bkx1whqyr6mkflvd9ysmjg7s7b80mh0s4ix6";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ladspa alsa-lib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-dssi";
+    description = "Bindings for the DSSI API which provides audio synthesizers";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix
new file mode 100644
index 000000000000..c3297b9a525b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchurl, buildDunePackage, ocaml, ounit2 }:
+
+buildDunePackage rec {
+  pname = "dtoa";
+  version = "0.3.3";
+
+  src = fetchurl {
+    url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-2PRgjJ6Ssp4l6jHzv1/MqzlomQlJkKLVnRXG6KPJ7j4=";
+  };
+
+  checkInputs = [ ounit2 ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
+
+  meta = with lib; {
+    homepage = "https://github.com/flowtype/ocaml-dtoa";
+    description = "Converts OCaml floats into strings (doubles to ascii, \"d to a\"), using the efficient Grisu3 algorithm";
+    license = licenses.mit;
+    maintainers = [ maintainers.eqyiel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dtools/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dtools/default.nix
new file mode 100644
index 000000000000..c534bdaad92a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dtools/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "dtools";
+  version = "0.4.5";
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-dtools";
+    rev = "v${version}";
+    sha256 = "sha256-NLQkQx3ZgxU1zvaQjOi+38nSeX+zKCXW40zOxVNekZA=";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-dtools";
+    description = "Library providing various helper functions to make daemons";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/duff/default.nix b/nixpkgs/pkgs/development/ocaml-modules/duff/default.nix
new file mode 100644
index 000000000000..21e916b55e23
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/duff/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, fmt
+, alcotest
+, hxd
+, crowbar
+, bigstringaf
+}:
+
+buildDunePackage rec {
+  pname = "duff";
+  version = "0.5";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/duff/releases/download/v${version}/duff-${version}.tbz";
+    sha256 = "sha256-+UU89Ko7aFDv6MxvE/BT6+XyER+vF3zqv7sD5dmtbt4=";
+  };
+
+  propagatedBuildInputs = [ fmt ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    crowbar
+    hxd
+    bigstringaf
+  ];
+
+
+  meta = {
+    description = "Pure OCaml implementation of libXdiff (Rabin’s fingerprint)";
+    homepage = "https://github.com/mirage/duff";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dum/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dum/default.nix
new file mode 100644
index 000000000000..43584461af18
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dum/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib
+, easy-format
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-dum";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "mjambon";
+    repo = "dum";
+    rev = "v${version}";
+    sha256 = "0yrxl97szjc0s2ghngs346x3y0xszx2chidgzxk93frjjpsr1mlr";
+  };
+
+  postPatch = ''
+      substituteInPlace "dum.ml" \
+      --replace "Lazy.lazy_is_val" "Lazy.is_val" \
+      --replace "Obj.final_tag" "Obj.custom_tag"
+  '';
+
+  nativeBuildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ easy-format ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mjambon/dum";
+    description = "Inspect the runtime representation of arbitrary OCaml values";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix
new file mode 100644
index 000000000000..18095bee8fc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, dune_3, dune-glob, dune-private-libs, dune-rpc }:
+
+buildDunePackage rec {
+  pname = "dune-action-plugin";
+  inherit (dune_3) src version;
+
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dune-glob dune-private-libs dune-rpc ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    inherit (dune_3.meta) homepage;
+    description = "API for writing dynamic Dune actions";
+    maintainers = [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix
new file mode 100644
index 000000000000..ac9b127cac38
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, dune-action-plugin }:
+
+buildDunePackage rec {
+  pname = "dune-build-info";
+  inherit (dune-action-plugin) src version preBuild;
+
+  dontAddPrefix = true;
+
+  buildInputs = [ dune-action-plugin ];
+
+  meta = with lib; {
+    inherit (dune-action-plugin.meta) homepage;
+    description = "Embed build information inside executables";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix
new file mode 100644
index 000000000000..324be141866f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, dune_3, csexp }:
+
+buildDunePackage rec {
+  pname = "dune-configurator";
+
+  inherit (dune_3) src version patches;
+
+  # This fixes finding csexp
+  postPatch = ''
+    rm -rf vendor/pp vendor/csexp
+  '';
+
+  minimalOCamlVersion = "4.05";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ csexp ];
+
+  meta = with lib; {
+    description = "Helper library for gathering system configuration";
+    maintainers = [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix
new file mode 100644
index 000000000000..474fd4a52c63
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, dune_3, dune-private-libs }:
+
+buildDunePackage rec {
+  pname = "dune-glob";
+  inherit (dune_3) src version;
+
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dune-private-libs ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    inherit (dune_3.meta) homepage;
+    description = "Glob string matching language supported by dune";
+    maintainers = [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix
new file mode 100644
index 000000000000..4c6092122a29
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, dune_3, stdune }:
+
+buildDunePackage rec {
+  pname = "dune-private-libs";
+
+  duneVersion = "3";
+
+  inherit (dune_3) src version;
+
+  minimalOCamlVersion = "4.08";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ stdune ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    description = "Private libraries of Dune";
+    maintainers = [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-rpc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-rpc/default.nix
new file mode 100644
index 000000000000..569be123794c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-rpc/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, dune_3, csexp, stdune, ordering, pp, xdg, dyn }:
+
+buildDunePackage rec {
+  pname = "dune-rpc";
+  inherit (dune_3) src version;
+
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ csexp stdune ordering pp xdg dyn ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    description = "Library to connect and control a running dune instance";
+    inherit (dune_3.meta) homepage;
+    maintainers = with lib.maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dune-site/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dune-site/default.nix
new file mode 100644
index 000000000000..f17cdd60d2e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-site/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, dune_3, dune-private-libs }:
+
+buildDunePackage rec {
+  pname = "dune-site";
+  inherit (dune_3) src version;
+
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dune-private-libs ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = with lib; {
+    description = "Library for embedding location information inside executable and libraries";
+    inherit (dune_3.meta) homepage;
+    maintainers = with lib.maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/duppy/default.nix b/nixpkgs/pkgs/development/ocaml-modules/duppy/default.nix
new file mode 100644
index 000000000000..bae9f62d26f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/duppy/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, re }:
+
+buildDunePackage rec {
+  pname = "duppy";
+  version = "0.9.4";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-duppy";
+    rev = "v${version}";
+    sha256 = "sha256-rVdfAMu26YgS/TZk2XPqaR6KTDLbh9Elkf8rjhSnNO4=";
+  };
+
+  propagatedBuildInputs = [ re ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-duppy";
+    description = "Library providing monadic threads";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/duration/default.nix b/nixpkgs/pkgs/development/ocaml-modules/duration/default.nix
new file mode 100644
index 000000000000..34326c8a1143
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/duration/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, ocaml, fetchurl, alcotest }:
+
+buildDunePackage rec {
+  pname = "duration";
+  version = "0.2.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/duration/releases/download/v${version}/duration-${version}.tbz";
+    hash = "sha256-xzjB84z7mYIMEhzT3fgZ3ksiKPDVDqy9HMPOmefHHis=";
+  };
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/hannesm/duration";
+    description = "Conversions to various time units";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dyn/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dyn/default.nix
new file mode 100644
index 000000000000..81b9e0d745fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dyn/default.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, dune_3, ordering }:
+
+buildDunePackage {
+  pname = "dyn";
+  inherit (dune_3) version src;
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ ordering ];
+
+  meta = dune_3.meta // {
+    description = "Dynamic type";
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix
new file mode 100644
index 000000000000..d47b78307769
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, lib, fetchFromGitHub, fetchurl, ocaml, findlib }:
+
+let params =
+  if lib.versionAtLeast ocaml.version "4.07" then rec {
+    version = "0.2";
+    src = fetchFromGitHub {
+      owner = "grain-lang";
+      repo = "dypgen";
+      rev = version;
+      hash = "sha256-fKuO/e5YbA2B7XcghWl9pXxwvKw9YlhnmZDZcuKe3cs=";
+    };
+  } else if lib.versionOlder ocaml.version "4.06" then {
+    version = "20120619-1";
+    src = fetchurl {
+      url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2";
+      sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97";
+    };
+  } else throw "dypgen is not available for OCaml ${ocaml.version}"
+; in
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-dypgen";
+  inherit (params) src version;
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  buildPhase = ''
+    make
+  '';
+
+  makeFlags = [ "BINDIR=$(out)/bin" "MANDIR=$(out)/usr/share/man/man1" "DYPGENLIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib" ];
+
+  meta = {
+    homepage = "http://dypgen.free.fr";
+    description = "Dypgen GLR self extensible parser generator";
+    license = lib.licenses.cecill-b;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/earley/default.nix b/nixpkgs/pkgs/development/ocaml-modules/earley/default.nix
new file mode 100644
index 000000000000..0d365c8036dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/earley/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, ocaml, buildDunePackage
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  version = "3.0.0";
+  pname = "earley";
+  src = fetchFromGitHub {
+    owner = "rlepigre";
+    repo = "ocaml-earley";
+    rev = version;
+    sha256 = "1vi58zdxchpw6ai0bz9h2ggcmg8kv57yk6qbx82lh47s5wb3mz5y";
+  };
+
+  minimumOCamlVersion = "4.07";
+  useDune2 = true;
+
+  buildInputs = [ stdlib-shims ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Parser combinators based on Earley Algorithm";
+    homepage = "https://github.com/rlepigre/ocaml-earley";
+    license = lib.licenses.cecill-b;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "pa_ocaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix b/nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix
new file mode 100644
index 000000000000..9d6c3664822d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix
@@ -0,0 +1,45 @@
+{ lib, fetchFromGitHub, ocaml, buildDunePackage
+, cmdliner, dap, fmt, iter, logs, lru, lwt_ppx, lwt_react, menhir, menhirLib, path_glob, ppx_deriving_yojson
+, ppx_optcomp
+, gitUpdater
+}:
+
+buildDunePackage rec {
+  pname = "earlybird";
+  version = "1.3.2";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "hackwaly";
+    repo = "ocamlearlybird";
+    rev = version;
+    hash = "sha256-E6ZZRkGO6Bqr6jWlV9fL3ibFwUVChHR17TPGeP94hfk=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+
+  buildInputs = [
+    cmdliner
+    dap
+    fmt
+    iter
+    logs
+    lru
+    lwt_ppx
+    lwt_react
+    menhirLib
+    path_glob
+    ppx_deriving_yojson
+    ppx_optcomp
+  ];
+
+  passthru.updateScript = gitUpdater { };
+
+  meta = {
+    homepage = "https://github.com/hackwaly/ocamlearlybird";
+    description = "OCaml debug adapter";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix
new file mode 100644
index 000000000000..7d178b758062
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, ocaml, buildDunePackage }:
+
+let params =
+  if lib.versionAtLeast ocaml.version "4.08" then {
+    version = "1.3.3";
+    sha256 = "sha256:05n4mm1yz33h9gw811ivjw7x4m26lpmf7kns9lza4v6227lwmz7a";
+  } else {
+    version = "1.3.2";
+    sha256 = "sha256:09hrikx310pac2sb6jzaa7k6fmiznnmhdsqij1gawdymhawc4h1l";
+  };
+in
+
+buildDunePackage rec {
+  pname = "easy-format";
+  inherit (params) version;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-community/easy-format/releases/download/${version}/easy-format-${version}.tbz";
+    inherit (params) sha256;
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "High-level and functional interface to the Format module of the OCaml standard library";
+    homepage = "https://github.com/ocaml-community/easy-format";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eigen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/eigen/default.nix
new file mode 100644
index 000000000000..16a69db3b2fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eigen/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, ctypes, libcxx }:
+
+buildDunePackage rec {
+  pname = "eigen";
+  version = "0.2.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "owlbarn";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1zaw03as14hyvfpyj6bjrfbcxp2ljdbqcqqgm53kms244mig425f";
+  };
+
+  minimumOCamlVersion = "4.02";
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
+
+  propagatedBuildInputs = [ ctypes ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Minimal/incomplete Ocaml interface to Eigen3, mostly for Owl";
+    platforms = platforms.x86_64;
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eio/default.nix b/nixpkgs/pkgs/development/ocaml-modules/eio/default.nix
new file mode 100644
index 000000000000..60e09d35db7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eio/default.nix
@@ -0,0 +1,72 @@
+{ lib
+, ocaml
+, version ? if lib.versionAtLeast ocaml.version "5.1" then "1.1" else "0.12"
+, buildDunePackage
+, bigstringaf
+, cstruct
+, domain-local-await
+, dune-configurator
+, fetchurl
+, fmt
+, hmap
+, lwt-dllist
+, mtime
+, optint
+, psq
+, alcotest
+, crowbar
+, mdx
+}:
+
+let
+  param = {
+    "0.12" = {
+      minimalOCamlVersion = "5.0";
+      hash = "sha256-2EhHzoX/t4ZBSWrSS+PGq1zCxohc7a1q4lfsrFnZJqA=";
+    };
+    "1.1" = {
+      minimalOCamlVersion = "5.1";
+      hash = "sha256-NGEEiEB38UCzV04drMwCISlgxu/reTyAPj5ri6/qD6s=";
+    };
+  }."${version}";
+in
+buildDunePackage rec {
+  pname = "eio";
+  inherit version;
+  inherit (param) minimalOCamlVersion;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    inherit (param) hash;
+  };
+
+  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/${pname}";
+    changelog = "https://github.com/ocaml-multicore/${pname}/raw/v${version}/CHANGES.md";
+    description = "Effects-Based Parallel IO for OCaml";
+    license = with lib.licenses; [ isc ];
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eio/linux.nix b/nixpkgs/pkgs/development/ocaml-modules/eio/linux.nix
new file mode 100644
index 000000000000..f6ed30d4e80d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eio/linux.nix
@@ -0,0 +1,22 @@
+{ buildDunePackage
+, eio
+, fmt
+, logs
+, uring
+}:
+
+buildDunePackage {
+  pname = "eio_linux";
+  inherit (eio) meta src patches version;
+
+  minimalOCamlVersion = "5.0";
+
+  dontStrip = true;
+
+  propagatedBuildInputs = [
+    eio
+    fmt
+    logs
+    uring
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eio/main.nix b/nixpkgs/pkgs/development/ocaml-modules/eio/main.nix
new file mode 100644
index 000000000000..a65b27b8db41
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eio/main.nix
@@ -0,0 +1,22 @@
+{ lib
+, stdenv
+, buildDunePackage
+, eio
+, eio_posix
+, eio_linux
+}:
+
+buildDunePackage {
+  pname = "eio_main";
+  inherit (eio) meta src patches version;
+
+  minimalOCamlVersion = "5.0";
+
+  dontStrip = true;
+
+  propagatedBuildInputs = [
+    eio_posix
+  ] ++ lib.optionals stdenv.isLinux [
+    eio_linux
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eio/posix.nix b/nixpkgs/pkgs/development/ocaml-modules/eio/posix.nix
new file mode 100644
index 000000000000..c18cdd506141
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eio/posix.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage
+, lib
+, stdenv
+, dune-configurator
+, eio
+, fmt
+, logs
+, iomux
+}:
+
+buildDunePackage {
+  pname = "eio_posix";
+  inherit (eio) meta src patches version;
+
+  minimalOCamlVersion = "5.0";
+
+  dontStrip = true;
+
+  env = lib.optionalAttrs stdenv.isDarwin {
+    NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
+  };
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    eio
+    fmt
+    logs
+    iomux
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/either/default.nix b/nixpkgs/pkgs/development/ocaml-modules/either/default.nix
new file mode 100644
index 000000000000..71d16c9674c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/either/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "either";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/either/releases/download/${version}/either-${version}.tbz";
+    sha256 = "bf674de3312dee7b7215f07df1e8a96eb3d679164b8a918cdd95b8d97e505884";
+  };
+
+  useDune2 = true;
+
+  meta = with lib; {
+    description = "Compatibility Either module";
+    license = licenses.mit;
+    homepage = "https://github.com/mirage/either";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/elina/default.nix b/nixpkgs/pkgs/development/ocaml-modules/elina/default.nix
new file mode 100644
index 000000000000..de000f8aaf83
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/elina/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchurl, gnumake42, perl, gmp, mpfr, ocaml, findlib, camlidl, apron }:
+
+stdenv.mkDerivation rec {
+  version = "1.1";
+  pname = "ocaml${ocaml.version}-elina";
+  src = fetchurl {
+    url = "http://files.sri.inf.ethz.ch/elina-${version}.tar.gz";
+    sha256 = "1nymykskq1yx87y4xl6hl9i4q6kv0qaq25rniqgl1bfn883p1ysc";
+  };
+
+  # fails with make 4.4
+  nativeBuildInputs = [ gnumake42 perl ocaml findlib camlidl ];
+
+  propagatedBuildInputs = [ apron gmp mpfr ];
+
+  strictDeps = true;
+
+  prefixKey = "--prefix ";
+  configureFlags = [
+    "--use-apron"
+    "--use-opam"
+    "--apron-prefix" apron
+  ]
+  ++ lib.optional stdenv.isDarwin "--absolute-dylibs"
+  ;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "ETH LIbrary for Numerical Analysis";
+    homepage = "http://elina.ethz.ch/";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+    platforms = lib.intersectLists ocaml.meta.platforms lib.platforms.x86;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix b/nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix
new file mode 100644
index 000000000000..30b955876ace
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix
@@ -0,0 +1,71 @@
+{ buildDunePackage
+, lib
+, fetchFromGitHub
+, which
+, ocsigen_server
+, lwt_react
+, ppx_deriving
+, ppx_optcomp
+, js_of_ocaml-ocamlbuild
+, js_of_ocaml-ppx
+, js_of_ocaml-ppx_deriving_json
+, js_of_ocaml-lwt
+, js_of_ocaml-tyxml
+, lwt_ppx
+, ocsipersist
+}:
+
+buildDunePackage rec {
+  pname = "eliom";
+  version = "10.4.1";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "eliom";
+    rev = version;
+    hash = "sha256-j4t6GEd8hYyM87b9XvgcnaV9XMkouz6+v0SYW22/bqg=";
+  };
+
+  nativeBuildInputs = [
+    which
+  ];
+  buildInputs = [
+    js_of_ocaml-ocamlbuild
+    js_of_ocaml-ppx_deriving_json
+    ppx_optcomp
+  ];
+
+  propagatedBuildInputs = [
+    js_of_ocaml-lwt
+    js_of_ocaml-ppx
+    js_of_ocaml-tyxml
+    lwt_ppx
+    lwt_react
+    ocsigen_server
+    ocsipersist
+    ppx_deriving
+  ];
+
+  strictDeps = true;
+
+  setupHook = [ ./setup-hook.sh ];
+
+  meta = {
+    homepage = "http://ocsigen.org/eliom/";
+    description = "OCaml Framework for programming Web sites and client/server Web applications";
+
+    longDescription = ''Eliom is a framework for programming Web sites
+    and client/server Web applications. It introduces new concepts to
+    simplify programming common behaviours and uses advanced static
+    typing features of OCaml to check many properties of the Web site
+    at compile time. If you want to write a Web application, Eliom
+    makes possible to write the whole application as a single program
+    (client and server parts). A syntax extension is used to
+    distinguish both parts and the client side is compiled to JS using
+    Ocsigen Js_of_ocaml.'';
+
+    license = lib.licenses.lgpl21;
+
+    maintainers = [ lib.maintainers.gal_bolle ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eliom/setup-hook.sh b/nixpkgs/pkgs/development/ocaml-modules/eliom/setup-hook.sh
new file mode 100644
index 000000000000..9868ab93f791
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eliom/setup-hook.sh
@@ -0,0 +1,5 @@
+addOcsigenDistilleryTemplate() {
+    addToSearchPathWithCustomDelimiter : ELIOM_DISTILLERY_PATH $1/eliom-distillery-templates
+}
+
+addEnvHooks "$hostOffset" addOcsigenDistilleryTemplate
diff --git a/nixpkgs/pkgs/development/ocaml-modules/elpi/atd_2_10.patch b/nixpkgs/pkgs/development/ocaml-modules/elpi/atd_2_10.patch
new file mode 100644
index 000000000000..3f341a3fa4b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/elpi/atd_2_10.patch
@@ -0,0 +1,13 @@
+diff --git a/src/elpi_trace_elaborator.ml b/src/elpi_trace_elaborator.ml
+index ca13114d..093e7593 100644
+--- a/src/elpi_trace_elaborator.ml
++++ b/src/elpi_trace_elaborator.ml
+@@ -664,6 +664,6 @@ let main =
+ 
+   let cards = Trace.cards steps ~stack_frames ~aggregated_goal_success ~goal_text ~goal_attempts in
+ 
+-  let ob = Bi_outbuf.create_channel_writer stdout in
++  let ob = Buffer.create 17 in
+   write_trace ob cards;
+-  Bi_outbuf.flush_channel_writer ob
++  Buffer.output_buffer stdout ob
diff --git a/nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix
new file mode 100644
index 000000000000..d678c129188c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix
@@ -0,0 +1,72 @@
+{ lib
+, buildDunePackage, camlp5
+, ocaml
+, menhir, menhirLib
+, atdgen
+, stdlib-shims
+, re, perl, ncurses
+, ppxlib, ppx_deriving
+, ppxlib_0_15, ppx_deriving_0_15
+, coqPackages
+, version ? if lib.versionAtLeast ocaml.version "4.08" then "1.18.1"
+    else if lib.versionAtLeast ocaml.version "4.07" then "1.15.2" else "1.14.1"
+}:
+
+let p5 = camlp5; in
+let camlp5 = p5.override { legacy = true; }; in
+
+let fetched = coqPackages.metaFetch ({
+    release."1.18.1".sha256 = "sha256-zgBJefQDe3JyCGbC0wvMcx/9iMVbftBJ43NPogkNeHY=";
+    release."1.17.0".sha256 = "sha256-DTxE8CvYl0et20pxueydI+WzraI6UPHMNvxyp2gU/+w=";
+    release."1.16.5".sha256 = "sha256-tKX5/cVPoBeHiUe+qn7c5FIRYCwY0AAukN7vSd/Nz9A=";
+    release."1.15.2".sha256 = "sha256-XgopNP83POFbMNyl2D+gY1rmqGg03o++Ngv3zJfCn2s=";
+    release."1.15.0".sha256 = "sha256:1ngdc41sgyzyz3i3lkzjhnj66gza5h912virkh077dyv17ysb6ar";
+    release."1.14.1".sha256 = "sha256-BZPVL8ymjrE9kVGyf6bpc+GA2spS5JBpkUtZi04nPis=";
+    release."1.13.7".sha256 = "10fnwz30bsvj7ii1vg4l1li5pd7n0qqmwj18snkdr5j9gk0apc1r";
+    release."1.13.5".sha256 = "02a6r23mximrdvs6kgv6rp0r2dgk7zynbs99nn7lphw2c4189kka";
+    release."1.13.1".sha256 = "12a9nbdvg9gybpw63lx3nw5wnxfznpraprb0wj3l68v1w43xq044";
+    release."1.13.0".sha256 = "0dmzy058m1mkndv90byjaik6lzzfk3aaac7v84mpmkv6my23bygr";
+    release."1.12.0".sha256 = "1agisdnaq9wrw3r73xz14yrq3wx742i6j8i5icjagqk0ypmly2is";
+    release."1.11.4".sha256 = "1m0jk9swcs3jcrw5yyw5343v8mgax238cjb03s8gc4wipw1fn9f5";
+    releaseRev = v: "v${v}";
+    location = { domain = "github.com"; owner = "LPCIC"; repo = "elpi"; };
+  }) version;
+in
+buildDunePackage rec {
+  pname = "elpi";
+  inherit (fetched) version src;
+
+  patches = lib.optional (version == "1.16.5")
+    ./atd_2_10.patch;
+
+  minimalOCamlVersion = "4.04";
+  duneVersion = "3";
+
+  # atdgen is both a library and executable
+  nativeBuildInputs = [ perl ]
+  ++ [ (if lib.versionAtLeast version "1.15" || version == "dev" then menhir else camlp5) ]
+  ++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
+  buildInputs = [ ncurses ]
+  ++ lib.optional (lib.versionAtLeast version "1.16" || version == "dev") atdgen;
+
+  propagatedBuildInputs = [ re stdlib-shims ]
+  ++ (if lib.versionAtLeast version "1.15" || version == "dev"
+     then [ menhirLib ]
+     else [ camlp5 ]
+  )
+  ++ (if lib.versionAtLeast version "1.13" || version == "dev"
+     then [ ppxlib ppx_deriving ]
+     else [ ppxlib_0_15 ppx_deriving_0_15 ]
+  );
+
+  meta = with lib; {
+    description = "Embeddable λProlog Interpreter";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.vbgl ];
+    homepage = "https://github.com/LPCIC/elpi";
+  };
+
+  postPatch = ''
+    substituteInPlace elpi_REPL.ml --replace "tput cols" "${ncurses}/bin/tput cols"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/emile/default.nix b/nixpkgs/pkgs/development/ocaml-modules/emile/default.nix
new file mode 100644
index 000000000000..44764033d6a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/emile/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ocaml
+, angstrom
+, ipaddr
+, base64
+, pecu
+, uutf
+, alcotest
+, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "emile";
+  version = "1.1";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/emile/releases/download/v${version}/emile-v${version}.tbz";
+    hash = "sha256:0r1141makr0b900aby1gn0fccjv1qcqgyxib3bzq8fxmjqwjan8p";
+  };
+
+  buildInputs = [ cmdliner ];
+
+  propagatedBuildInputs = [
+    angstrom
+    ipaddr
+    base64
+    pecu
+    uutf
+  ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = with lib; {
+    description = "Parser of email address according RFC822";
+    license = licenses.mit;
+    homepage = "https://github.com/dinosaure/emile";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/encore/default.nix b/nixpkgs/pkgs/development/ocaml-modules/encore/default.nix
new file mode 100644
index 000000000000..fc54eb1a4781
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/encore/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, fmt
+, bigstringaf
+, angstrom
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "encore";
+  version = "0.8";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/encore/releases/download/v${version}/encore-v${version}.tbz";
+    sha256 = "a406bc9863b04bb424692045939d6c170a2bb65a98521ae5608d25b0559344f6";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ angstrom fmt bigstringaf ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/mirage/encore";
+    description = "Library to generate encoder/decoder which ensure isomorphism";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix
new file mode 100644
index 000000000000..d777755253c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, cstruct }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.07";
+  duneVersion = "3";
+  pname = "eqaf";
+  version = "0.9";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/eqaf/releases/download/v${version}/eqaf-${version}.tbz";
+    hash = "sha256-7A4oqUasaBf5XVhU8FqZYa46hAi7YQ55z60BubJV3+A=";
+  };
+
+  propagatedBuildInputs = [ cstruct ];
+
+  meta = {
+    description = "Constant time equal function to avoid timing attacks in OCaml";
+    homepage = "https://github.com/mirage/eqaf";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix
new file mode 100644
index 000000000000..082f47313bd4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+if lib.versionOlder ocaml.version "4.02"
+|| lib.versionAtLeast ocaml.version "5.0"
+then throw "erm_xml is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-erm_xml";
+  version = "0.3+20180112";
+
+  src = fetchFromGitHub {
+    owner = "hannesm";
+    repo = "xml";
+    rev = "bbabdade807d8281fc48806da054b70dfe482479";
+    sha256 = "sha256-OQdLTq9tJZc6XlcuPv2gxzYiQAUGd6AiBzfSi169XL0=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://github.com/hannesm/xml";
+    description = "XML Parser for discrete data";
+    platforms = ocaml.meta.platforms or [ ];
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix
new file mode 100644
index 000000000000..452499aa401f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4, ocamlbuild
+, erm_xml, mirage-crypto, mirage-crypto-rng, base64
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.3+20220404";
+  pname = "ocaml${ocaml.version}-erm_xmpp";
+
+  src = fetchFromGitHub {
+    owner  = "hannesm";
+    repo   = "xmpp";
+    rev    = "e54d54e142ac9770c37e144693473692bf473530";
+    sha256 = "sha256-Ize8Em4LI54Cy1Xuzr9BjQGV7JMr3W6KI1YzI8G1q/U=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ];
+  buildInputs = [ camlp4 ];
+  propagatedBuildInputs = [ erm_xml mirage-crypto mirage-crypto-rng base64 ];
+
+  strictDeps = true;
+
+  configurePhase = ''
+    runHook preConfigure
+    ocaml setup.ml -configure --prefix $out
+    runHook postConfigure
+  '';
+  buildPhase = ''
+    runHook preBuild
+    ocaml setup.ml -build
+    runHook postBuild
+  '';
+  installPhase = ''
+    runHook preInstall
+    ocaml setup.ml -install
+    runHook postInstall
+  '';
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://github.com/hannesm/xmpp";
+    description = "OCaml based XMPP implementation (fork)";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ sternenseemann ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
new file mode 100644
index 000000000000..c16534744d06
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, cstruct
+, logs
+, lwt
+, macaddr
+, mirage-net
+}:
+
+buildDunePackage rec {
+  pname = "ethernet";
+  version = "3.2.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-TB2nAhQiHZ1Dk6n/3i49s9HKNH92yNUl3xl94hByrAk=";
+  };
+
+  propagatedBuildInputs = [
+    cstruct
+    mirage-net
+    macaddr
+    lwt
+    logs
+  ];
+
+  meta = with lib; {
+    description = "OCaml Ethernet (IEEE 802.3) layer, used in MirageOS";
+    homepage = "https://github.com/mirage/ethernet";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/expat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/expat/default.nix
new file mode 100644
index 000000000000..2449308567e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/expat/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
+  "ocaml_expat is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-expat";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "whitequark";
+    repo = "ocaml-expat";
+    rev = "v${version}";
+    hash = "sha256-eDA6MUcztaI+fpunWBdanNnPo9Y5gvbj/ViVcxYYEBg=";
+  };
+
+  prePatch = ''
+    substituteInPlace Makefile --replace "gcc" "\$(CC)"
+  '';
+
+  nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ expat ];
+
+  strictDeps = true;
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkTarget = "testall";
+  checkInputs = [ ounit ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "OCaml wrapper for the Expat XML parsing library";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix b/nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix
new file mode 100644
index 000000000000..7ab61a146a95
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix
@@ -0,0 +1,33 @@
+# Older version of extlib for Haxe 4.0 and 4.1.
+# May be replaceable by the next extlib + extlib-base64 release.
+{ stdenv, lib, fetchurl, ocaml, findlib, cppo
+# De facto, option minimal seems to be the default. See the README.
+, minimal ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-extlib";
+  version = "1.7.7";
+
+  src = fetchurl {
+    url = "https://ygrek.org/p/release/ocaml-extlib/extlib-${version}.tar.gz";
+    sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1";
+  };
+
+  nativeBuildInputs = [ ocaml findlib cppo ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  makeFlags = lib.optional minimal "minimal=1";
+
+  meta = {
+    homepage = "https://github.com/ygrek/ocaml-extlib";
+    description = "Enhancements to the OCaml Standard Library modules";
+    license = lib.licenses.lgpl21Only;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.sternenseemann ];
+    broken = lib.versionAtLeast ocaml.version "4.12";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix
new file mode 100644
index 000000000000..cd9f6d9b86ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage, lib, fetchurl, cppo }:
+
+buildDunePackage rec {
+  pname = "extlib";
+  version = "1.7.9";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://ygrek.org/p/release/ocaml-${pname}/${pname}-${version}.tar.gz";
+    hash = "sha512-I4asafA36lIINcBiTTmun7/+Q6ILGOJH3gMiMu1vQZ1me1PSMUxvVtxx02i/C2IBpWwvPypb39kzdmxabLmHaA==";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/ygrek/ocaml-extlib";
+    description = "Enhancements to the OCaml Standard Library modules";
+    license = lib.licenses.lgpl21Only;
+    maintainers = [ lib.maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ezjsonm-encoding/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ezjsonm-encoding/default.nix
new file mode 100644
index 000000000000..ec81d52da687
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ezjsonm-encoding/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildDunePackage, ezjsonm }:
+
+buildDunePackage rec {
+  pname = "ezjsonm-encoding";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/lthms/ezjsonm-encoding/releases/download/${version}/ezjsonm-encoding-${version}.tbz";
+    hash = "sha256-e5OPcbbQLr16ANFNZ5i10LjlHgwcRTCYhyvOhVk22yI=";
+  };
+
+  propagatedBuildInputs = [ ezjsonm ];
+
+  meta = {
+    description = "Encoding combinators a la Data_encoding for Ezjsonm";
+    homepage = "https://github.com/lthms/ezjsonmi-encoding";
+    license = lib.licenses.mpl20;
+    maintainers = with lib.maintainers; [ fgaz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ezjsonm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ezjsonm/default.nix
new file mode 100644
index 000000000000..cde69a13e8ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ezjsonm/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage, jsonm, hex, sexplib0 }:
+
+buildDunePackage rec {
+  pname = "ezjsonm";
+  version = "1.3.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ezjsonm/releases/download/v${version}/ezjsonm-${version}.tbz";
+    hash = "sha256-CGM+Dw52eoroGTXKfnTxaTuFp5xFAtVo7t/1Fw8M13s=";
+  };
+
+  propagatedBuildInputs = [ jsonm hex sexplib0 ];
+
+  meta = {
+    description = "Easy interface on top of the Jsonm library";
+    homepage = "https://github.com/mirage/ezjsonm";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ezxmlm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ezxmlm/default.nix
new file mode 100644
index 000000000000..b146b2349cd5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ezxmlm/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchurl, buildDunePackage, xmlm }:
+
+buildDunePackage rec {
+  pname = "ezxmlm";
+  version = "1.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ezxmlm/releases/download/v${version}/ezxmlm-v${version}.tbz";
+    sha256 = "123dn4h993mlng9gzf4nc6mw75ja7ndcxkbkwfs48j5jk1z05j6d";
+  };
+
+  propagatedBuildInputs = [ xmlm ];
+
+  meta = with lib; {
+    description = "Combinators to use with xmlm for parsing and selection";
+    longDescription = ''
+      An "easy" interface on top of the xmlm library. This version provides
+      more convenient (but far less flexible) input and output functions
+      that go to and from [string] values. This avoids the need to write signal
+      code, which is useful for quick scripts that manipulate XML.
+
+      More advanced users should go straight to the Xmlm library and use it
+      directly, rather than be saddled with the Ezxmlm interface. Since the
+      types in this library are more specific than Xmlm, it should interoperate
+      just fine with it if you decide to switch over.
+    '';
+    maintainers = [ maintainers.carlosdagos ];
+    homepage = "https://github.com/mirage/ezxmlm/";
+    license = licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faad/default.nix b/nixpkgs/pkgs/development/ocaml-modules/faad/default.nix
new file mode 100644
index 000000000000..a2705a27d929
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faad/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, faad2, pkg-config }:
+
+buildDunePackage rec {
+  pname = "faad";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-faad";
+    rev = "v${version}";
+    sha256 = "sha256-3ayKZhgJAgsoOqn0InSrM5f3TImRHOQMtWETICo4t3o=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ faad2 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-faad";
+    description = "Bindings for the faad library which provides functions for decoding AAC audio files";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/facile/default.nix b/nixpkgs/pkgs/development/ocaml-modules/facile/default.nix
new file mode 100644
index 000000000000..ee8b7cb5319d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/facile/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, ocaml }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "facile is not available for OCaml ≥ 5.0"
+
+buildDunePackage rec {
+  pname = "facile";
+  version = "1.1.4";
+
+  src = fetchurl {
+    url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz";
+    sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp";
+  };
+
+  doCheck = true;
+
+  duneVersion = if lib.versionAtLeast ocaml.version "4.12" then "2" else "1";
+  postPatch = lib.optionalString (duneVersion != "1") "dune upgrade";
+
+  meta = {
+    homepage = "http://opti.recherche.enac.fr/facile/";
+    license = lib.licenses.lgpl21Plus;
+    description = "Functional Constraint Library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix b/nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix
new file mode 100644
index 000000000000..18d1b76f043f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, lib, faraday, core_unix ? null, async }:
+
+buildDunePackage rec {
+  pname = "faraday-async";
+  inherit (faraday) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ faraday core_unix async ];
+
+  meta = faraday.meta // {
+    description = "Async support for Faraday";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix b/nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix
new file mode 100644
index 000000000000..38ef4bb475a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigstringaf }:
+
+buildDunePackage rec {
+  pname = "faraday";
+  version = "0.8.2";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-wR4kDocR1t3OLRuudXH8IccYde552O6Gvo5BHNxRbAI=";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ bigstringaf ];
+  doCheck = true;
+
+  meta = {
+    description = "Serialization library built for speed and memory efficiency";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix
new file mode 100644
index 000000000000..1919de47169d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, faraday, faraday-lwt, lwt }:
+
+buildDunePackage rec {
+  pname = "faraday-lwt-unix";
+  inherit (faraday) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ lwt faraday-lwt ];
+
+  meta = faraday.meta // {
+    description = "Lwt + Unix support for Faraday";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix
new file mode 100644
index 000000000000..011074f2fba1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, faraday, lwt }:
+
+buildDunePackage rec {
+  pname = "faraday-lwt";
+  inherit (faraday) version src;
+
+  propagatedBuildInputs = [ faraday lwt ];
+  duneVersion = "3";
+
+  meta = faraday.meta // {
+    description = "Lwt support for Faraday";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix
new file mode 100644
index 000000000000..aa200f880e45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, faraday
+}:
+
+if lib.versionOlder ocaml.version "4.3"
+then throw "farfadet is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-farfadet";
+  version = "0.3";
+
+  src = fetchurl {
+    url = "https://github.com/oklm-wsh/Farfadet/releases/download/v${version}/farfadet-${version}.tbz";
+    sha256 = "0nlafnp0pwx0n4aszpsk6nvcvqi9im306p4jhx70si7k3xprlr2j";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  propagatedBuildInputs = [ faraday ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "Printf-like for Faraday library";
+    homepage = "https://github.com/oklm-wsh/Farfadet";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix
new file mode 100644
index 000000000000..f31a94e2c7d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, buildDunePackage, dune-configurator
+, fdk_aac
+}:
+
+buildDunePackage rec {
+  pname = "fdkaac";
+  version = "0.3.3";
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-fdkaac";
+    rev = "v${version}";
+    hash = "sha256-cTPPQKBq0EFo35eK7TXlszbodHYIg1g7v+yQ/rG7Y9I=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ fdk_aac ];
+
+  meta = {
+    description = "OCaml binding for the fdk-aac library";
+    inherit (src.meta) homepage;
+    license = lib.licenses.gpl2Only;
+    maintainers = [ lib.maintainers.vbgl lib.maintainers.dandellion ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ff/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ff/default.nix
new file mode 100644
index 000000000000..bffec212b93e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ff/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, ff-pbt, ff-sig, zarith, alcotest }:
+
+buildDunePackage rec {
+  pname = "ff";
+  inherit (ff-sig) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    ff-sig
+    zarith
+  ];
+
+  checkInputs = [
+    alcotest
+    ff-pbt
+  ];
+
+  doCheck = true;
+
+  meta = ff-sig.meta // {
+    description = "OCaml implementation of Finite Field operations";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ff/pbt.nix b/nixpkgs/pkgs/development/ocaml-modules/ff/pbt.nix
new file mode 100644
index 000000000000..fe8234c2572c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ff/pbt.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, zarith, ff-sig, alcotest }:
+
+buildDunePackage {
+  pname = "ff-pbt";
+  inherit (ff-sig) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  propagatedBuildInputs = [
+    zarith
+    ff-sig
+  ];
+
+  meta = ff-sig.meta // {
+    description = "Property based testing library for finite fields over the package ff-sig";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ff/sig.nix b/nixpkgs/pkgs/development/ocaml-modules/ff/sig.nix
new file mode 100644
index 000000000000..4043c45ceecf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ff/sig.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitLab, buildDunePackage, zarith }:
+
+buildDunePackage rec {
+  pname = "ff-sig";
+  version = "0.6.2";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "cryptography/ocaml-ff";
+    rev = version;
+    sha256 = "sha256-IoUH4awMOa1pm/t8E5io87R0TZsAxJjGWaXhXjn/w+Y=";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    zarith
+  ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Minimal finite field signatures";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/base.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/base.nix
new file mode 100644
index 000000000000..bf63c00378cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/base.nix
@@ -0,0 +1,19 @@
+{ lib, fetchFromGitHub }:
+
+rec {
+  version = "1.1.11";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ffmpeg";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-Tr0YhoaaUSOlA7vlhAjPyFJI/iL7Z54oO27RnG7d+nA=";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-ffmpeg";
+    description = "Bindings for the ffmpeg libraries";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/default.nix
new file mode 100644
index 000000000000..1ceea8a75f69
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/default.nix
@@ -0,0 +1,36 @@
+{ lib, buildDunePackage, callPackage
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil
+, ffmpeg-avcodec
+, ffmpeg-avfilter
+, ffmpeg-swscale
+, ffmpeg-swresample
+, ffmpeg-av
+, ffmpeg-avdevice
+}:
+
+buildDunePackage {
+  pname = "ffmpeg";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  propagatedBuildInputs = [
+    ffmpeg-avutil
+    ffmpeg-avcodec
+    ffmpeg-avfilter
+    ffmpeg-swscale
+    ffmpeg-swresample
+    ffmpeg-av
+    ffmpeg-avdevice
+  ];
+
+  # The tests fail
+  doCheck = false;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg libraries";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix
new file mode 100644
index 000000000000..58055aa6698c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, AudioToolbox
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-av";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg libraries -- top-level helpers";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix
new file mode 100644
index 000000000000..8f268d4d5ec2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, AudioToolbox
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil, ffmpeg
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-avcodec";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ]
+    ++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg avcodec library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix
new file mode 100644
index 000000000000..c8a1bf9de5a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix
@@ -0,0 +1,43 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, AppKit
+, AudioToolbox
+, AVFoundation
+, Cocoa
+, CoreImage
+, ForceFeedback
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-av, ffmpeg
+, OpenGL
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-avdevice";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ]
+  ++ lib.optionals stdenv.isDarwin [
+    AppKit
+    AudioToolbox
+    AVFoundation
+    Cocoa
+    CoreImage
+    ForceFeedback
+    OpenGL
+    VideoToolbox
+  ];
+
+  propagatedBuildInputs = [ ffmpeg-av ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg avdevice library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix
new file mode 100644
index 000000000000..89d982483986
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, AppKit
+, CoreImage
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil, ffmpeg
+, OpenGL
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-avfilter";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ]
+    ++ lib.optionals stdenv.isDarwin [ AppKit CoreImage OpenGL VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg avfilter library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix
new file mode 100644
index 000000000000..8e299a536f63
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, buildDunePackage, dune-configurator, pkg-config, callPackage
+, AudioToolbox, VideoToolbox
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-avutil";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg avutil libraries";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix
new file mode 100644
index 000000000000..d21e0d02ad4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-swresample";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg swresample library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix
new file mode 100644
index 000000000000..b03d87596b03
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, dune-configurator, pkg-config, callPackage
+, ffmpeg-base ? callPackage ./base.nix { }
+, ffmpeg-avutil, ffmpeg
+, stdenv
+, VideoToolbox
+}:
+
+buildDunePackage {
+  pname = "ffmpeg-swscale";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (ffmpeg-base) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ];
+  propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];
+
+  doCheck = true;
+
+  meta = ffmpeg-base.meta // {
+    description = "Bindings for the ffmpeg swscale library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fiber/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fiber/default.nix
new file mode 100644
index 000000000000..69bd4a067e27
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fiber/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildDunePackage
+, dyn
+, fetchurl
+, ocaml
+, ppx_expect
+, stdune
+}:
+
+buildDunePackage rec {
+  pname = "fiber";
+  version = "3.7.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-dune/fiber/releases/download/${version}/fiber-lwt-${version}.tbz";
+    hash = "sha256-hkihWuk/5pQpmc42iHQpo5E7YoKcRxTlIMwOehw7loI=";
+  };
+
+  buildInputs = [ stdune dyn ];
+
+  checkInputs = [ ppx_expect ];
+
+  # Tests are Ocaml version dependent
+  # https://github.com/ocaml-dune/fiber/issues/27
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Structured concurrency library";
+    homepage = "https://github.com/ocaml-dune/fiber";
+    maintainers = with lib.maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fileutils/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fileutils/default.nix
new file mode 100644
index 000000000000..832da7d3dc15
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fileutils/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, ocaml, buildDunePackage, seq, stdlib-shims, ounit2 }:
+
+buildDunePackage rec {
+  pname = "fileutils";
+  version = "0.6.4";
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ocaml-fileutils/releases/download/v${version}/fileutils-${version}.tbz";
+    hash = "sha256-enu2vGo2tuvawrTkap6bENNmxaLUQXpfHWih+7oKRF8=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [
+    seq
+    stdlib-shims
+  ];
+
+  checkInputs = [
+    ounit2
+  ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    description = "OCaml API to manipulate real files (POSIX like) and filenames";
+    homepage = "https://github.com/gildor478/ocaml-fileutils";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fix/default.nix
new file mode 100644
index 000000000000..1d738dfb32cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fix/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "fix";
+  version = "20230505";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = "fix";
+    rev = version;
+    sha256 = "sha256-Xuw4pEPqAbQjSHrpMCNE7Th0mpbNMSxdEdwvH4hu2SM=";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = true;
+
+  meta = with lib; {
+    homepage = "https://gitlab.inria.fr/fpottier/fix/";
+    description = "Simple OCaml module for computing the least solution of a system of monotone equations";
+    license = licenses.lgpl2Only;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/flac/default.nix b/nixpkgs/pkgs/development/ocaml-modules/flac/default.nix
new file mode 100644
index 000000000000..c30236e0e2c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/flac/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, ogg, flac }:
+
+buildDunePackage rec {
+  pname = "flac";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-flac";
+    rev = "v${version}";
+    sha256 = "sha256-HRRQd//e6Eh2HuyO+U00ILu5FoBT9jf/nRJzDOie70A=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ogg flac.dev ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-flac";
+    description = "Bindings for flac";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/flex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/flex/default.nix
new file mode 100644
index 000000000000..b8a56d5224fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/flex/default.nix
@@ -0,0 +1,22 @@
+{ buildDunePackage, fetchFromGitHub, lib, reason }:
+
+buildDunePackage rec {
+  pname = "flex";
+  version = "unstable-2020-09-12";
+
+  src = fetchFromGitHub {
+    owner = "jordwalke";
+    repo = "flex";
+    rev = "6ff12fe4f96749ffd3c0ea3d9962742767937b4a";
+    sha256 = "sha256-GomTOdlU5ZwElKK8CM4DEMr51YDIrFKmTxUCGMLL3c4=";
+  };
+
+  nativeBuildInputs = [ reason ];
+
+  meta = with lib; {
+    description = "Native Reason implementation of CSS Flexbox layout. An Yoga project port";
+    homepage = "https://github.com/jordwalke/flex";
+    maintainers = with maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fmt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fmt/default.nix
new file mode 100644
index 000000000000..b82df99d2df0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fmt/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner }:
+
+if lib.versionOlder ocaml.version "4.08"
+then throw "fmt is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "0.9.0";
+  pname = "ocaml${ocaml.version}-fmt";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/fmt/releases/fmt-${version}.tbz";
+    sha256 = "sha256-8fsggFoi3XWhN9cnBKNw53ic9r32OUjmgX0cImwUEmE=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ cmdliner topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/fmt";
+    license = licenses.isc;
+    description = "OCaml Format pretty-printer combinators";
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix
new file mode 100644
index 000000000000..5d7e5f59b8bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, fontconfig, ocaml }:
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-fontconfig";
+  version = "unstable-2013-11-03";
+
+  src = fetchFromGitHub {
+    owner = "flh";
+    repo = "ocaml-fontconfig";
+    rev = "42daf1697ffcee9c89ee4be3103b6427f7a7b7e5";
+    sha256 = "1fw6bzydmnyh2g4x35mcbg0hypnxqhynivk4nakcsx7prr8zr3yh";
+  };
+
+  postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "4.03") ''
+    substituteInPlace extract_consts.ml \
+      --replace String.lowercase String.lowercase_ascii \
+      --replace String.capitalize String.capitalize_ascii
+  '';
+
+  nativeBuildInputs = [ pkg-config ocaml ];
+  buildInputs = [ fontconfig ];
+
+  strictDeps = true;
+
+  makeFlags = [
+    "OCAML_STDLIB_DIR=$(out)/lib/ocaml/${lib.getVersion ocaml}/site-lib/"
+    "OCAML_HAVE_OCAMLOPT=yes"
+  ];
+
+  meta = {
+    description = "Fontconfig bindings for OCaml";
+    license = lib.licenses.gpl2Plus;
+    platforms = ocaml.meta.platforms;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix
new file mode 100644
index 000000000000..db742f929029
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, astring }:
+
+if lib.versionOlder ocaml.version "4.03"
+then throw "fpath is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-fpath";
+  version = "0.7.3";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/fpath/releases/fpath-${version}.tbz";
+    sha256 = "03z7mj0sqdz465rc4drj1gr88l9q3nfs374yssvdjdyhjbqqzc0j";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  propagatedBuildInputs = [ astring ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "OCaml module for handling file system paths with POSIX and Windows conventions";
+    homepage = "https://erratique.ch/software/fpath";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/frei0r/default.nix b/nixpkgs/pkgs/development/ocaml-modules/frei0r/default.nix
new file mode 100644
index 000000000000..4f4a64d220a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/frei0r/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, frei0r }:
+
+buildDunePackage rec {
+  pname = "frei0r";
+  version = "0.1.2";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-frei0r";
+    rev = "v${version}";
+    sha256 = "sha256-eh/ymZO/3a1z6uvZdnXgma/7AU2NBVs2lddA+R/kuQA=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ frei0r ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-frei0r";
+    description = "Bindings for the frei0r API which provides video effects";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix
new file mode 100644
index 000000000000..c4ec0908fb0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, menhir }:
+
+buildDunePackage rec {
+  pname = "FrontC";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = "FrontC";
+    rev = "v${version}";
+    sha256 = "1mi1vh4qgscnb470qwidccaqd068j1bqlz6pf6wddk21paliwnqb";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs = [ menhir ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+    description = "C Parsing Library";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix b/nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix
new file mode 100644
index 000000000000..96fd6d0749ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, cmdliner
+, functoria-runtime
+, rresult, astring, fmt, logs, bos, fpath, emile, uri
+, alcotest
+}:
+
+buildDunePackage {
+  pname   = "functoria";
+  inherit (functoria-runtime) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ cmdliner rresult astring fmt logs bos fpath emile uri ];
+
+  # Tests are not compatible with cmdliner 1.3
+  doCheck = false;
+  checkInputs = [ alcotest functoria-runtime ];
+
+  meta = with lib; {
+    description = "DSL to organize functor applications";
+    homepage    = "https://github.com/mirage/functoria";
+    license     = licenses.isc;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix b/nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix
new file mode 100644
index 000000000000..3ede6096e508
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl, cmdliner }:
+
+buildDunePackage rec {
+  pname = "functoria-runtime";
+  version = "4.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage/releases/download/v${version}/mirage-${version}.tbz";
+    hash = "sha256-FKCdzrRJVpUrCWqrTiE8l00ZKJOYsvI9mNzJ0ZxDBwg=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ cmdliner ];
+
+  meta = with lib; {
+    homepage    = "https://github.com/mirage/functoria";
+    license     = licenses.isc;
+    description = "Runtime support library for functoria-generated code";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/functory/default.nix b/nixpkgs/pkgs/development/ocaml-modules/functory/default.nix
new file mode 100644
index 000000000000..0901de7c53b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functory/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, ocaml, findlib }:
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.02" then {
+    version = "0.6";
+    sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y";
+  } else {
+    version = "0.5";
+    sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3";
+  };
+in
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "functory is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-functory";
+  inherit (param) version;
+
+  src = fetchurl {
+    url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz";
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  strictDeps = true;
+
+  installTargets = [ "ocamlfind-install" ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://www.lri.fr/~filliatr/functory/";
+    description = "Distributed computing library for Objective Caml which facilitates distributed execution of parallelizable computations in a seamless fashion";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix
new file mode 100644
index 000000000000..1db8180934bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml
+, camlp-streams, cppo, cryptokit, ocurl, yojson
+, ounit2
+}:
+
+buildDunePackage rec {
+  pname = "gapi-ocaml";
+  version = "0.4.5";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "astrada";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-qlQEE8l/H22bb1VcK9YehR+9L5XepMu8JY7OLw1OIXg=";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  propagatedBuildInputs = [ camlp-streams cryptokit ocurl yojson ];
+
+  doCheck = true;
+  checkInputs = [ ounit2 ];
+
+  meta = {
+    description = "OCaml client for google services";
+    homepage = "https://github.com/astrada/gapi-ocaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bennofs ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gd/default.nix
new file mode 100644
index 000000000000..86817f05abb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gd/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, gd }:
+
+buildDunePackage rec {
+  pname = "gd";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-gd";
+    rev = "v${version}";
+    sha256 = "sha256-78cqxVEappTybRLk7Y6vW1POvZKFIxtGNVcmkKq9GEE=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ gd ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-gd";
+    description = "OCaml bindings for gd";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gen/default.nix
new file mode 100644
index 000000000000..86dbc61f6faf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gen/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml
+, seq
+, qcheck, ounit2
+}:
+
+buildDunePackage rec {
+  version = "1.1";
+  pname = "gen";
+  minimalOCamlVersion = "4.03";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "gen";
+    rev = "v${version}";
+    hash = "sha256-ZytPPGhmt/uANaSgkgsUBOwyQ9ka5H4J+5CnJpEdrNk=";
+  };
+
+  propagatedBuildInputs = [ seq ];
+  checkInputs = [ qcheck ounit2 ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    homepage = "https://github.com/c-cube/gen";
+    description = "Simple, efficient iterators for OCaml";
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/default.nix
new file mode 100644
index 000000000000..1901bfa59bfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/default.nix
@@ -0,0 +1,42 @@
+{ buildDunePackage
+, ocaml
+, lib
+, ppxlib
+, fetchFromGitHub
+, ojs
+, js_of_ocaml-compiler
+, nodejs
+}:
+
+buildDunePackage rec {
+  pname = "gen_js_api";
+  version = "1.1.2";
+
+  src = fetchFromGitHub {
+    owner = "LexiFi";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-tplbnQ/1dzZq8m/ibMAkGqY8RHQRmBPHOwh0dGuZCJM=";
+  };
+
+  minimalOCamlVersion = "4.11";
+
+  propagatedBuildInputs = [ ojs ppxlib ];
+  nativeCheckInputs = [ js_of_ocaml-compiler nodejs ];
+  doCheck = lib.versionAtLeast ocaml.version "4.13";
+
+  meta = {
+    homepage = "https://github.com/LexiFi/gen_js_api";
+    description = "Easy OCaml bindings for JavaScript libraries";
+    longDescription = ''
+      gen_js_api aims at simplifying the creation of OCaml bindings for
+      JavaScript libraries. Authors of bindings write OCaml signatures for
+      JavaScript libraries and the tool generates the actual binding code with a
+      combination of implicit conventions and explicit annotations.
+
+      gen_js_api is to be used with the js_of_ocaml compiler.
+    '';
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.bcc32 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/ojs.nix b/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/ojs.nix
new file mode 100644
index 000000000000..0cfe8f4bbfc1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gen_js_api/ojs.nix
@@ -0,0 +1,25 @@
+{ buildDunePackage
+, gen_js_api
+, js_of_ocaml-compiler
+}:
+
+buildDunePackage rec {
+  pname = "ojs";
+
+  inherit (gen_js_api) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ js_of_ocaml-compiler ];
+
+  doCheck = false; # checks depend on gen_js_api, which is a cycle
+
+  minimalOCamlVersion = "4.08";
+
+  meta = {
+    inherit (gen_js_api.meta) homepage license maintainers;
+    description = "Runtime Library for gen_js_api generated libraries";
+    longDescription = ''
+      To be used in conjunction with gen_js_api
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix b/nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix
new file mode 100644
index 000000000000..14537c24c8bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, base, fmt
+}:
+
+buildDunePackage rec {
+  pname = "genspio";
+  version = "0.0.3";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = pname;
+    rev = "${pname}.${version}";
+    sha256 = "sha256:1788cnn10idp5i1hggg4pys7k0w8m3h2p4xa42jipfg4cpj7shaf";
+  };
+
+  propagatedBuildInputs = [ base fmt ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://smondet.gitlab.io/genspio-doc/";
+    description = "Typed EDSL to generate POSIX Shell scripts";
+    license = licenses.asl20;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/getopt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/getopt/default.nix
new file mode 100644
index 000000000000..db03f7b07939
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/getopt/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "getopt";
+  version = "20230213";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "scemama";
+    repo = "ocaml-getopt";
+    rev = version;
+    hash = "sha256-oYDm945LgjIW+8x7UrO4FlbHywnu8480aiEVvnjBxc8=";
+  };
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/scemama/ocaml-getopt";
+    description = "Parsing of command line arguments (similar to GNU GetOpt) for OCaml";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gg/default.nix
new file mode 100644
index 000000000000..c3bf3a2ec938
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gg/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild }:
+
+let
+  homepage = "https://erratique.ch/software/gg";
+  version = "1.0.0";
+in
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "gg is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation {
+
+  pname = "ocaml${ocaml.version}-gg";
+  inherit version;
+
+  src = fetchurl {
+    url = "${homepage}/releases/gg-${version}.tbz";
+    sha256 = "sha256:0j7bpj8k17csnz6v6frkz9aycywsb7xmznnb31g8rbfk3626f3ci";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "Basic types for computer graphics in OCaml";
+    longDescription = ''
+      Gg is an OCaml module providing basic types for computer graphics. It
+      defines types and functions for floats, vectors, points, sizes,
+      matrices, quaternions, axis aligned boxes, colors, color spaces, and
+      raster data.
+    '';
+    inherit homepage;
+    inherit (ocaml.meta) platforms;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/default.nix b/nixpkgs/pkgs/development/ocaml-modules/git/default.nix
new file mode 100644
index 000000000000..c3f27a3c7b97
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchurl, buildDunePackage
+, alcotest, mirage-crypto-rng, git-binary
+, angstrom, astring, cstruct, decompress, digestif, encore, fmt, checkseum
+, fpath, ke, logs, lwt, ocamlgraph, uri, rresult, base64, hxd
+, result, bigstringaf, optint, mirage-flow, domain-name, emile
+, mimic, carton, carton-lwt, carton-git, ipaddr, psq, crowbar, alcotest-lwt, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "git";
+  version = "3.14.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-git/releases/download/${version}/git-${version}.tbz";
+    hash = "sha256-u1Nq8zo2YfAnRXib+IqYV0sWOGraqxrJC33NdDQaYsE=";
+  };
+
+  # remove changelog for the carton package
+  postPatch = ''
+    rm CHANGES.carton.md
+  '';
+
+  buildInputs = [
+    base64
+  ];
+  propagatedBuildInputs = [
+    angstrom astring checkseum cstruct decompress digestif encore fmt fpath
+    ke logs lwt ocamlgraph uri rresult result bigstringaf optint mirage-flow
+    domain-name emile mimic carton carton-lwt carton-git ipaddr psq hxd
+  ];
+  nativeCheckInputs = [
+    git-binary
+  ];
+  checkInputs = [
+    alcotest alcotest-lwt mirage-crypto-rng crowbar cmdliner
+  ];
+  doCheck = !stdenv.isAarch64;
+
+  meta = {
+    description = "Git format and protocol in pure OCaml";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ sternenseemann vbgl ];
+    homepage = "https://github.com/mirage/ocaml-git";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/git/mirage.nix
new file mode 100644
index 000000000000..28c49b70b183
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/mirage.nix
@@ -0,0 +1,96 @@
+{ lib
+, buildDunePackage
+, git
+, mimic
+, mimic-happy-eyeballs
+, base64
+, git-paf
+, awa
+, awa-mirage
+, dns
+, dns-client
+, tls
+, tls-mirage
+, uri
+, hex
+, happy-eyeballs-mirage
+, happy-eyeballs
+, ca-certs-nss
+, mirage-crypto
+, ptime
+, x509
+, cstruct
+, tcpip
+, domain-name
+, fmt
+, ipaddr
+, lwt
+, mirage-clock
+, mirage-flow
+, mirage-random
+, mirage-time
+, result
+, rresult
+, alcotest
+, alcotest-lwt
+, bigstringaf
+, logs
+, ke
+}:
+
+buildDunePackage {
+  pname = "git-mirage";
+
+  inherit (git) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [
+    dns
+    dns-client
+    happy-eyeballs-mirage
+    ipaddr
+    mirage-random
+    rresult
+  ];
+
+  propagatedBuildInputs = [
+    git
+    mimic
+    mimic-happy-eyeballs
+    base64
+    git-paf
+    awa
+    awa-mirage
+    tls
+    tls-mirage
+    uri
+    hex
+    happy-eyeballs
+    ca-certs-nss
+    mirage-crypto
+    ptime
+    x509
+    cstruct
+    tcpip
+    domain-name
+    fmt
+    lwt
+    mirage-clock
+    mirage-flow
+    mirage-time
+    result
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    bigstringaf
+    logs
+    ke
+  ];
+
+  meta = git.meta // {
+    description = "Package to use ocaml-git with MirageOS backend";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/paf.nix b/nixpkgs/pkgs/development/ocaml-modules/git/paf.nix
new file mode 100644
index 000000000000..9f38f0c8606a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/paf.nix
@@ -0,0 +1,55 @@
+{ lib, buildDunePackage
+, git
+, mimic
+, paf
+, ca-certs-nss
+, fmt
+, ipaddr
+, logs
+, lwt
+, mirage-clock
+, mirage-time
+, result
+, rresult
+, tls
+, uri
+, bigstringaf
+, domain-name
+, httpaf
+, mirage-flow
+, tls-mirage
+}:
+
+buildDunePackage {
+  pname = "git-paf";
+
+  inherit (git) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    git
+    mimic
+    paf
+    ca-certs-nss
+    fmt
+    lwt
+    result
+    rresult
+    ipaddr
+    logs
+    mirage-clock
+    mirage-time
+    tls
+    uri
+    bigstringaf
+    domain-name
+    httpaf
+    mirage-flow
+    tls-mirage
+  ];
+
+  meta = git.meta // {
+    description = "Package to use HTTP-based ocaml-git with MirageOS backend";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/git/unix.nix
new file mode 100644
index 000000000000..adad5dc0792e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/unix.nix
@@ -0,0 +1,48 @@
+{ buildDunePackage, git
+, rresult, result, bigstringaf
+, fmt, bos, fpath, uri, digestif, logs, lwt
+, mirage-clock, mirage-clock-unix, astring, awa, cmdliner
+, decompress, domain-name, ipaddr, mtime
+, tcpip, awa-mirage, mirage-flow, mirage-unix
+, alcotest, alcotest-lwt, base64, cstruct
+, ke, mirage-crypto-rng, git-binary
+, ptime, mimic, ca-certs-nss, tls, tls-mirage
+, cacert, happy-eyeballs-lwt, git-mirage
+}:
+
+buildDunePackage {
+  pname = "git-unix";
+  inherit (git) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [
+    awa
+    awa-mirage
+    cmdliner
+    mirage-clock
+    tcpip
+  ];
+  propagatedBuildInputs = [
+    rresult result bigstringaf
+    fmt bos fpath digestif logs lwt
+    astring decompress
+    domain-name ipaddr mirage-flow mirage-unix
+    cstruct ptime mimic ca-certs-nss
+    tls tls-mirage git happy-eyeballs-lwt
+    git-mirage mirage-clock-unix
+  ];
+  checkInputs = [
+    alcotest alcotest-lwt base64 ke
+    mirage-crypto-rng
+    uri mtime
+    cacert # sets up NIX_SSL_CERT_FILE
+  ];
+  nativeCheckInputs = [ git-binary ];
+  doCheck = true;
+
+  meta = {
+    description = "Unix backend for the Git protocol(s)";
+    inherit (git.meta) homepage license maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/github/data.nix b/nixpkgs/pkgs/development/ocaml-modules/github/data.nix
new file mode 100644
index 000000000000..803642b509dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/github/data.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, github
+, yojson, atdgen
+}:
+
+buildDunePackage {
+  pname = "github-data";
+  inherit (github) version src;
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [
+    atdgen
+  ];
+
+  propagatedBuildInputs = [
+    yojson
+    atdgen
+  ];
+
+  meta = github.meta // {
+    description = "GitHub APIv3 data library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/github/default.nix b/nixpkgs/pkgs/development/ocaml-modules/github/default.nix
new file mode 100644
index 000000000000..ec1816f8e5ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/github/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, uri, cohttp, lwt, cohttp-lwt, github-data, yojson, stringext
+}:
+
+buildDunePackage rec {
+  pname = "github";
+  version = "4.4.1";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = "ocaml-github";
+    rev = version;
+    sha256 = "sha256-psUIiIvjVV2NTlBtHnBisWreaKKnsqIjKT2+mLnfsxg=";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    uri
+    cohttp
+    lwt
+    cohttp-lwt
+    github-data
+    yojson
+    stringext
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-github";
+    description = "GitHub APIv3 OCaml library";
+    license = licenses.mit;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/github/jsoo.nix b/nixpkgs/pkgs/development/ocaml-modules/github/jsoo.nix
new file mode 100644
index 000000000000..d387d2fbde01
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/github/jsoo.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, github
+, cohttp, cohttp-lwt-jsoo, js_of_ocaml-lwt
+}:
+
+buildDunePackage {
+  pname = "github-jsoo";
+  inherit (github) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    github
+    cohttp
+    cohttp-lwt-jsoo
+    js_of_ocaml-lwt
+  ];
+
+  meta = github.meta // {
+    description = "GitHub APIv3 JavaScript library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/github/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/github/unix.nix
new file mode 100644
index 000000000000..342be1069ce9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/github/unix.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, github
+, cohttp, cohttp-lwt-unix, stringext, cmdliner, lwt
+}:
+
+buildDunePackage {
+  pname = "github-unix";
+  inherit (github) version src;
+
+  postPatch = ''
+    substituteInPlace unix/dune --replace 'github bytes' 'github'
+  '';
+
+  propagatedBuildInputs = [
+    github
+    cohttp
+    cohttp-lwt-unix
+    stringext
+    cmdliner
+    lwt
+  ];
+
+  meta = github.meta // {
+    description = "GitHub APIv3 Unix library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gluon/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gluon/default.nix
new file mode 100644
index 000000000000..cb926cbb0709
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gluon/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, bytestring
+, config
+, libc
+, rio
+, uri
+}:
+
+buildDunePackage rec {
+  pname = "gluon";
+  version = "0.0.9";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/riot-ml/gluon/releases/download/${version}/gluon-${version}.tbz";
+    hash = "sha256-YWJCPokY1A7TGqCGoxJl14oKDVeMNybEEB7KiK92WSo=";
+  };
+
+  buildInputs = [
+    config
+  ];
+
+  propagatedBuildInputs = [
+    bytestring
+    libc
+    rio
+    uri
+  ];
+
+  meta = {
+    description = "Minimal, portable, and fast API on top of the operating-system's evented I/O API";
+    homepage = "https://github.com/riot-ml/gluon";
+    changelog = "https://github.com/riot-ml/gluon/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = [ ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gluten/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gluten/default.nix
new file mode 100644
index 000000000000..1c8b2597b2bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gluten/default.nix
@@ -0,0 +1,32 @@
+{ buildDunePackage
+, bigstringaf
+, faraday
+, fetchurl
+, lib
+}:
+
+buildDunePackage rec {
+  pname = "gluten";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "https://github.com/anmonteiro/gluten/releases/download/${version}/gluten-${version}.tbz";
+    hash = "sha256-VZcbMFDRv+TVSXG05wUYxaWbTnBSa43RiVx9OesPnZY=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    bigstringaf
+    faraday
+  ];
+
+  doCheck = false; # No tests
+
+  meta = {
+    description = "Implementation of a platform specific runtime code for driving network libraries based on state machines, such as http/af, h2 and websocketaf";
+    license = lib.licenses.bsd3;
+    homepage = "https://github.com/anmonteiro/gluten";
+    maintainers = with lib.maintainers; [ anmonteiro ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gluten/eio.nix b/nixpkgs/pkgs/development/ocaml-modules/gluten/eio.nix
new file mode 100644
index 000000000000..9c78b1d73cd4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gluten/eio.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, gluten, eio }:
+
+buildDunePackage {
+  pname = "gluten-eio";
+  inherit (gluten) src version;
+
+  propagatedBuildInputs = [ gluten eio ];
+
+  meta = gluten.meta // {
+    description = "EIO runtime for gluten";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt-unix.nix
new file mode 100644
index 000000000000..c3a360322a14
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt-unix.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage
+, faraday-lwt-unix
+, gluten
+, gluten-lwt
+, lwt_ssl
+}:
+
+buildDunePackage rec {
+  pname = "gluten-lwt-unix";
+  inherit (gluten) doCheck meta src version;
+
+  propagatedBuildInputs = [
+    faraday-lwt-unix
+    gluten-lwt
+    lwt_ssl
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt.nix
new file mode 100644
index 000000000000..e4cfb0d8db02
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gluten/lwt.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage
+, gluten
+, lwt
+}:
+
+buildDunePackage rec {
+  pname = "gluten-lwt";
+  inherit (gluten) doCheck meta src version;
+
+  propagatedBuildInputs = [
+    gluten
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix
new file mode 100644
index 000000000000..59dbebe58e27
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, ocaml, fetchurl, alcotest, fmt }:
+
+buildDunePackage rec {
+  pname = "gmap";
+  version = "0.3.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/gmap/releases/download/${version}/gmap-${version}.tbz";
+    sha256 = "073wa0lrb0jj706j87cwzf1a8d1ff14100mnrjs8z3xc4ri9xp84";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  checkInputs = [ alcotest fmt ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    description = "Heterogenous maps over a GADT";
+    homepage = "https://github.com/hannesm/gmap";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gnuplot/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gnuplot/default.nix
new file mode 100644
index 000000000000..038863aad978
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gnuplot/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, gnuplot, iso8601 }:
+
+buildDunePackage rec {
+  pname = "gnuplot";
+  version = "0.7";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner  = "c-cube";
+    repo   = "ocaml-${pname}";
+    rev    = "v${version}";
+    sha256 = "02pzi3lb57ysrdsba743s3vmnapjbxgq8ynlzpxbbs6cn1jj6ch9";
+  };
+
+  propagatedBuildInputs = [ gnuplot iso8601 ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Ocaml bindings to Gnuplot";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphics/default.nix b/nixpkgs/pkgs/development/ocaml-modules/graphics/default.nix
new file mode 100644
index 000000000000..02edaded7c03
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphics/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, dune-configurator, libX11 }:
+
+buildDunePackage rec {
+
+  pname = "graphics";
+  version = "5.1.2";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/graphics/releases/download/${version}/graphics-${version}.tbz";
+    sha256 = "sha256-QA/YHSPxy0FGuWl5NCwkeXHdVPWHn/0vgOx80CEuMtQ=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libX11 ];
+
+  meta = {
+    homepage = "https://github.com/ocaml/graphics";
+    description = "Set of portable drawing primitives";
+    license = lib.licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphql/cohttp.nix b/nixpkgs/pkgs/development/ocaml-modules/graphql/cohttp.nix
new file mode 100644
index 000000000000..b202d46abd53
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/cohttp.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildDunePackage
+, ocaml-crunch
+, astring
+, cohttp
+, digestif
+, graphql
+, ocplib-endian
+, alcotest
+, cohttp-lwt-unix
+, graphql-lwt
+}:
+
+buildDunePackage rec {
+  pname = "graphql-cohttp";
+
+  inherit (graphql) version src;
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [ ocaml-crunch ];
+  propagatedBuildInputs = [ astring cohttp digestif graphql ocplib-endian ];
+
+  checkInputs = lib.optionals doCheck [ alcotest cohttp-lwt-unix graphql-lwt ];
+
+  doCheck = true;
+
+  meta = graphql.meta // {
+    description = "Run GraphQL servers with “cohttp”";
+  };
+
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix b/nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix
new file mode 100644
index 000000000000..679d89f44b10
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, alcotest, graphql_parser, rresult, yojson }:
+
+buildDunePackage rec {
+  pname = "graphql";
+
+  inherit (graphql_parser) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ graphql_parser rresult yojson ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = graphql_parser.meta // {
+    description = "Build GraphQL schemas and execute queries against them";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix
new file mode 100644
index 000000000000..cbdcba64abb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, alcotest, graphql, ocaml_lwt }:
+
+buildDunePackage rec {
+  pname = "graphql-lwt";
+
+  inherit (graphql) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ graphql ocaml_lwt ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = graphql.meta // {
+    description = "Build GraphQL schemas with Lwt support";
+  };
+
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix b/nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix
new file mode 100644
index 000000000000..4042e65772bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl, alcotest, fmt, menhir, re }:
+
+buildDunePackage rec {
+  pname = "graphql_parser";
+  version = "0.14.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/andreas/ocaml-graphql-server/releases/download/${version}/graphql-${version}.tbz";
+    sha256 = "sha256-v4v1ueF+NV7LvYIVinaf4rE450Z1P9OiMAito6/NHAY=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [ fmt re ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/andreas/ocaml-graphql-server";
+    description = "Library for parsing GraphQL queries";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix b/nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix
new file mode 100644
index 000000000000..9314c1033d4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix
@@ -0,0 +1,41 @@
+{ lib, buildDunePackage, fetchFromGitHub, alcotest, reason
+, result
+, ppxlib
+, yojson }:
+
+buildDunePackage rec {
+  pname = "graphql_ppx";
+  version = "1.2.2";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "reasonml-community";
+    repo = "graphql-ppx";
+    rev = "v${version}";
+    sha256 = "sha256-+WJhA2ixZHiSZBoX14dnQKk7JfVAIME4JooNSnhRp44=";
+  };
+
+  nativeBuildInputs = [ reason ];
+
+  buildInputs = [ ppxlib reason ];
+
+  propagatedBuildInputs = [
+    reason
+    result
+    yojson
+  ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/reasonml-community/graphql_ppx";
+    description = "GraphQL PPX rewriter for Bucklescript/ReasonML";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ Zimmi48 jtcoolen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix
new file mode 100644
index 000000000000..27791d6aa5f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, buildDunePackage, pkg-config, gsl, darwin, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "gsl";
+  version = "1.25.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "mmottl";
+    repo = "gsl-ocaml";
+    rev = version;
+    hash = "sha256-vxXv0ZcToXmdYu5k0aLdV3seNn3Y6Sgg+8dpy3Iw68I=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator gsl ];
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Accelerate ];
+
+  meta = with lib; {
+    homepage = "https://mmottl.github.io/gsl-ocaml/";
+    description = "OCaml bindings to the GNU Scientific Library";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gstreamer/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gstreamer/default.nix
new file mode 100644
index 000000000000..34407299914a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gstreamer/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, dune-configurator, AppKit, Foundation, pkg-config, glib, gst_all_1 }:
+
+buildDunePackage rec {
+  pname = "gstreamer";
+  version = "0.3.1";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-gstreamer";
+    rev = "v${version}";
+    sha256 = "0y8xi1q0ld4hrk96bn6jfh9slyjrxmnlhm662ynacp3yzalp8jji";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AppKit Foundation ];
+  propagatedBuildInputs = [ glib.dev gst_all_1.gstreamer.dev gst_all_1.gst-plugins-base ];
+
+  CFLAGS_COMPILE = [
+    "-I${glib.dev}/include/glib-2.0"
+    "-I${glib.out}/lib/glib-2.0/include"
+    "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"
+    "-I${gst_all_1.gstreamer.dev}/include/gstreamer-1.0"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-gstreamer";
+    description = "Bindings for the GStreamer library which provides functions for playning and manipulating multimedia streams";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/h2/default.nix b/nixpkgs/pkgs/development/ocaml-modules/h2/default.nix
new file mode 100644
index 000000000000..e8d9d42ff602
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/h2/default.nix
@@ -0,0 +1,55 @@
+{ buildDunePackage
+, lib
+, fetchFromGitHub
+, ocaml
+, hpack
+, angstrom
+, faraday
+, base64
+, psq
+, httpaf
+, alcotest
+, yojson
+, hex
+}:
+
+let
+  http2-frame-test-case = fetchFromGitHub {
+    owner = "http2jp";
+    repo = "http2-frame-test-case";
+    rev = "5c67db0d4d68e1fb7d3a241d6e01fc04d981f465";
+    sha256 = "16yyb37f8mk9saw7ndjs5is67yq7qa6b6y7k0c75ibxi4n9aw1r3";
+  };
+in
+
+buildDunePackage rec {
+  pname = "h2";
+
+  inherit (hpack)
+    version
+    src
+    ;
+
+  propagatedBuildInputs = [
+    angstrom
+    faraday
+    base64
+    psq
+    hpack
+    httpaf
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    ln -s "${http2-frame-test-case}" lib_test/http2-frame-test-case
+  '';
+  checkInputs = [
+    alcotest
+    yojson
+    hex
+  ];
+
+  meta = hpack.meta // {
+    description = "High-performance, memory-efficient, and scalable HTTP/2 library for OCaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix
new file mode 100644
index 000000000000..8ed2011b31c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix
@@ -0,0 +1,44 @@
+{ lib, fetchFromGitHub, buildDunePackage, core, core_unix ? null, pkg-config
+, sqlite }:
+buildDunePackage rec {
+  pname = "hack_parallel";
+  version = "1.0.1";
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "rvantonder";
+    repo = "hack_parallel";
+    rev = version;
+    sha256 = "0qjlkw35r4q2cm0n2x0i73zvx1xgrp6axaia2nm8zxpm49mid629";
+  };
+
+  patches = [ ./hack_parallel.patch ];
+
+  postPatch = ''
+    substituteInPlace src/third-party/hack_core/hack_caml.ml --replace 'include Pervasives' ""
+    substituteInPlace \
+      src/interface/hack_parallel_intf.mli \
+      src/procs/worker.ml \
+      src/third-party/hack_core/hack_core_list.ml \
+      src/third-party/hack_core/hack_result.ml* \
+      src/utils/collections/myMap.ml \
+      src/utils/daemon.ml* \
+      src/utils/exit_status.ml \
+      src/utils/hack_path.ml \
+      src/utils/measure.ml \
+      src/utils/timeout.ml \
+      --replace Pervasives. Stdlib.
+    substituteInPlace src/utils/sys_utils.ml --replace String.create Bytes.create
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ core core_unix sqlite ];
+
+  meta = {
+    description =
+      "Core parallel and shared memory library used by Hack, Flow, and Pyre";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/rvantonder/hack_parallel";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/hack_parallel.patch b/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/hack_parallel.patch
new file mode 100644
index 000000000000..174803a34818
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/hack_parallel.patch
@@ -0,0 +1,68 @@
+diff --git a/src/heap/sharedMem.ml b/src/heap/sharedMem.ml
+index 600e272..511b724 100644
+--- a/src/heap/sharedMem.ml
++++ b/src/heap/sharedMem.ml
+@@ -521,7 +521,7 @@ end = struct
+ 
+     let stack: t option ref = ref None
+ 
+-    let has_local_changes () = Core_kernel.Option.is_some (!stack)
++    let has_local_changes () = Core.Option.is_some (!stack)
+ 
+     let rec mem stack_opt key =
+       match stack_opt with
+diff --git a/src/interface/memory.ml b/src/interface/memory.ml
+index 3554b17..09aa1f5 100644
+--- a/src/interface/memory.ml
++++ b/src/interface/memory.ml
+@@ -66,10 +66,10 @@ let get_heap_handle () =
+ 
+ 
+ let heap_use_ratio () =
+-  Core_kernel.Float.of_int (SharedMemory.heap_size ()) /.
+-  Core_kernel.Float.of_int initial_heap_size
++  Core.Float.of_int (SharedMemory.heap_size ()) /.
++  Core.Float.of_int initial_heap_size
+ 
+ 
+ let slot_use_ratio () =
+   let { SharedMemory.used_slots; slots; _ } = SharedMemory.hash_stats () in
+-  Core_kernel.Float.of_int used_slots /. Core_kernel.Float.of_int slots
++  Core.Float.of_int used_slots /. Core.Float.of_int slots
+diff --git a/src/interface/scheduler.ml b/src/interface/scheduler.ml
+index 9b8282a..b5d41b5 100644
+--- a/src/interface/scheduler.ml
++++ b/src/interface/scheduler.ml
+@@ -48,7 +48,7 @@ let map_reduce
+     | Some exact_size when exact_size > 0 ->
+       (List.length work / exact_size) + 1
+     | _ ->
+-      let bucket_multiplier = Core_kernel.Int.min bucket_multiplier (1 + (List.length work / 400)) in
++      let bucket_multiplier = Core.Int.min bucket_multiplier (1 + (List.length work / 400)) in
+       number_of_workers * bucket_multiplier
+   in
+   MultiWorker.call
+diff --git a/src/utils/dune b/src/utils/dune
+index 50a4c42..45e4a5a 100644
+--- a/src/utils/dune
++++ b/src/utils/dune
+@@ -15,6 +15,7 @@
+     sysinfo)
+   (libraries
+     core
++    core_unix
+     str
+     hack_parallel.collections
+     hack_parallel.disk
+diff --git a/src/utils/hh_logger.ml b/src/utils/hh_logger.ml
+index 4c99f05..8075ed5 100644
+--- a/src/utils/hh_logger.ml
++++ b/src/utils/hh_logger.ml
+@@ -9,6 +9,7 @@
+ *)
+ 
+ open Core
++module Unix = Core_unix
+ 
+ let timestamp_string () =
+   let open Unix in
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch
new file mode 100644
index 000000000000..a5c0b6720699
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch
@@ -0,0 +1,14 @@
+diff --git a/hacl-star-raw/karamel/include/krml/internal/target.h b/hacl-star-raw/karamel/include/krml/internal/target.h
+index 695873a..c0aed18 100644
+--- a/hacl-star-raw/karamel/include/krml/internal/target.h
++++ b/hacl-star-raw/karamel/include/krml/internal/target.h
+@@ -82,6 +82,9 @@
+ #  endif
+ #  if (defined(_MSC_VER) || (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)))
+ #    define KRML_ALIGNED_MALLOC(X, Y) _aligned_malloc(Y, X)
++#  elif defined(__APPLE__)
++#    include <mm_malloc.h>
++#    define KRML_ALIGNED_MALLOC(X, Y) _mm_malloc(Y, X)
+ #  else
+ #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
+ #  endif
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix
new file mode 100644
index 000000000000..18d307655584
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, hacl-star-raw, zarith, cppo, alcotest, secp256k1-internal, qcheck-core, cstruct }:
+
+
+buildDunePackage {
+  pname = "hacl-star";
+
+  inherit (hacl-star-raw) version src meta doCheck;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    hacl-star-raw
+    zarith
+  ];
+
+  nativeBuildInputs = [
+    cppo
+  ];
+
+  checkInputs = [
+    alcotest
+    secp256k1-internal
+    qcheck-core
+    cstruct
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix
new file mode 100644
index 000000000000..b4b8c1741535
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix
@@ -0,0 +1,89 @@
+{ lib
+, which
+, stdenv
+, fetchzip
+, opaline
+, cmake
+, ocaml
+, findlib
+, hacl-star
+, ctypes
+, cppo
+}:
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-hacl-star-raw";
+  version = "0.7.1";
+
+  src = fetchzip {
+    url = "https://github.com/cryspen/hacl-packages/releases/download/ocaml-v${version}/hacl-star.${version}.tar.gz";
+    hash = "sha256-TcAEaJou4BOVXSz5DYewzKfvIpjXmhLAlgF0hlq3ToQ=";
+    stripRoot = false;
+  };
+
+  patches = [
+    ./aligned-alloc.patch
+  ];
+
+  # strictoverflow is disabled because it breaks aarch64-darwin
+  hardeningDisable = [ "strictoverflow" ];
+
+  # Compatibility with ctypes ≥ 0.21
+  # see: https://github.com/cryspen/hacl-packages/commit/81303b83a54a92d3b5f54f1b8ddbea60438cc2bf
+  postPatch = ''
+    substituteInPlace hacl-star-raw/META --replace-warn 'requires="ctypes"' 'requires="ctypes ctypes.stubs"'
+    patchShebangs ./
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    make -C hacl-star-raw build-c
+    make -C hacl-star-raw build-bindings
+
+    runHook postBuild
+  '';
+
+  preInstall = ''
+    mkdir $out
+    mkdir -p $OCAMLFIND_DESTDIR/stublibs
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    make -C hacl-star-raw install
+
+    runHook postInstall
+  '';
+
+  dontUseCmakeConfigure = true;
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  createFindlibDestdir = true;
+
+  nativeBuildInputs = [
+    which
+    cmake
+    ocaml
+    findlib
+  ];
+
+  propagatedBuildInputs = [
+    ctypes
+  ];
+
+  checkInputs = [
+    cppo
+  ];
+
+  strictDeps = true;
+
+  doCheck = true;
+
+  meta = {
+    inherit (ocaml.meta) platforms;
+    description = "Auto-generated low-level OCaml bindings for EverCrypt/HACL*";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/default.nix
new file mode 100644
index 000000000000..79b1a30d61fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchurl
+, domain-name, duration, fmt, ipaddr, logs
+}:
+
+buildDunePackage rec {
+  pname = "happy-eyeballs";
+  version = "0.5.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/roburio/happy-eyeballs/releases/download/v${version}/happy-eyeballs-${version}.tbz";
+    hash = "sha256-T4BOFlSj3xfUFhP9v8UaCHgmhvGrMyeqNUQf79bdBh4=";
+  };
+
+  propagatedBuildInputs = [
+    domain-name
+    duration
+    fmt
+    ipaddr
+    logs
+  ];
+
+  meta = {
+    description = "Connecting to a remote host via IP version 4 or 6";
+    homepage = "https://github.com/roburio/happy-eyeballs";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ vbgl ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/lwt.nix
new file mode 100644
index 000000000000..6d2ef3b80571
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/lwt.nix
@@ -0,0 +1,44 @@
+{ buildDunePackage
+, happy-eyeballs
+, cmdliner
+, dns-client-lwt
+, duration
+, domain-name
+, ipaddr
+, fmt
+, logs
+, lwt
+, mtime
+}:
+
+buildDunePackage {
+  pname = "happy-eyeballs-lwt";
+
+  inherit (happy-eyeballs) src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  buildInputs = [
+    cmdliner
+    duration
+    domain-name
+    ipaddr
+    fmt
+    mtime
+  ];
+
+  propagatedBuildInputs = [
+    dns-client-lwt
+    happy-eyeballs
+    logs
+    lwt
+  ];
+
+  doCheck = true;
+
+  meta = happy-eyeballs.meta // {
+    mainProgram = "happy_eyeballs_client";
+    description = "Connecting to a remote host via IP version 4 or 6 using Lwt_unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/mirage.nix
new file mode 100644
index 000000000000..bc3341a422f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/happy-eyeballs/mirage.nix
@@ -0,0 +1,47 @@
+{ buildDunePackage
+, happy-eyeballs
+, duration
+, dns-client-mirage
+, domain-name
+, ipaddr
+, fmt
+, logs
+, lwt
+, mirage-clock
+, mirage-random
+, mirage-time
+, tcpip
+}:
+
+buildDunePackage {
+  pname = "happy-eyeballs-mirage";
+
+  inherit (happy-eyeballs) src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  buildInputs = [
+    duration
+    ipaddr
+    domain-name
+    fmt
+    mirage-clock
+    mirage-random
+    mirage-time
+  ];
+
+  propagatedBuildInputs = [
+    dns-client-mirage
+    happy-eyeballs
+    logs
+    lwt
+    tcpip
+  ];
+
+  doCheck = true;
+
+  meta = happy-eyeballs.meta // {
+    description = "Connecting to a remote host via IP version 4 or 6 using Mirage";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hashcons/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hashcons/default.nix
new file mode 100644
index 000000000000..2bfaced11551
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hashcons/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "hashcons";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner  = "backtracking";
+    repo   = "ocaml-${pname}";
+    rev    = "d733325eeb55878bed285120c2c088daf78f0e2b";
+    sha256 = "0h4pvwj34pndaw3pajkhl710ywwinhc9pqimgllfmkl37wz2d8zq";
+  };
+
+  useDune2 = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "OCaml hash-consing library";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hex/default.nix
new file mode 100644
index 000000000000..42c1b5d5c13b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hex/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage, cstruct }:
+
+buildDunePackage rec {
+  pname = "hex";
+  version = "1.5.0";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/hex-${version}.tbz";
+    hash = "sha256-LmfuyhsDBJMHowgxtc1pS8stPn8qa0+1l/vbZHNRtNw=";
+  };
+
+  propagatedBuildInputs = [ cstruct ];
+  doCheck = true;
+
+  meta = {
+    description = "Mininal OCaml library providing hexadecimal converters";
+    homepage = "https://github.com/mirage/ocaml-hex";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix
new file mode 100644
index 000000000000..b47c153a4974
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix
@@ -0,0 +1,33 @@
+{ pkgs, lib, fetchFromGitHub, buildDunePackage, pkg-config, dune-configurator
+, bigstring,
+}:
+
+buildDunePackage rec {
+  pname = "hidapi";
+  version = "1.1.2";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "vbmithr";
+    repo = "ocaml-hidapi";
+    rev = version;
+    hash = "sha256-SNQ1/i5wJJgcslIUBe+z5QgHns/waHnILyMUJ46cUwg=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ pkgs.hidapi dune-configurator ];
+  propagatedBuildInputs = [ bigstring ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Bindings to Signal11's hidapi library";
+    homepage = "https://github.com/vbmithr/ocaml-hidapi";
+    license = licenses.isc;
+    maintainers = [ maintainers.alexfmpe ];
+    mainProgram = "ocaml-hid-enumerate";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix
new file mode 100644
index 000000000000..fba8e35fb5be
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitLab, sedlex, xtmpl }:
+
+buildDunePackage rec {
+  pname = "higlo";
+  version = "0.9";
+
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "higlo";
+    rev = version;
+    hash = "sha256-SaFFzp4FCjVLdMLH6mNIv3HzJbkXJ5Ojbku258LCfLI=";
+  };
+
+  propagatedBuildInputs = [ sedlex xtmpl ];
+
+  meta = with lib; {
+    description = "OCaml library for syntax highlighting";
+    inherit (src.meta) homepage;
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ regnat ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix
new file mode 100644
index 000000000000..3df9ad5307c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, cstruct, mirage-crypto, alcotest }:
+
+buildDunePackage rec {
+  pname = "hkdf";
+  version = "1.0.4";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    hash = "sha256-uSbW2krEWquZlzXdK7/R91ETFnENeRr6NhAGtv42/Vs=";
+  };
+
+  propagatedBuildInputs = [ cstruct mirage-crypto ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "HMAC-based Extract-and-Expand Key Derivation Function (RFC 5869)";
+    homepage = "https://github.com/hannesm/ocaml-hkdf";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix
new file mode 100644
index 000000000000..d0ae47031b23
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, lib
+, fetchurl
+, findlib
+, ocaml
+, ocamlbuild
+, topkg
+}:
+
+let
+  minimumSupportedOcamlVersion = "4.02.0";
+in
+assert lib.versionOlder minimumSupportedOcamlVersion ocaml.version;
+
+stdenv.mkDerivation rec {
+  pname = "hmap";
+  version = "0.8.1";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://erratique.ch/software/hmap/releases/${pname}-${version}.tbz";
+    sha256 = "10xyjy4ab87z7jnghy0wnla9wrmazgyhdwhr4hdmxxdn28dxn03a";
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) installPhase;
+
+  buildPhase = "${topkg.run} build --tests true";
+
+  doCheck = true;
+
+  checkPhase = "${topkg.run} test";
+
+  meta = {
+    description = "Heterogeneous value maps for OCaml";
+    homepage = "https://erratique.ch/software/hmap";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.pmahoney ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix
new file mode 100644
index 000000000000..eb42f5158589
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix
@@ -0,0 +1,36 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, angstrom
+, faraday
+}:
+
+buildDunePackage rec {
+  pname = "hpack";
+  version = "0.11.0";
+
+  src = fetchurl {
+    url = "https://github.com/anmonteiro/ocaml-h2/releases/download/${version}/h2-${version}.tbz";
+    hash = "sha256-GdXwazlgDurjzy7ekLpuMkCii8W+F/jl/IBv/WTHgFM=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    angstrom
+    faraday
+  ];
+
+  # circular dependency
+  doCheck = false;
+
+  meta = {
+    license = lib.licenses.bsd3;
+    description = "HPACK (Header Compression for HTTP/2) implementation in OCaml";
+    homepage = "https://github.com/anmonteiro/ocaml-h2";
+    maintainers = with lib.maintainers; [
+      sternenseemann
+      anmonteiro
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/http-mirage-client/default.nix b/nixpkgs/pkgs/development/ocaml-modules/http-mirage-client/default.nix
new file mode 100644
index 000000000000..f6c9a59193e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/http-mirage-client/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, h2
+, httpaf
+, mimic-happy-eyeballs
+, mirage-clock
+, paf
+, tcpip
+, x509
+, alcotest-lwt
+, mirage-clock-unix
+, mirage-crypto-rng
+, mirage-time-unix
+}:
+
+buildDunePackage rec {
+  pname = "http-mirage-client";
+  version = "0.0.5";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/roburio/http-mirage-client/releases/download/v${version}/http-mirage-client-${version}.tbz";
+    hash = "sha256-w/dMv5QvgglTFj9V4wRoDqK+36YeE0xWLxcAVS0oHz0=";
+  };
+
+  propagatedBuildInputs = [
+    h2
+    httpaf
+    mimic-happy-eyeballs
+    mirage-clock
+    paf
+    tcpip
+    x509
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest-lwt
+    mirage-clock-unix
+    mirage-crypto-rng
+    mirage-time-unix
+  ];
+
+  meta = {
+    description = "HTTP client for MirageOS";
+    homepage = "https://github.com/roburio/http-mirage-client";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix
new file mode 100644
index 000000000000..c4a3dd8e3172
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, angstrom, faraday, result, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "httpaf";
+  version = "0.7.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    sha256 = "0zk78af3qyvf6w66mg8sxygr6ndayzqw5s3zfxibvn121xwni26z";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ angstrom faraday result ];
+  doCheck = true;
+
+  meta = {
+    description = "High-performance, memory-efficient, and scalable web server for OCaml";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/httpaf/lwt-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/httpaf/lwt-unix.nix
new file mode 100644
index 000000000000..9b78d7bf6401
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/httpaf/lwt-unix.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage
+, httpaf
+, faraday-lwt-unix
+, lwt
+}:
+
+buildDunePackage {
+  pname = "httpaf-lwt-unix";
+  inherit (httpaf) version src;
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    faraday-lwt-unix
+    httpaf
+    lwt
+  ];
+
+  meta = httpaf.meta // {
+    description = "Lwt support for http/af";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix
new file mode 100644
index 000000000000..54ce87de99ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchurl
+, dune-configurator, cmdliner
+, lwt, withLwt ? true
+}:
+
+buildDunePackage rec {
+  pname = "hxd";
+  version = "0.3.2";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/hxd/releases/download/v${version}/hxd-${version}.tbz";
+    sha256 = "a00290abb8538e79b32ddc22ed9b301b9806bc4c03eb1e5105b14af47dabec9f";
+  };
+
+  propagatedBuildInputs = lib.optional withLwt lwt;
+
+  buildInputs = [
+    cmdliner
+    dune-configurator
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Hexdump in OCaml";
+    homepage = "https://github.com/dinosaure/hxd";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+    mainProgram = "hxd.xxd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix
new file mode 100644
index 000000000000..10509f1e7500
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, ocaml
+, decompress
+, stdlib-shims
+, alcotest
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+  version = "20221222";
+  pname = "imagelib";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/rlepigre/ocaml-imagelib/releases/download/${version}/imagelib-${version}.tbz";
+    hash = "sha256-BQ2TVxGlpc6temteK84TKXpx0MtHZSykL/TjKN9xGP0=";
+  };
+
+  propagatedBuildInputs = [ decompress stdlib-shims ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Image formats such as PNG and PPM in OCaml";
+    homepage = "https://github.com/rlepigre/ocaml-imagelib";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "imagetool";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/index/default.nix b/nixpkgs/pkgs/development/ocaml-modules/index/default.nix
new file mode 100644
index 000000000000..edcb41619409
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/index/default.nix
@@ -0,0 +1,47 @@
+{ lib, fetchurl, buildDunePackage
+, repr, ppx_repr, fmt, logs, mtime, stdlib-shims
+, cmdliner, progress, semaphore-compat, optint
+, alcotest, crowbar, re, lru
+}:
+
+buildDunePackage rec {
+  pname = "index";
+  version = "1.6.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/index/releases/download/${version}/index-${version}.tbz";
+    hash = "sha256-k4iDUJik7UTuztBw7YaFXASd8SqYMR1JgLm3JOyriGA=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [
+    stdlib-shims
+  ];
+  propagatedBuildInputs = [
+    cmdliner
+    fmt
+    logs
+    mtime
+    ppx_repr
+    progress
+    repr
+    semaphore-compat
+    optint
+    lru
+  ];
+
+  checkInputs = [
+    alcotest
+    crowbar
+    re
+  ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Platform-agnostic multi-level index";
+    homepage = "https://github.com/mirage/index";
+    license = licenses.mit;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix b/nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix
new file mode 100644
index 000000000000..a78e314b7665
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocaml_pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-inifiles";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "mirror://ubuntu/pool/universe/o/ocaml-inifiles/ocaml-inifiles_${version}.orig.tar.gz";
+    sha256 = "0jhzgiypmh6hwsv1zpiq77fi0cvcmwbiy5x0yg7mz6p3dh1dmkns";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ocaml-inifiles/ocaml-inifiles.1.2/files/ocaml-inifiles.diff";
+      sha256 = "037kk3172s187w8vwsykdxlpklxzc7m7np57sapk499d8adzdgwn";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace inifiles.ml --replace 'String.lowercase ' 'String.lowercase_ascii '
+  '';
+
+  nativeBuildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ ocaml_pcre ];
+
+  strictDeps = true;
+
+  buildFlags = [ "all" "opt" ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "Small OCaml library to read and write .ini files";
+    license = lib.licenses.lgpl21Plus;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix b/nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix
new file mode 100644
index 000000000000..c0ba327dd2fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, lwt # optional lwt support
+, ounit2, fileutils # only for tests
+}:
+
+buildDunePackage rec {
+  version = "2.5";
+  pname = "inotify";
+
+  src = fetchFromGitHub {
+    owner = "whitequark";
+    repo = "ocaml-inotify";
+    rev = "v${version}";
+    hash = "sha256-3Ju6l6aF5eJgIZJKO0lQGXjjGDzCdX2fuwyNSAjIyAs=";
+  };
+
+  buildInputs = [ lwt ];
+
+  checkInputs = [ ounit2 fileutils ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Bindings for Linux’s filesystem monitoring interface, inotify";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/integers/default.nix b/nixpkgs/pkgs/development/ocaml-modules/integers/default.nix
new file mode 100644
index 000000000000..343aeb216ba8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/integers/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "integers";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "ocamllabs";
+    repo = "ocaml-integers";
+    rev = version;
+    sha256 = "sha256-zuUgP1jOiVT0q6GisGpkqx7nybWbARgnAcU8NYqvCzA=";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  meta = {
+    description = "Various signed and unsigned integer types for OCaml";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/ocamllabs/ocaml-integers";
+    changelog = "https://github.com/ocamllabs/ocaml-integers/raw/${version}/CHANGES.md";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/integers_stubs_js/default.nix b/nixpkgs/pkgs/development/ocaml-modules/integers_stubs_js/default.nix
new file mode 100644
index 000000000000..236c44bcaa75
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/integers_stubs_js/default.nix
@@ -0,0 +1,29 @@
+{
+  lib, fetchFromGitHub, buildDunePackage
+, zarith_stubs_js ? null
+}:
+
+buildDunePackage rec {
+  pname = "integers_stubs_js";
+  version = "1.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "o1-labs";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-lg5cX9/LQlVmR42XcI17b6KaatnFO2L9A9ZXfID8mTY=";
+  };
+
+  propagatedBuildInputs = [ zarith_stubs_js ];
+  doCheck = true;
+
+  meta = {
+    description = "Javascript stubs for the integers library in js_of_ocaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bezmuth ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix b/nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix
new file mode 100644
index 000000000000..79142f0e8d4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, pkg-config, cstruct, bigarray-compat, ounit }:
+
+buildDunePackage rec {
+  pname = "io-page";
+  version = "3.0.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-DjbKdNkFa6YQgJDLmLsuvyrweb4/TNvqAiggcj/3hu4=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ cstruct bigarray-compat ];
+  checkInputs = [ ounit ];
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/mirage/io-page";
+    license = lib.licenses.isc;
+    description = "IO memory page library for Mirage backends";
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/iomux/default.nix b/nixpkgs/pkgs/development/ocaml-modules/iomux/default.nix
new file mode 100644
index 000000000000..f1dc827a32d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iomux/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, dune-configurator
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "iomux";
+  version = "0.3";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/haesbaert/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    sha256 = "zNJ3vVOv0BEpHLiC8Y610F87uiMlfYNo28ej0H+EU+c=";
+  };
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  checkInputs = [
+    alcotest
+  ];
+
+  meta = {
+    homepage = "https://github.com/haesbaert/ocaml-${pname}";
+    description = "IO Multiplexers for OCaml";
+    license = with lib.licenses; [ isc ];
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix
new file mode 100644
index 000000000000..cbad2d73e545
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage
+, ipaddr, cstruct
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr-cstruct";
+
+  inherit (ipaddr) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ ipaddr cstruct ];
+
+  doCheck = true;
+
+  meta = ipaddr.meta // {
+    description = "Library for manipulation of IP address representations using Cstructs";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix
new file mode 100644
index 000000000000..d579c22de134
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage
+, macaddr, domain-name, stdlib-shims
+, ounit2, ppx_sexp_conv
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr";
+
+  inherit (macaddr) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ macaddr domain-name stdlib-shims ];
+
+  checkInputs = [ ppx_sexp_conv ounit2 ];
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "Library for manipulation of IP (and MAC) address representations ";
+    maintainers = with lib.maintainers; [ alexfmpe ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix
new file mode 100644
index 000000000000..9484f8203cec
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage
+, ipaddr, ipaddr-cstruct, ounit2, ppx_sexp_conv
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr-sexp";
+
+  inherit (ipaddr) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ ipaddr ];
+
+  checkInputs = [ ipaddr-cstruct ounit2 ppx_sexp_conv ];
+  doCheck = true;
+
+  meta = ipaddr.meta // {
+    description = "Library for manipulation of IP address representations usnig sexp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/iri/default.nix b/nixpkgs/pkgs/development/ocaml-modules/iri/default.nix
new file mode 100644
index 000000000000..54db34bc9740
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iri/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitLab
+, sedlex, uunf, uutf
+}:
+
+buildDunePackage rec {
+  pname = "iri";
+  version = "1.0.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "ocaml-iri";
+    rev = version;
+    hash = "sha256-6Q7qPezmdcO6JSevWl55XAxFuIROZNDrMkYw8VRR7qg=";
+  };
+
+  propagatedBuildInputs = [ sedlex uunf uutf ];
+
+  meta = {
+    description = "IRI (RFC3987) native OCaml implementation";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin-watcher/default.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin-watcher/default.nix
new file mode 100644
index 000000000000..7304528b7dc5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin-watcher/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage
+, astring, fmt, logs, ocaml_lwt
+}:
+
+buildDunePackage rec {
+  pname = "irmin-watcher";
+  version = "0.5.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/irmin-watcher/releases/download/${version}/irmin-watcher-${version}.tbz";
+    sha256 = "sha256-vq4kwaz4QUG9x0fGEbQMAuDGjlT3/6lm8xiXTUqJmZM=";
+  };
+
+  propagatedBuildInputs = [ astring fmt logs ocaml_lwt ];
+
+  meta = {
+    homepage = "https://github.com/mirage/irmin-watcher";
+    description = "Portable Irmin watch backends using FSevents or Inotify";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/chunk.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/chunk.nix
new file mode 100644
index 000000000000..3e7f3c2a1b70
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/chunk.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, irmin, irmin-test, fmt, logs, lwt, alcotest }:
+
+buildDunePackage rec {
+
+  pname = "irmin-chunk";
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [ irmin fmt logs lwt ];
+
+  doCheck = true;
+  checkInputs = [ alcotest irmin-test ];
+
+  meta = irmin.meta // {
+    description = "Irmin backend which allow to store values into chunks";
+  };
+
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/containers.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/containers.nix
new file mode 100644
index 000000000000..32677d9604c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/containers.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage
+, irmin, irmin-fs, ppx_irmin, lwt, mtime
+, alcotest, alcotest-lwt, cacert
+}:
+
+buildDunePackage {
+  pname = "irmin-containers";
+
+  inherit (ppx_irmin) src version;
+
+  nativeBuildInputs = [
+    ppx_irmin
+  ];
+
+  propagatedBuildInputs = [
+    irmin
+    irmin-fs
+    ppx_irmin
+    lwt
+    mtime
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    cacert
+  ];
+
+  meta = ppx_irmin.meta // {
+    description = "Mergeable Irmin data structures";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix
new file mode 100644
index 000000000000..fdd18aa5abe5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix
@@ -0,0 +1,43 @@
+{ lib, buildDunePackage
+, astring, digestif, fmt, jsonm, logs, ocaml_lwt, ocamlgraph, uri
+, repr, ppx_irmin, bheap, uutf, mtime, lwt, optint
+, vector, hex, alcotest, qcheck-alcotest
+}:
+
+buildDunePackage {
+  pname = "irmin";
+
+  inherit (ppx_irmin) src version;
+
+  minimalOCamlVersion = "4.10";
+
+  propagatedBuildInputs = [
+    astring
+    bheap
+    digestif
+    fmt
+    jsonm
+    logs
+    lwt
+    mtime
+    ocamlgraph
+    optint
+    ppx_irmin
+    repr
+    uri
+    uutf
+  ];
+
+  checkInputs = [
+    vector
+    hex
+    alcotest
+    qcheck-alcotest
+  ];
+
+  doCheck = true;
+
+  meta = ppx_irmin.meta // {
+    description = "Distributed database built on the same principles as Git";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix
new file mode 100644
index 000000000000..8d56e90fad8b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, irmin, astring, logs, lwt
+, alcotest, irmin-test, irmin-watcher
+}:
+
+buildDunePackage rec {
+
+  pname = "irmin-fs";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [ irmin astring logs lwt ];
+
+  checkInputs = [ alcotest irmin-test irmin-watcher ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Generic file-system backend for Irmin";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix
new file mode 100644
index 000000000000..1e4397e89298
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix
@@ -0,0 +1,41 @@
+{ lib, buildDunePackage
+, git, irmin, ppx_irmin, git-unix, irmin-watcher
+, digestif, cstruct, fmt, astring, fpath, logs, lwt, uri
+, cohttp-lwt-unix, mimic
+, irmin-test, mtime, alcotest, cacert
+}:
+
+buildDunePackage {
+
+  pname = "irmin-git";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [
+    git
+    irmin
+    ppx_irmin
+    digestif
+    cstruct
+    fmt
+    astring
+    fpath
+    logs
+    lwt
+    uri
+    irmin-watcher
+    git-unix
+    mimic
+    cohttp-lwt-unix
+  ];
+
+  checkInputs = [ mtime alcotest irmin-test cacert ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Git backend for Irmin";
+  };
+
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix
new file mode 100644
index 000000000000..1b5ecb51396f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, cohttp-lwt, cohttp-lwt-unix, graphql-cohttp, graphql-lwt, irmin, git-unix
+, alcotest, alcotest-lwt, logs, yojson, cacert
+}:
+
+buildDunePackage rec {
+
+  pname = "irmin-graphql";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [ cohttp-lwt cohttp-lwt-unix graphql-cohttp graphql-lwt irmin git-unix ];
+
+  doCheck = true;
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    logs
+    yojson
+    cacert
+  ];
+
+  meta = irmin.meta // {
+    description = "GraphQL server for Irmin";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-git.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-git.nix
new file mode 100644
index 000000000000..7528e469913f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-git.nix
@@ -0,0 +1,27 @@
+{ buildDunePackage, irmin-mirage, irmin-git
+, mirage-kv, cohttp, conduit-lwt, conduit-mirage
+, git-paf, fmt, git, lwt, mirage-clock, uri
+}:
+
+buildDunePackage {
+  pname = "irmin-mirage-git";
+
+  inherit (irmin-mirage) version src;
+
+  propagatedBuildInputs = [
+    irmin-mirage
+    irmin-git
+    mirage-kv
+    cohttp
+    conduit-lwt
+    conduit-mirage
+    git-paf
+    fmt
+    git
+    lwt
+    mirage-clock
+    uri
+  ];
+
+  inherit (irmin-mirage) meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix
new file mode 100644
index 000000000000..1973cde8c3b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, irmin-mirage, irmin-graphql
+, mirage-clock, cohttp-lwt, lwt, uri, git
+}:
+
+buildDunePackage {
+  pname = "irmin-mirage-graphql";
+
+  inherit (irmin-mirage) version src;
+
+  propagatedBuildInputs = [
+    irmin-mirage
+    irmin-graphql
+    mirage-clock
+    cohttp-lwt
+    lwt
+    uri
+    git
+  ];
+
+  inherit (irmin-mirage) meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage.nix
new file mode 100644
index 000000000000..eabb1e5874e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/mirage.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, irmin, fmt, ptime, mirage-clock }:
+
+buildDunePackage {
+  pname = "irmin-mirage";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [
+    irmin fmt ptime mirage-clock
+  ];
+
+  meta = irmin.meta // {
+    description = "MirageOS-compatible Irmin stores";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/pack.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/pack.nix
new file mode 100644
index 000000000000..3a00c5e99f5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/pack.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage
+, index, ppx_irmin, irmin, optint, fmt, logs, lwt, mtime, cmdliner, checkseum, rusage
+, alcotest, alcotest-lwt, astring, irmin-test
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.12";
+
+  pname = "irmin-pack";
+
+  inherit (irmin) version src;
+
+  nativeBuildInputs = [ ppx_irmin ];
+
+  propagatedBuildInputs = [ index irmin optint fmt logs lwt mtime cmdliner checkseum rusage ];
+
+  checkInputs = [ astring alcotest alcotest-lwt irmin-test ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Irmin backend which stores values in a pack file";
+    mainProgram = "irmin_fsck";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix
new file mode 100644
index 000000000000..23165099443e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, ppxlib, ppx_repr, logs }:
+
+buildDunePackage rec {
+  pname = "ppx_irmin";
+  version = "3.9.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/irmin/releases/download/${version}/irmin-${version}.tbz";
+    hash = "sha256-jgc6vhtf+1ttWMMmBsnX2rwyxTUBdWvoCpLtR3etUaA=";
+  };
+
+  minimalOCamlVersion = "4.10";
+
+  propagatedBuildInputs = [
+    ppx_repr
+    ppxlib
+    logs
+  ];
+
+  meta = {
+    homepage = "https://irmin.org/";
+    description = "PPX deriver for Irmin generics";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ vbgl sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix
new file mode 100644
index 000000000000..a0e206cade72
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix
@@ -0,0 +1,37 @@
+{ buildDunePackage, irmin, ppx_irmin, mtime, astring, fmt, jsonm, logs, lwt
+, metrics-unix, ocaml-syntax-shims, cmdliner, metrics, alcotest-lwt
+, hex, vector, qcheck-alcotest
+}:
+
+buildDunePackage {
+
+  pname = "irmin-test";
+
+  inherit (irmin) version src;
+
+  nativeBuildInputs = [ ppx_irmin ];
+
+  propagatedBuildInputs = [
+    irmin
+    ppx_irmin
+    alcotest-lwt
+    mtime
+    astring
+    fmt
+    jsonm
+    logs
+    lwt
+    metrics-unix
+    ocaml-syntax-shims
+    cmdliner
+    metrics
+  ];
+
+  doCheck = true;
+  checkInputs = [ hex qcheck-alcotest vector ];
+
+  meta = irmin.meta // {
+    description = "Irmin test suite";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/tezos.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/tezos.nix
new file mode 100644
index 000000000000..ec005921c938
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/tezos.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage
+, irmin, irmin-pack, ppx_irmin, digestif, cmdliner, fmt, yojson, tezos-base58
+, alcotest, hex, irmin-test, fpath
+}:
+
+buildDunePackage rec {
+  pname = "irmin-tezos";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [
+    irmin
+    irmin-pack
+    ppx_irmin
+    digestif
+    fmt
+    tezos-base58
+  ];
+
+  buildInputs = [
+    cmdliner
+    yojson
+  ];
+
+  checkInputs = [ alcotest hex irmin-test fpath ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Irmin implementation of the Tezos context hash specification";
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix b/nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix
new file mode 100644
index 000000000000..5c6d4104b6a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-iso8601";
+  version = "0.2.5";
+
+  src = fetchFromGitHub {
+    owner = "sagotch";
+    repo = "ISO8601.ml";
+    rev = version;
+    sha256 = "sha256-QWjZ+2AjvXnnRVenbyCG/hSjfW53bHiftQUtWpK/7I8=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://ocaml-community.github.io/ISO8601.ml/";
+    description = "ISO 8601 and RFC 3999 date parsing for OCaml";
+    license = lib.licenses.mit;
+    platforms = ocaml.meta.platforms or [ ];
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/iter/default.nix b/nixpkgs/pkgs/development/ocaml-modules/iter/default.nix
new file mode 100644
index 000000000000..109e51ee6f91
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iter/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage
+, mdx, ounit2, qcheck-core
+}:
+
+buildDunePackage rec {
+  pname = "iter";
+  version = "1.8";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/c-cube/iter/releases/download/v${version}/iter-${version}.tbz";
+    hash = "sha256-+HOcoFrpxLqKogwNQZfnRAnytlmhfxJzDUKvH9n0MCM=";
+  };
+
+  doCheck = true;
+  nativeCheckInputs = [ mdx.bin ];
+  checkInputs = [ ounit2 qcheck-core ];
+
+  meta = {
+    homepage = "https://github.com/c-cube/sequence";
+    description = "Simple sequence (iterator) datatype and combinators";
+    longDescription = ''
+      Simple sequence datatype, intended to transfer a finite number of
+      elements from one data structure to another. Some transformations on sequences,
+      like `filter`, `map`, `take`, `drop` and `append` can be performed before the
+      sequence is iterated/folded on.
+    '';
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix
new file mode 100644
index 000000000000..a3b2ac581555
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix
@@ -0,0 +1,465 @@
+{ self
+, openssl
+}:
+
+with self;
+
+{
+
+  ocaml-compiler-libs = janePackage {
+    pname = "ocaml-compiler-libs";
+    hash = "0g9y1ljjsj1nw0lz460ivb6qmz9vhcmfl8krlmqfrni6pc7b0r6f";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  sexplib0 = janePackage {
+    pname = "sexplib0";
+    hash = "13xdd0pvypxqn0ldwdgikmlinrp3yfh8ixknv1xrpxbx3np4qp0g";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+  };
+
+  base = janePackage {
+    pname = "base";
+    version = "0.12.2";
+    hash = "0gl89zpgsf3n30nb6v5cns27g2bfg4rf3s2427gqvwbkr5gcf7ri";
+    meta.description = "Full standard library replacement for OCaml";
+    propagatedBuildInputs = [ sexplib0 ];
+    buildInputs = [ dune-configurator ];
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    hash = "1pn8jjcb79n6crpw7dkp68s4lz2mw103lwmfslil66f05jsxhjhg";
+    meta.description = "Standard IO library for OCaml";
+    propagatedBuildInputs = [ base ];
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    hash = "0idzp1kzds0gnilschzs9ydi54if8y5xpn6ajn710vkipq26qcld";
+    meta.description = "[@@deriving] plugin to generate S-expression conversion functions";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "07qbchwif1i9ii8z7v1bib57d3mjv0b27i8iixw78i83wnsycmdx";
+    meta.description = "Expands [%here] into its location";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "0n1ax4k2smhps9hc2v58lc06a0fgimwvbi1aj4x78vwh5j492bys";
+    meta.description = "Generation of comparison functions from types";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "0as6mzr6ki2a9d4k6132p9dskn0qssla1s7j5rkzp75bfikd0ip8";
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+    propagatedBuildInputs = [ ppx_compare ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    hash = "0nyz411zim94pzbxm2l2v2l9jishcxwvxhh142792g2s18r4vn50";
+    meta.description = "Syntax extension for writing in-line tests in ocaml code";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    version = "0.12.1";
+    hash = "0q7591agvd3qy9ihhbyk4db48r0ng7yxspfj8afxxiawl7k5bas6";
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+  };
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "0dlgr7cimqmjlcymk3bdcyzqzvdy12q5lqa844nqix0k2ymhyphf";
+    meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values";
+    propagatedBuildInputs = [ base ];
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    hash = "0flrdyxdfcqcmdrbipxdjq0s3djdgs7z5pvjdycsvs6czbixz70v";
+    meta.description = "Generation of accessor and iteration functions for ocaml records";
+    propagatedBuildInputs = [ fieldslib ppxlib ];
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "1cclb5magk63gyqmkci8abhs05g2pyhyr60a2c1bvmig0faqcnsf";
+    meta.description = "Part of Jane Street's Core library";
+    propagatedBuildInputs = [ base ];
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    hash = "05j9bgra8xq6fcp12ch3z9vjrk139p2wrcjjcs4h52n5hhc8vzbz";
+    meta.description = "Generation of accessor and iteration functions for ocaml variant types";
+    propagatedBuildInputs = [ variantslib ppxlib ];
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    hash = "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q";
+    meta.description = "Cram like framework for OCaml";
+    propagatedBuildInputs = [ ppx_assert ppx_custom_printf ppx_fields_conv ppx_inline_test ppx_variants_conv re ];
+  };
+
+  ppx_enumerate = janePackage {
+    pname = "ppx_enumerate";
+    hash = "08zfpq6bdm5lh7xj9k72iz9f2ihv3aznl3nypw3x78vz1chj8dqa";
+    meta.description = "Generate a list containing all values of a finite type";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "1dfsfvhiyp1mnf24mr93svpdn432kla0y7x631lssacxxp2sadbg";
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    hash = "1lz931m3qdv3yzqy6dnb8fq1d99r61w0n7cwf3b9fl9rhk0pggwh";
+    meta.description = "Code style checker for Jane Street Packages";
+    propagatedBuildInputs = [ octavius ppxlib ];
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "0vd96rp2l084iamkwmvizzhl9625cagjb6gzzbir06czii5mlq2p";
+    meta.description = "Base set of ppx rewriters";
+    propagatedBuildInputs = [ ppx_enumerate ppx_hash ppx_js_style ];
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    hash = "1ib81irawxzq091bmpi50z0kmpx6z2drg14k2xcgmwbb1d4063xn";
+    meta.description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    propagatedBuildInputs = [ ppx_inline_test ];
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    hash = "0yskd6v48jc6wa0nhg685kylh1n9qb6b7d1wglr9wnhl9sw990mc";
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  splittable_random = janePackage {
+    pname = "splittable_random";
+    hash = "1wpyz7807cgj8b50gdx4rw6f1zsznp4ni5lzjbnqdwa66na6ynr4";
+    meta.description = "PRNG that can be split into independent streams";
+    propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ];
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "146dmyzkbmafa3giz69gpxccvdihg19cvk4xsg8krbbmlkvdda22";
+    meta.description = "Monadic let-bindings";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  base_quickcheck = janePackage {
+    version = "0.12.1";
+    pname = "base_quickcheck";
+    hash = "sha256-ABfUtOzdtGrYR6EgtVYkmxRvsH48jJwSVVOwf4Od12Y=";
+    meta.description = "Randomized testing framework, designed for compatibility with Base";
+    propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let splittable_random ];
+  };
+
+  ppx_stable = janePackage {
+    pname = "ppx_stable";
+    hash = "15zvf66wlkvz0yd4bkvndkpq74dj20jv1qkljp9n52hh7d0f9ykh";
+    meta.description = "Stable types conversions generator";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    hash = "0hh6s7g9s004z35hsr8z6nw5phlcvcd6g2q3bj4f0s1s0anlsswm";
+    meta.description = "A binary protocol generator";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ];
+  };
+
+  ppx_bin_prot = janePackage {
+    pname = "ppx_bin_prot";
+    version = "0.12.1";
+    hash = "1j0kjgmv58dmg3x5dj5zrfbm920rwq21lvkkaqq493y76cd0x8xg";
+    meta.description = "Generation of bin_prot readers and writers from types";
+    propagatedBuildInputs = [ bin_prot ppx_here ];
+  };
+
+  ppx_fail = janePackage {
+    pname = "ppx_fail";
+    hash = "0krsv6z9gi0ifxmw5ss6gwn108qhywyhbs41an10x9d5zpgf4l1n";
+    meta.description = "Add location to calls to failwiths";
+    propagatedBuildInputs = [ ppx_here ];
+  };
+
+  jst-config = janePackage {
+    pname = "jst-config";
+    hash = "0yxcz13vda1mdh9ah7qqxwfxpcqang5sgdssd8721rszbwqqaw93";
+    meta.description = "Compile-time configuration for Jane Street libraries";
+    buildInputs = [ dune-configurator ppx_assert ];
+  };
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    hash = "0bdbx01kz0174g1szdhv3mcfqxqqf2frxq7hk13xaf6fsz04kwmj";
+    meta.description = "Optional compilation for OCaml";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "0qa4llf812rjqa8nb63snmy8d8ny91p3anwhb50afb7vjaby8m34";
+    meta.description = "Jane Street C header files";
+  };
+
+  time_now = janePackage {
+    pname = "time_now";
+    hash = "169mgsb3rja4j1j9nj5xa7bbkd21p9kfpskqz0wjf9x2fpxqsniq";
+    meta.description = "Reports the current time";
+    buildInputs = [ jst-config ppx_optcomp ];
+    propagatedBuildInputs = [ jane-street-headers base ppx_base ];
+  };
+
+  ppx_module_timer = janePackage {
+    pname = "ppx_module_timer";
+    hash = "0yziakm7f4c894na76k1z4bp7azy82xc33mh36fj761w1j9zy3wm";
+    meta.description = "Ppx rewriter that records top-level module startup times";
+    propagatedBuildInputs = [ time_now ];
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "07i0iipbd5xw2bc604qkwlcxmhncfpm3xmrr6svyj2ij86pyssh8";
+    meta.description = "Pattern matching on flat options";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "1p4pdpl8h2bblbhpn5nk17ri4rxpz0aih0gffg3cl1186irkj0xj";
+    meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "1mg81834a6dx1x7x9zb9wc58438cabjjw08yhkx6i386hxfy891p";
+    meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "1psl6gsk06a62szh60y5sc1s92xpmrl1wpw3rhha09v884b7arbc";
+    meta.description = "Typerep is a library for runtime types";
+    propagatedBuildInputs = [ base ];
+  };
+
+  ppx_typerep_conv = janePackage {
+    pname = "ppx_typerep_conv";
+    hash = "09vik6qma1id44k8nz87y48l9wbjhqhap1ar1hpfdfkjai1hrzzq";
+    meta.description = "Generation of runtime types from type declarations";
+    propagatedBuildInputs = [ ppxlib typerep ];
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "1a2602isqzsh640q20qbmarx0sc316mlsqc3i25ysv2kdyhh0kyw";
+    meta.description = "Standard Jane Street ppx rewriters";
+    propagatedBuildInputs = [ base_quickcheck ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_sexp_value ppx_stable ppx_typerep_conv ];
+  };
+
+  base_bigstring = janePackage {
+    pname = "base_bigstring";
+    hash = "0rbgyg511847fbnxad40prz2dyp4da6sffzyzl88j18cxqxbh1by";
+    meta.description = "String type based on [Bigarray], for use in I/O and C-bindings";
+    propagatedBuildInputs = [ ppx_jane ];
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    hash = "1974i9s2c2n03iffxrm6ncwbd2gg6j6avz5jsxfd35scc2zxcd4l";
+    meta.description = "S-expression parsing library";
+    propagatedBuildInputs = [ base sexplib0 ];
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    hash = "0780klc5nnv0ij6aklzra517cfnfkjdlp8ylwjrqwr8dl9rvxza2";
+    meta.description = "Library for serializing OCaml values to and from S-expressions";
+    propagatedBuildInputs = [ num parsexp ];
+  };
+
+  core_kernel = janePackage {
+    pname = "core_kernel";
+    version = "0.12.3";
+    hash = "sha256-bDgxuOILAs4FYB8o92ysPHDdEzflZMsU/jk5hB9xfuc=";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base_bigstring sexplib ];
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    version = "0.13.0";
+    hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf";
+    meta.description = "Spawning sub-processes";
+    buildInputs = [ ppx_expect ];
+  };
+
+  core = janePackage {
+    pname = "core";
+    version = "0.12.3";
+    hash = "1vmjqiafkg45hqfvahx6jnlaww1q4a4215k8znbgprf0qn3zymnj";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ core_kernel spawn ];
+  };
+
+  async_kernel = janePackage {
+    pname = "async_kernel";
+    hash = "1d9illx7vvpblj1i2r9y0f2yff2fbhy3rp4hhvamq1n9n3lvxmh2";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  protocol_version_header = janePackage {
+    pname = "protocol_version_header";
+    hash = "14vqhx3r84rlfhcjq52gxdqksckiaswlck9s47g7y2z1lsc17v7r";
+    meta.description = "Protocol versioning";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "1znhqbzx4fp58i7dbcgyv5rx7difbhb5d8cbqzv96yqvbn67lsjk";
+    meta.description = "Platform-independent core of Async RPC library";
+    propagatedBuildInputs = [ async_kernel protocol_version_header ];
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "09h10rdyykbm88n6r9nb5a22mlb6vcxa04q6hvrcr0kys6qhhqmb";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel core ];
+  };
+
+  async_extra = janePackage {
+    pname = "async_extra";
+    hash = "10j4mwlyqvf67yrp5dwd857llqjinpnnykmlzw2gpmks9azxk6mh";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix ];
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "0302awqihf3abib9mvzvn4g8m364hm6jxry1r3kc01hzybhy9acq";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core ];
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "0pk7z3h2gi21nfchvmjz2wx516bynf9vgwf84zf5qhvlvqqsmyrx";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_extra textutils ];
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673";
+    meta.description = "Directory traversal with Async";
+    propagatedBuildInputs = [ async ];
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    version = "0.12.1";
+    hash = "sha256-NPQKKUSwckZx4GN4wX2sc0Mn7bes6p79oZrN6xouc6o=";
+    meta.description = "OCaml bindings for RE2, Google's regular expression library";
+    propagatedBuildInputs = [ core_kernel ];
+    prePatch = ''
+      substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++'
+      substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))'
+    '';
+  };
+
+  shell = janePackage {
+    pname = "shell";
+    hash = "158857rdr6qgglc5iksg0l54jgf51b5lmsw7nlazpxwdwc9fcn5n";
+    meta.description = "Yet another implementation of fork&exec and related functionality";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ re2 textutils ];
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "0cxln9hkc3cy522la9yi9p23qjwl69kqmadsq4lnjh5bxdad06sv";
+    meta.description = "Shell helpers for Async";
+    propagatedBuildInputs = [ async shell ];
+  };
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "00hyzbbj19dkcw0vhfnc8w0ca3zkjriwwvl00ssa0a2g9mygijdm";
+    meta.description = "Benchmarking library";
+    propagatedBuildInputs = [ textutils ];
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "1gwx66235irpf5krb1r25a3c7w52qhmass8hp7rdv89il9jn49w4";
+    meta.description = "Extra components that are not as closely vetted or as stable as Core";
+    propagatedBuildInputs = [ core ];
+  };
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    hash = "06hdsaszc5cd7fphiblbn4r1sh36xgjwf2igzr2rvlzqs7jiv2v4";
+    meta.description = "S-expression pretty-printer";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+  };
+
+  expect_test_helpers_kernel = janePackage {
+    pname = "expect_test_helpers_kernel";
+    hash = "18ya187y2i2hfxr771sd9vy5jdsa30vhs56yjdhwk06v01b2fzbq";
+    meta.description = "Helpers for writing expectation tests";
+    buildInputs = [ ppx_jane ];
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+  };
+
+  expect_test_helpers = janePackage {
+    pname = "expect_test_helpers";
+    hash = "0ixqck2lnsmz107yw0q2sr8va80skjpldx7lz4ymjiq2vsghk0rb";
+    meta.description = "Async helpers for writing expectation tests";
+    propagatedBuildInputs = [ async expect_test_helpers_kernel ];
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "055kd3piadjnplip8c8q99ssh79d4irmhg2wng7aida5pbqp2p9f";
+    meta.description = "Diff library using Bram Cohen's patience diff algorithm";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "0n9xi6agc3lgyj2nsi10cbif0xwn57xyaranad9r285rmbxrgjh7";
+    meta.description = "Library for writing Emacs plugin in OCaml";
+    propagatedBuildInputs = [ async expect_test_helpers_kernel ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix
new file mode 100644
index 000000000000..7d8bdc4dfb7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix
@@ -0,0 +1,898 @@
+{ self
+, fetchpatch
+, lib
+, openssl
+, zstd
+}:
+
+with self;
+
+{
+
+  accessor = janePackage {
+    pname = "accessor";
+    version = "0.14.1";
+    minimalOCamlVersion = "4.09";
+    hash = "0wm2081kzd5zsqs516cn3f975bnnmnyynv8fa818gmfa65i6mxm8";
+    meta.description = "A library that makes it nicer to work with nested functional data structures";
+    propagatedBuildInputs = [ higher_kinded ];
+  };
+
+  accessor_async = janePackage {
+    pname = "accessor_async";
+    version = "0.14.1";
+    minimalOCamlVersion = "4.09";
+    hash = "1193hzvlzm7vcl9p67fs8al2pvkw9n2wz009m2l3lp35mrx8aq1w";
+    meta.description = "Accessors for Async types, for use with the Accessor library";
+    propagatedBuildInputs = [ accessor_core async_kernel ];
+  };
+
+  accessor_base = janePackage {
+    pname = "accessor_base";
+    version = "0.14.1";
+    minimalOCamlVersion = "4.09";
+    hash = "1xjbvvijkyw4dlys47x4896y3kqm2zn0yg60cqrp57i2dwxg0nsj";
+    meta.description = "Accessors for Base types, for use with the Accessor library";
+    propagatedBuildInputs = [ ppx_accessor ];
+  };
+
+  accessor_core = janePackage {
+    minimalOCamlVersion = "4.09";
+    pname = "accessor_core";
+    version = "0.14.1";
+    hash = "1cdkv34m6czhacivpbb2sasj83fgcid6gnqk30ig9i84z8nh2gw2";
+    meta.description = "Accessors for Core types, for use with the Accessor library";
+    meta.broken = true; # Not compatible with ppxlib ≥ 0.23
+    propagatedBuildInputs = [ accessor_base core_kernel ];
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "086v93div4h9l02n7wzv3xx3i6xvddazydm9qlfa72ad55x3vzy0";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix textutils ];
+    doCheck = false; # we don't have netkit_sockets
+  };
+
+  async_extra = janePackage {
+    pname = "async_extra";
+    hash = "16cnz9h4jkc3b0837s5z0iv92q7n5nw77g8qshq8pwq639y8ail4";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel ];
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "0vlcpdr15bgrwrmixvs6ij88kvk8vzzrijz3zm0svxih0naf8ylx";
+    meta.description = "Directory traversal with Async";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_inotify = janePackage {
+    pname = "async_inotify";
+    hash = "0i0hf7nsir316ijixdj43qf0p3b6yapvcm2jzp7bhpf4r2kxislv";
+    meta.description = "Async wrapper for inotify";
+    propagatedBuildInputs = [ async_find inotify ];
+  };
+
+  async_interactive = janePackage {
+    pname = "async_interactive";
+    hash = "1cnmv9mipa6k6xd303ngdbxmiab2202f3w3pgq8l1970w8hb78il";
+    meta.description = "Utilities for building simple command-line based user interfaces";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_js = janePackage {
+    pname = "async_js";
+    hash = "0rld8792lfwbinn9rhrgacivz49vppgy29smpqnvpga89wchjv0v";
+    meta.description = "A small library that provide Async support for JavaScript platforms";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_rpc_kernel js_of_ocaml uri-sexp ];
+  };
+
+  async_kernel = janePackage {
+    pname = "async_kernel";
+    hash = "17giakwl0xhyxvxrkn12dwjdghc53q8px81z7cc3k6f102bsbdy6";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "1bwq3gkq057dd1fhrqz9kqq8a956nn87zaxvr0qcpiczzjv3zmvm";
+    meta.description = "Platform-independent core of Async RPC library";
+    propagatedBuildInputs = [ async_kernel protocol_version_header ];
+  };
+
+  async_sendfile = janePackage {
+    pname = "async_sendfile";
+    hash = "1w3gwwpgfzqjhblxnxh64g64q6kgjzzxx90inswfhycc88pnvdna";
+    meta.description = "Thin wrapper around [Linux_ext.sendfile] to send full files";
+    propagatedBuildInputs = [ async_unix ];
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "1r00z620nqv2jxz2xrp2gsyc30h8dd2w9qsnys2fkqbgpxlbgdc7";
+    meta.description = "Shell helpers for Async";
+    propagatedBuildInputs = [ async shell ];
+  };
+
+  async_smtp = janePackage {
+    pname = "async_smtp";
+    hash = "1xf3illn7vikdxldpnc29n4z8sv9f0wsdgdvl4iv93qlvjk8gzck";
+    meta.description = "SMTP client and server";
+    propagatedBuildInputs = [ async_extra async_inotify async_sendfile async_shell async_ssl email_message resource_cache re2_stable sexp_macro ];
+  };
+
+  async_ssl = janePackage {
+    pname = "async_ssl";
+    hash = "0ykys3ckpsx5crfgj26v2q3gy6wf684aq0bfb4q8p92ivwznvlzy";
+    meta.description = "Async wrappers for SSL";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
+    # in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
+    postPatch = ''
+      substituteInPlace bindings/dune \
+        --replace "ctypes.foreign.threaded" "ctypes.foreign"
+    '';
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "1wgnr0vdsknqrfnf6irmwnvyngndsnvvl1sfnj3v6fhwk4nswnrs";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel core ];
+  };
+
+  base = janePackage {
+    pname = "base";
+    version = "0.14.1";
+    hash = "1hizjxmiqlj2zzkwplzjamw9rbnl0kh44sxgjpzdij99qnfkzylf";
+    minimalOCamlVersion = "4.07";
+    meta.description = "Full standard library replacement for OCaml";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ sexplib0 ];
+    checkInputs = [ alcotest ];
+  };
+
+  base_bigstring = janePackage {
+    pname = "base_bigstring";
+    hash = "1ald2m7qywhxbygv58dzpgaj54p38zn0aiqd1z7i95kf3bsnsjqa";
+    minimalOCamlVersion = "4.07";
+    meta.description = "String type based on [Bigarray], for use in I/O and C-bindings";
+    propagatedBuildInputs = [ ppx_jane ];
+  };
+
+  base_quickcheck = janePackage {
+    pname = "base_quickcheck";
+    version = "0.14.1";
+    hash = "0apq3d9xb0zdaqsl4cjk5skyig57ff1plndb2mh0nn3czvfhifxs";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Randomized testing framework, designed for compatibility with Base";
+    propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let ppx_sexp_value splittable_random ];
+  };
+
+  bignum = janePackage {
+    pname = "bignum";
+    hash = "009ygr64q810p9iq4mykzz4ci00i5mzgpmq35jiyaiqm27bjam21";
+    propagatedBuildInputs = [ core_kernel zarith zarith_stubs_js ];
+    meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals";
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    hash = "1qyqbfp4zdc2jb87370cdgancisqffhf9x60zgh2m31kqik8annr";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A binary protocol generator";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_optcomp ppx_variants_conv ];
+  };
+
+  bonsai = janePackage {
+    pname = "bonsai";
+    hash = "0k4grabwqc9sy4shzp77bgfvyajvvc0l8qq89ia7cvlwvly7gv6a";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ ppx_pattern_bind ];
+    propagatedBuildInputs = [ incr_dom ];
+  };
+
+  cinaps = janePackage {
+    pname = "cinaps";
+    hash = "0ms1j2kh7i5slyw9v4w9kdz52dkwl5gqcnvn89prgimhk2vmichj";
+    minimalOCamlVersion = "4.07";
+    meta.description = "Trivial metaprogramming tool";
+    propagatedBuildInputs = [ re ];
+    checkInputs = [ ppx_jane ];
+  };
+
+  core = janePackage {
+    pname = "core";
+    version = "0.14.1";
+    hash = "1isrcl07nkmdm6akqsqs9z8s6zvva2lvg47kaagy7gsbyszrqb82";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ core_kernel spawn timezone ];
+    doCheck = false; # we don't have quickcheck_deprecated
+  };
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "04h6hzxk347pqyrrbgqrw9576sq4yf70fgq9xam3kajrqwdh3dhx";
+    meta.description = "Benchmarking library";
+    propagatedBuildInputs = [ textutils ];
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "1pbm6xbc3h0fhrymyr1yb9b1jk7n88gfi3pylqz2cs8haxr2pb3a";
+    meta.description = "Extra components that are not as closely vetted or as stable as Core";
+    propagatedBuildInputs = [ core ];
+  };
+
+  core_kernel = janePackage {
+    pname = "core_kernel";
+    version = "0.14.1";
+    hash = "0pikg4ln6177gbs0jfix7xj50zlcm7058h64lxnd7wspnj7mq8sd";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base_bigstring sexplib ];
+    doCheck = false; # we don't have quickcheck_deprecated
+  };
+
+  core_unix = janePackage {
+    pname = "core_unix";
+    hash = "0irfmpx6iksxk2r8mdizjn75h71qh4p2f1s9x2ggckzqj9y904ck";
+    meta.description = "Unix-specific portions of Core";
+    propagatedBuildInputs = [ core ];
+  };
+
+  csvfields = janePackage {
+    pname = "csvfields";
+    hash = "09jmz6y6nwd96dcx6g8ydicxssi72v1ks276phbc9n19wwg9hkaz";
+    propagatedBuildInputs = [ core num ];
+    meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv";
+  };
+
+  delimited_parsing = janePackage {
+    pname = "delimited_parsing";
+    hash = "1dnr5wqacryx1kj38i9iifc3457pchr887xphzz2nhlbizq3d7qa";
+    propagatedBuildInputs = [ async core_extended ];
+    meta.description = "Parsing of character (e.g., comma) separated and fixed-width values";
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "052qglpwzrx3c4gy3zr6dmsmfbi5gj4fs2jhx9yrsqb9hj8g36mj";
+    meta.description = "Library for writing Emacs plugin in OCaml";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  email_message = janePackage {
+    pname = "email_message";
+    hash = "0k8hjkq91ikl7wjxs04k523jbkhl6q4abj6v0lzlbjiybmrpp69n";
+    meta.description = "E-mail message parser";
+    propagatedBuildInputs = [ angstrom async base64 cryptokit magic-mime re2 ];
+  };
+
+  expect_test_helpers_async = janePackage {
+    pname = "expect_test_helpers_async";
+    hash = "175sjkx3b10d8vacp369rv53nxbiaxw1xhwy832g7ffk1by8l2m1";
+    meta.description = "Async helpers for writing expectation tests";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  expect_test_helpers_core = janePackage {
+    pname = "expect_test_helpers_core";
+    hash = "1drl15akp4jz4wf26dr2y2nblvnhz14xsnb3ai8dg45y711svs2i";
+    meta.description = "Helpers for writing expectation tests";
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+  };
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "0nxx35lrb4f6zfs5l80a7cg7azf19c6g31vn9qjjpaxf6lgkck2n";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values";
+    propagatedBuildInputs = [ base ];
+  };
+
+  higher_kinded = janePackage {
+    pname = "higher_kinded";
+    version = "0.14.1";
+    minimalOCamlVersion = "4.09";
+    hash = "05jvxgqsx3j2v8rqpd91ah76dgc1q2dz38kjklmx0vms4r4gvlsx";
+    meta.description = "A library with an encoding of higher kinded types in OCaml";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  incr_dom = janePackage {
+    pname = "incr_dom";
+    hash = "0mi98cwi4npdh5vvcz0pb4sbb9j9dydl52s51rswwc3kn8mipxfx";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_js incr_map incr_select virtual_dom ];
+    patches = [ ./incr_dom_jsoo_4_0.patch ];
+  };
+
+  incr_map = janePackage {
+    pname = "incr_map";
+    hash = "0s0s7qfydvvvnqby4v5by5jdnd5kxqsdr65mhm11w4fn125skryz";
+    meta.description = "Helpers for incremental operations on map like data structures";
+    buildInputs = [ ppx_pattern_bind ];
+    propagatedBuildInputs = [ incremental ];
+  };
+
+  incr_select = janePackage {
+    pname = "incr_select";
+    hash = "18ril6z57mw89gzc9zhz6p1phwm1xr6phppicvqpqmi0skvvnrg6";
+    meta.description = "Handling of large set of incremental outputs from a single input";
+    propagatedBuildInputs = [ incremental ];
+  };
+
+  incremental = janePackage {
+    pname = "incremental";
+    hash = "0nyaiy7r2spvn2ij9z5rghd5gbjk1y3ai4jn0i8q81arp7cf6zc7";
+    meta.description = "Library for incremental computations";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "12n40mlgjnc09fxc0hp0npsxdlxja2w828683zpb32nrzqkg6z4c";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Jane Street C header files";
+  };
+
+  jst-config = janePackage {
+    pname = "jst-config";
+    hash = "0hzw0crgj0kjxsvr10wng7gqy948v98hnijh30lgq3v62jdsjra8";
+    meta.description = "Compile-time configuration for Jane Street libraries";
+    buildInputs = [ dune-configurator ppx_assert stdio ];
+  };
+
+  ocaml-compiler-libs = janePackage {
+    pname = "ocaml-compiler-libs";
+    version = "0.12.4";
+    minimalOCamlVersion = "4.04.1";
+    hash = "sha256-W+KUguz55yYAriHRMcQy8gRPzh2TZSJnexG1JI8TLgI=";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    version = "0.14.1";
+    hash = "1nr0ncb8l2mkk8pqzknr7fsqw5kpz8y102kyv5bc0x7c36v0d4zy";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "S-expression parsing library";
+    propagatedBuildInputs = [ base sexplib0 ];
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "1np88s226ndhbwynpdqygrycahp8m1mx28f1xk54kvds8znnq2i0";
+    meta.description = "Diff library using Bram Cohen's patience diff algorithm";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  posixat = janePackage {
+    pname = "posixat";
+    hash = "0aana1lzq4514kna7hr301b5iv6gcg6zhgrx8s8vaad1q38yfp6c";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv ];
+    meta.description = "Binding to the posix *at functions";
+  };
+
+  ppx_accessor = janePackage {
+    pname = "ppx_accessor";
+    version = "0.14.3";
+    minimalOCamlVersion = "4.09";
+    hash = "sha256:1c8blzh2f34vbm1z3mnvh670c6vda70chw805n2hmkd9j46l0cll";
+    meta.description = "[@@deriving] plugin to generate accessors for use with the Accessor libraries";
+    propagatedBuildInputs = [ accessor ];
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "03mzgm4smrczp5dg3mpr6zc2v6a54n0r01k4ww820yrr25hcf8ip";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+    propagatedBuildInputs = [ ppx_cold ppx_compare ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "1wv3q0qyghm0c5izq03y97lv3czqk116059mg62wx6valn22a000";
+    minimalOCamlVersion = "4.04.2";
+    meta = {
+      description = "Base set of ppx rewriters";
+      mainProgram = "ppx-base";
+    };
+    propagatedBuildInputs = [ ppx_cold ppx_enumerate ppx_hash ppx_js_style ];
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    version = "0.14.1";
+    hash = "12r7jgqgpb4i4cry3rgyl2nmxcscs5w7mmk06diz7i49r27p96im";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    propagatedBuildInputs = [ ppx_inline_test ];
+  };
+
+  ppx_bin_prot = janePackage {
+    pname = "ppx_bin_prot";
+    hash = "1qryjxhyz3kn5jz5wm62j59lhjhd1mp7nbsj0np9qnbpapnnr1zg";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of bin_prot readers and writers from types";
+    propagatedBuildInputs = [ bin_prot ppx_here ];
+    doCheck = false; # circular dependency with ppx_jane
+  };
+
+  ppx_cold = janePackage {
+    pname = "ppx_cold";
+    hash = "0ciqs6f9ab73gq4krj14xzzba4ydcxph214m87i1s0xp25hwxr8v";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Expands [@cold] into [@inline never][@specialise never][@local never]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "11pj76dimx2f7l8m85myzp6yzx9xcg0bqi97s7ayssvkckm57390";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of comparison functions from types";
+    propagatedBuildInputs = [ ppxlib base ];
+    doCheck = false; # test build rule broken
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    version = "0.14.1";
+    hash = "0c1m65kn27zvwmfwy7kk46ga76yw2a3ik9jygpy1b6nn6pi026w9";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+  };
+
+  ppx_enumerate = janePackage {
+    pname = "ppx_enumerate";
+    hash = "1sriid4vh10p80wwvn46v1g16m646qw5r5xzwlymyz5gbvq2zf40";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generate a list containing all values of a finite type";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    version = "0.14.1";
+    hash = "0vbbnjrzpyk5p0js21lafr6fcp2wqka89p1876rdf472cmg0l7fv";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Cram like framework for OCaml";
+    propagatedBuildInputs = [ ppx_here ppx_inline_test re ];
+    doCheck = false; # circular dependency with ppx_jane
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    version = "0.14.2";
+    hash = "1zwirwqry24b48bg7d4yc845hvcirxyymzbw95aaxdcck84d30n8";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of accessor and iteration functions for ocaml records";
+    propagatedBuildInputs = [ fieldslib ppxlib ];
+  };
+
+  ppx_fixed_literal = janePackage {
+    pname = "ppx_fixed_literal";
+    hash = "0s7rb4dhz4ibhh42a9sfxjj3zbwfyfmaihr92hpdv5j9xqn3n8mi";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Simpler notation for fixed point literals";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "1zf03xdrg4jig7pdcrdpbabyjkdpifb31z2z1bf9wfdawybdhwkq";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "09zcyigaalqccs9s0h7n0535clgfmqb9s4p1jbgcqji9zj8w426s";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Expands [%here] into its location";
+    propagatedBuildInputs = [ ppxlib ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    version = "0.14.1";
+    hash = "1ajdna1m9l1l3nfigyy33zkfa3yarfr6s086jdw2pcfwlq1fhhl4";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension for writing in-line tests in ocaml code";
+    propagatedBuildInputs = [ ppxlib time_now ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "1kk238fvrcylymwm7xwc7llbyspmx1y662ypq00vy70g112rir7j";
+    minimalOCamlVersion = "4.04.2";
+    meta = {
+      description = "Standard Jane Street ppx rewriters";
+      mainProgram = "ppx-jane";
+    };
+    propagatedBuildInputs = [ base_quickcheck ppx_bin_prot ppx_expect ppx_fixed_literal ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_stable ppx_string ppx_typerep_conv ppx_variants_conv ];
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    version = "0.14.1";
+    hash = "16ax6ww9h36xyn9acbm8zxv0ajs344sm37lgj2zd2bvgsqv24kxj";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Code style checker for Jane Street Packages";
+    propagatedBuildInputs = [ octavius ppxlib ];
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "1jq3g88xv9g6y9im67hiig3cfn5anwwnq09mp7yn7a86ha5r9w3i";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Monadic let-bindings";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_log = janePackage {
+    pname = "ppx_log";
+    hash = "10hnr5lpww3fw0bnidzngalbgy0j1wvz1g5ki9c9h558pnpvsazr";
+    minimalOCamlVersion = "4.08.0";
+    meta.description = "Ppx_sexp_message-like extension nodes for lazily rendering log messages";
+    propagatedBuildInputs = [ async_unix ppx_jane sexplib ];
+  };
+
+  ppx_module_timer = janePackage {
+    pname = "ppx_module_timer";
+    hash = "163q1rpblwv82fxwyf0p4j9zpsj0jzvkfmzb03r0l49gqhn89mp6";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Ppx rewriter that records top-level module startup times";
+    propagatedBuildInputs = [ time_now ];
+  };
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    version = "0.14.3";
+    hash = "1iflgfzs23asw3k6098v84al5zqx59rx2qjw0mhvk56avlx71pkw";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Optional compilation for OCaml";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "1d7rsdqiccxp2w4ykb9klarddm2qrrym3brbnhzx2hm78iyj3hzv";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Pattern matching on flat options";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_pattern_bind = janePackage {
+    pname = "ppx_pattern_bind";
+    hash = "0yxkwnn30nxgrspi191zma95bgrh134aqh2bnpj3wg0245ki55zv";
+    minimalOCamlVersion = "4.07";
+    meta.description = "A ppx for writing fast incremental bind nodes in a pattern match";
+    propagatedBuildInputs = [ ppx_let ];
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "0450b3p2rpnnn5yyvbkcd3c33jr2z0dp8blwxddaj2lv7nzl5dzf";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_python = janePackage {
+    pname = "ppx_python";
+    hash = "0gk4nqz4i9v3hwjg5mvgpgwj0dfcgpyc7ikba93cafyhn6fy83zk";
+    meta.description = "A [@@deriving] plugin to generate Python conversion functions ";
+    # Compatibility with ppxlib 0.23
+    patches = fetchpatch {
+      url = "https://github.com/janestreet/ppx_python/commit/b2fe0040cc39fa6164de868f8a20edb38d81170e.patch";
+      sha256 = "sha256:1mrdwp0zw3dqavzx3ffrmzq5cdlninyf67ksavfzxb8gb16w6zpz";
+    };
+    propagatedBuildInputs = [ ppx_base ppxlib pyml ];
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    version = "0.14.3";
+    minimalOCamlVersion = "4.04.2";
+    hash = "0dbri9d00ydi0dw1cavswnqdmhjaaz80vap29ns2lr6mhhlvyjmj";
+    meta.description = "[@@deriving] plugin to generate S-expression conversion functions";
+    propagatedBuildInputs = [ (ppxlib.override { version = "0.24.0"; }) sexplib0 base ];
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    version = "0.14.1";
+    hash = "1lvsr0d68kakih1ll33hy6dxbjkly6lmky4q6z0h0hrcbd6z48k4";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "1d1c92pyypqkd9473d59j0sfppxvcxggbc62w8bkqnbxrdmvirn9";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_stable = janePackage {
+    pname = "ppx_stable";
+    version = "0.14.1";
+    hash = "1sp1kn23qr0pfypa4ilvhqq5y11y13xpfygfl582ra9kik5xqfa1";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Stable types conversions generator";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_string = janePackage {
+    pname = "ppx_string";
+    version = "0.14.1";
+    minimalOCamlVersion = "4.04.2";
+    hash = "0a8khmg0y32kyn3q6idwgh0d6d1s6ms1w75gj3dzng0v7y4h6jx4";
+    meta.description = "Ppx extension for string interpolation";
+    propagatedBuildInputs = [ ppx_base ppxlib stdio ];
+  };
+
+  ppx_typerep_conv = janePackage {
+    pname = "ppx_typerep_conv";
+    version = "0.14.2";
+    minimalOCamlVersion = "4.04.2";
+    hash = "0yk9vkpnwr8labgfncqdi4rfkj88d8mb3cr8m4gdqpi3f2r27hf0";
+    meta.description = "Generation of runtime types from type declarations";
+    propagatedBuildInputs = [ ppxlib typerep ];
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    version = "0.14.2";
+    minimalOCamlVersion = "4.04.2";
+    hash = "1p11fiz4m160hs0xzg4g9rxchp053sz3s3d1lyciqixad1xi47a4";
+    meta.description = "Generation of accessor and iteration functions for ocaml variant types";
+    propagatedBuildInputs = [ variantslib ppxlib ];
+  };
+
+  protocol_version_header = janePackage {
+    pname = "protocol_version_header";
+    hash = "0lfblv2yqw01bl074ga6vxii0p9mqwlqw1g9b9z7pfdva9wqilrd";
+    meta.description = "Protocol versioning";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  pythonlib = janePackage {
+    pname = "pythonlib";
+    hash = "0qr0mh9jiv1ham5zlz9i4im23a1vh6x1yp6dp2db2s4icmfph639";
+    meta.description = "A library to help writing wrappers around ocaml code for python";
+    meta.broken = lib.versionAtLeast ocaml.version "4.13";
+    propagatedBuildInputs = [ ppx_expect ppx_let ppx_python stdio typerep ];
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "1j7dizls6lkz3i9dgf8nq2fm382mfbrmz72ci066zl3hkgdq8xwc";
+    meta.description = "OCaml bindings for RE2, Google's regular expression library";
+    propagatedBuildInputs = [ core_kernel ];
+    prePatch = ''
+      substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++'
+      substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))'
+    '';
+  };
+
+  re2_stable = janePackage {
+    pname = "re2_stable";
+    hash = "0kjc0ff6b3509s3b9n4q8ilb06d5fngdh3z58cm95vg7zkcas9w3";
+    meta.description = "Re2_stable adds an incomplete but stable serialization of Re2";
+    propagatedBuildInputs = [ core re2 ];
+  };
+
+  resource_cache = janePackage {
+    pname = "resource_cache";
+    hash = "197z9s535q74h00365ydhggg7hyzpyqvislgwwyi69sl1vy6dr0j";
+    meta.description = "General resource cache";
+    propagatedBuildInputs = [ async_rpc_kernel ];
+  };
+
+  sexp = janePackage {
+    pname = "sexp";
+    hash = "1x08pyrkd78233kgj70wxlc79w6jjhfrjdamm2xr7jzdc8ycfigf";
+    propagatedBuildInputs = [
+      async
+      core
+      csvfields
+      re2
+      sexp_diff_kernel
+      sexp_macro
+      sexp_pretty
+      sexp_select
+    ];
+    patches = ./sexp.patch;
+    meta.description = "S-expression swiss knife";
+  };
+
+  sexp_diff_kernel = janePackage {
+    pname = "sexp_diff_kernel";
+    hash = "1pljcs019hs2ffhhb7rjh3xz7cbrk8vsv967jzmip3rv9w21c9kh";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Code for computing the diff of two sexps";
+  };
+
+  sexp_macro = janePackage {
+    pname = "sexp_macro";
+    hash = "1ih1g7vpb1j8vhzm9a5mjrrzgqrhjqdhf6vjrg8kxfqg5i5b8nyx";
+    propagatedBuildInputs = [ async sexplib ];
+    meta.description = "Sexp macros";
+  };
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    hash = "0dax0wm511zgvr7p6kcd5gygi58118by7hsv7hymy8ldfcky5cwd";
+    minimalOCamlVersion = "4.07";
+    meta.description = "S-expression pretty-printer";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+  };
+
+  sexp_select = janePackage {
+    pname = "sexp_select";
+    hash = "1lchhfqw4afw38fnarwylqc2qp7k6xwx3j7m9gy8ygjgd0vgd729";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ base ppx_jane ];
+    meta.description = "A library to use CSS-style selectors to traverse sexp trees";
+  };
+
+  sexplib0 = janePackage {
+    pname = "sexplib0";
+    hash = "06sb3zqhb3dwqsmn15d769hfgqwqhxnm52iqim9l767gvlwpmibb";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    hash = "03c3j1ihx4pjbb0x3arrcif3wvp3iva2ivnywhiak4mbbslgsnzr";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Library for serializing OCaml values to and from S-expressions";
+    propagatedBuildInputs = [ num parsexp ];
+  };
+
+  shell = janePackage {
+    pname = "shell";
+    hash = "1c4zmpf6s1lk7nficip32c324if6zhm62h9h03d84zgvhvymi0r1";
+    meta.description = "Yet another implementation of fork&exec and related functionality";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ textutils ];
+    checkInputs = [ ounit ];
+  };
+
+  shexp = janePackage {
+    pname = "shexp";
+    hash = "1h6hsnbg6bk32f8iv6kd6im4mv2pjsjpd1mjsfx80p1n9273xack";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    version = "0.13.0";
+    minimalOCamlVersion = "4.02.3";
+    hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf";
+    meta.description = "Spawning sub-processes";
+    buildInputs = [ ppx_expect ];
+    doCheck = false; # tests are broken on NixOS (absolute paths)
+  };
+
+  splay_tree = janePackage {
+    pname = "splay_tree";
+    hash = "1xbzzbqb054hl1v1zcgfwdgzqihni3a0dmvrric9xggmgn4ycmqq";
+    meta.description = "A splay tree implementation";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  splittable_random = janePackage {
+    pname = "splittable_random";
+    hash = "0ax988b1wc7km8khg4s6iphbz16y1rssh7baigxfyw3ldp0agk14";
+    meta.description = "PRNG that can be split into independent streams";
+    propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ];
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    hash = "0vv6d8absy4hvjd1babv7avpsdlvjpnd5hq691h39d0h3pvs6l98";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Standard IO library for OCaml";
+    propagatedBuildInputs = [ base ];
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "1ggd0530lc5dkc419y3xw1wb52b4b5j3z78991gn5yxf2s50a8d4";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core ];
+  };
+
+  time_now = janePackage {
+    pname = "time_now";
+    hash = "1lyq8zdz93hvpi4hpxh88kds30k5ljil8js9clcqyxrldp5n9mw0";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Reports the current time";
+    buildInputs = [ jst-config ppx_optcomp ];
+    propagatedBuildInputs = [ jane-street-headers base ppx_base ];
+  };
+
+  timezone = janePackage {
+    pname = "timezone";
+    hash = "0zf075k94nk2wxnzpxia7pnm655damwp1b58xf2s9disia1ydxg7";
+    meta.description = "Time-zone handling";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  topological_sort = janePackage {
+    pname = "topological_sort";
+    hash = "17iz7956zln31p0xnm3jlhj863zi84bcx41jylzf7gk23qsm95m8";
+    meta.description = "Topological sort algorithm";
+    propagatedBuildInputs = [ ppx_jane stdio ];
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "0wc7h853ka3s3lxxgm61ypidl0lzgc9abdkil6f72anl0c417y90";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Typerep is a library for runtime types";
+    propagatedBuildInputs = [ base ];
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "0vy0hpiaawmydh08nqlwjx52pasp74383yi0pshwbdxin99n9mxd";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Part of Jane Street's Core library";
+    propagatedBuildInputs = [ base ];
+  };
+
+  vcaml = janePackage {
+    pname = "vcaml";
+    hash = "0ykwrn8bvwx26ad4wb36jw9xnlwsdpnnx88396laxvcfimrp13qs";
+    meta.description = "OCaml bindings for the Neovim API";
+    propagatedBuildInputs = [ angstrom-async async_extra faraday ];
+  };
+
+  virtual_dom = janePackage {
+    pname = "virtual_dom";
+    hash = "0vcydxx0jhbd5hbriahgp947mc7n3xymyrsfny1c4adk6aaq3c5w";
+    meta.description = "OCaml bindings for the virtual-dom library";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ core_kernel js_of_ocaml lambdasoup tyxml ];
+  };
+
+  zarith_stubs_js = janePackage {
+    pname = "zarith_stubs_js";
+    hash = "16p4bn5spkrx31fr4np945v9mwdq55706v3wl19s5fy6x83gvb86";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Javascripts stubs for the Zarith library";
+    doCheck = false; # requires workspace with zarith
+  };
+
+  zstandard = janePackage {
+    pname = "zstandard";
+    hash = "1vf76v5m9wsh5f77w9z4i8sxm05wr5digyi95x4wvzdi7q3qg6m8";
+    meta.description = "OCaml bindings to Zstandard";
+    buildInputs = [ ppx_jane ];
+    propagatedBuildInputs = [ core ctypes zstd ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.15.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.15.nix
new file mode 100644
index 000000000000..10675364396f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.15.nix
@@ -0,0 +1,1103 @@
+{ self
+, bash
+, fetchpatch
+, fzf
+, lib
+, ocaml
+, openssl
+, zstd
+}:
+
+with self;
+
+{
+
+  abstract_algebra = janePackage {
+    pname = "abstract_algebra";
+    minimalOCamlVersion = "4.08";
+    hash = "12imf6ibm7qb8r1fpqnrl20x2z14zl3ri1vzg0z8qby9l8bv2fbd";
+    meta.description = "A small library describing abstract algebra concepts";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  accessor = janePackage {
+    pname = "accessor";
+    minimalOCamlVersion = "4.09";
+    hash = "17rzf0jpc9s3yrxcnn630jhgsw5mrnrhwbfh62hqxqanascc5rxh";
+    meta.description = "A library that makes it nicer to work with nested functional data structures";
+    propagatedBuildInputs = [ higher_kinded ];
+  };
+
+  accessor_async = janePackage {
+    pname = "accessor_async";
+    minimalOCamlVersion = "4.09";
+    hash = "17r6af55ms0i496jsfx0xpdm336c2vhyf49b3s8s1gpz521wrgmc";
+    meta.description = "Accessors for Async types, for use with the Accessor library";
+    propagatedBuildInputs = [ accessor_core async_kernel ];
+  };
+
+  accessor_base = janePackage {
+    pname = "accessor_base";
+    minimalOCamlVersion = "4.09";
+    hash = "1qvq005vxf6n1c7swzb4bzcqdh471bfb9gcmdj4m57xg85xznc1n";
+    meta.description = "Accessors for Base types, for use with the Accessor library";
+    propagatedBuildInputs = [ ppx_accessor ];
+  };
+
+  accessor_core = janePackage {
+    minimalOCamlVersion = "4.09";
+    pname = "accessor_core";
+    hash = "0zrs5zbyrhfbah73g22l19bw1mmljhyb3l2mrwcxgbjq9pqp0k9v";
+    meta.description = "Accessors for Core types, for use with the Accessor library";
+    propagatedBuildInputs = [ accessor_base core_kernel ];
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "0pykmnsil754jsnr8gss91ykyjvivngx4ii0ih3nsg1x2jl9xmy2";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix textutils ];
+    doCheck = false; # we don't have netkit_sockets
+  };
+
+  async_extra = janePackage {
+    pname = "async_extra";
+    hash = "0pxp0b4shz9krsj8xfzajv8a1mijgf0xdgxrn2abdqrz3rvj6pig";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel ];
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "119988nkcnw6l6wch4llqkvsrawv2gkbn5q4hngpdwvnw0g0aapv";
+    meta.description = "Directory traversal with Async";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_inotify = janePackage {
+    pname = "async_inotify";
+    hash = "1nxz6bijp7liy18ljrxg92v2m8v8fqcs1pmzg9kbcf0d4vij8j2p";
+    meta.description = "Async wrapper for inotify";
+    propagatedBuildInputs = [ async_find inotify ];
+  };
+
+  async_interactive = janePackage {
+    pname = "async_interactive";
+    hash = "00hr2lhs8p3hwnyllmns59rwlpimc5b7r6v4zn6cmpb1riblaxqp";
+    meta.description = "Utilities for building simple command-line based user interfaces";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_js = janePackage {
+    pname = "async_js";
+    hash = "184j077bz686k5lrqswircnrdqldb316ngpzq7xri1pcsl39sy3q";
+    meta.description = "A small library that provide Async support for JavaScript platforms";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_rpc_kernel js_of_ocaml uri-sexp ];
+  };
+
+  async_kernel = janePackage {
+    pname = "async_kernel";
+    hash = "01if6c8l2h64v7sk56xr8acnmj6g9whxcjrzzzvczspq88hq2bfh";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "1b5rp5yam03ir4f1sixpzjg1zdqmkb7lvnaa82kac4fzk80gfrfr";
+    meta.description = "Platform-independent core of Async RPC library";
+    propagatedBuildInputs = [ async_kernel protocol_version_header ];
+  };
+
+  async_rpc_websocket = janePackage {
+    pname = "async_rpc_websocket";
+    hash = "1n93jhkz5r76xcc40c4i4sxcyfz1dbppz8sjfxpwcwjyi6lyhp1p";
+    meta.description = "Library to serve and dispatch Async RPCs over websockets";
+    propagatedBuildInputs = [ async_rpc_kernel async_websocket cohttp_async_websocket ];
+  };
+
+  async_sendfile = janePackage {
+    pname = "async_sendfile";
+    hash = "0lnagdxfnac4z29narphf2ab5a23ys883zmc45r96rssfx82i3fs";
+    meta.description = "Thin wrapper around [Linux_ext.sendfile] to send full files";
+    propagatedBuildInputs = [ async_unix ];
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "07iwlyrc4smk6hsnz89cz2ihp670mllq0y9wbdafvagm1y1p62vx";
+    meta.description = "Shell helpers for Async";
+    propagatedBuildInputs = [ async shell ];
+  };
+
+  async_smtp = janePackage {
+    pname = "async_smtp";
+    hash = "1m00j7wcb0blipnc1m6by70gd96a1k621b4dgvgffp8as04a461r";
+    minimalOCamlVersion = "4.12";
+    meta.description = "SMTP client and server";
+    propagatedBuildInputs = [ async_extra async_inotify async_sendfile async_shell async_ssl email_message resource_cache re2_stable sexp_macro ];
+  };
+
+  async_ssl = janePackage {
+    pname = "async_ssl";
+    hash = "1b7f7p3xj4jr2n2dxy2lp7a9k7944w6x2nrg6524clvcsd1ax4hn";
+    meta.description = "Async wrappers for SSL";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
+    # in ctypes.foreign 0.18.0 threaded and unthreaded have been merged
+    postPatch = ''
+      substituteInPlace bindings/dune \
+        --replace "ctypes.foreign.threaded" "ctypes.foreign"
+    '';
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "0z4fgpn93iw0abd7l9kac28qgzgc5qr2x0s1n2zh49lsdn02n6ys";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel core_unix ];
+  };
+
+  async_websocket = janePackage {
+    pname = "async_websocket";
+    hash = "16ixqfnx9jp77bvx11dlzsq0pzfpyiif60hl2q06zncyswky9xgb";
+    meta.description = "A library that implements the websocket protocol on top of Async";
+    propagatedBuildInputs = [ async cryptokit ];
+  };
+
+  base = janePackage {
+    pname = "base";
+    version = "0.15.1";
+    hash = "sha256-CDKQVF+hAvJTo5QmRvyOfQNrdRgz6m+64q9UzNHlJEA=";
+    minimalOCamlVersion = "4.10";
+    meta.description = "Full standard library replacement for OCaml";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ sexplib0 ];
+    checkInputs = [ alcotest ];
+  };
+
+  base_bigstring = janePackage {
+    pname = "base_bigstring";
+    hash = "1hv3hw2fwqmkrxms1g6rw3c18mmla1z5bva3anx45mnff903iv4q";
+    minimalOCamlVersion = "4.08";
+    meta.description = "String type based on [Bigarray], for use in I/O and C-bindings";
+    propagatedBuildInputs = [ int_repr ppx_jane ];
+  };
+
+  base_quickcheck = janePackage {
+    pname = "base_quickcheck";
+    hash = "0q73kfr67cz5wp4qn4rq3lpa922hqmvwdiinnans0js65fvlgqsi";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Randomized testing framework, designed for compatibility with Base";
+    propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let ppx_sexp_value splittable_random ];
+  };
+
+  bignum = janePackage {
+    pname = "bignum";
+    hash = "12q3xcv78b4s9srnc17jbyn53d5drmwmyvgp62p7nk3fs4f7cr4f";
+    propagatedBuildInputs = [ core_kernel zarith zarith_stubs_js ];
+    meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals";
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    hash = "1qfqglscc25wwnjx7byqmjcnjww1msnr8940gyg8h93wdq43fjnh";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A binary protocol generator";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_optcomp ppx_variants_conv ];
+  };
+
+  bonsai = janePackage {
+    pname = "bonsai";
+    hash = "150zx2g1dmhyrxwqq8j7f2m3hjpmk5bk182ihx2gdbarhw1ainpm";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ ppx_pattern_bind ];
+    nativeBuildInputs = [ js_of_ocaml-compiler ocaml-embed-file ];
+    propagatedBuildInputs = [
+      async
+      async_extra
+      async_rpc_websocket
+      cohttp-async
+      core_bench
+      fuzzy_match
+      incr_dom
+      js_of_ocaml-ppx
+      patdiff
+      ppx_css
+      ppx_typed_fields
+      profunctor
+      textutils
+    ];
+    patches = [ ./bonsai_jsoo_4_0.patch ];
+  };
+
+  cinaps = janePackage {
+    pname = "cinaps";
+    version = "0.15.1";
+    hash = "0g856cxmxg4vicwslhqldplkpwi158s2d62vwzv26xg5m6wjn9rg";
+    minimalOCamlVersion = "4.04";
+    meta.description = "Trivial metaprogramming tool";
+    propagatedBuildInputs = [ re ];
+    doCheck = false; # fails because ppx_base doesn't include ppx_js_style
+  };
+
+  cohttp_async_websocket = janePackage {
+    pname = "cohttp_async_websocket";
+    hash = "0d0smavnxpnwrmhlcf3b5a3cm3n9kz1y8fh6l28xv6zrn4sc7ik8";
+    meta.description = "Websocket library for use with cohttp and async";
+    propagatedBuildInputs = [ async_websocket cohttp-async ppx_jane uri-sexp ];
+  };
+
+  cohttp_static_handler = janePackage {
+    pname = "cohttp_static_handler";
+    version = "0.15.0";
+    hash = "sha256-ENaH8ChvjeMc9WeNIhkeNBB7YK9vB4lw95o6FFZI1ys=";
+    meta.description = "A library for easily creating a cohttp handler for static files";
+    propagatedBuildInputs = [ cohttp-async ];
+  };
+
+  core = janePackage {
+    pname = "core";
+    version = "0.15.1";
+    hash = "sha256-SHjnNFl+JAjdgVoRgmnz0wqrrc3zoh0ZyG2UhUsUbJ8=";
+    meta.description = "Industrial strength alternative to OCaml's standard library";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base base_bigstring base_quickcheck ppx_jane time_now ];
+    doCheck = false; # circular dependency with core_kernel
+    meta.broken = lib.versionAtLeast ocaml.version "5.1";
+  };
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "0v6lm9vz6y1qd7h8pg9l5jsy8qr74vlk1nd4qzchld4jhwq7mbdi";
+    meta.description = "Benchmarking library";
+    propagatedBuildInputs = [ textutils ];
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "0sx79hc1y1daczib2p4nbyw4aqnznmdd83knrhs5q153j7lnlalx";
+    meta.description = "Extra components that are not as closely vetted or as stable as Core";
+    propagatedBuildInputs = [ core_unix record_builder ];
+  };
+
+  core_kernel = janePackage {
+    pname = "core_kernel";
+    hash = "05mb4vbf293iq1xx4acyrmi9cgcw6capwrsa54ils62alby6w6yq";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base_bigstring core int_repr sexplib ];
+    doCheck = false; # we don't have quickcheck_deprecated
+  };
+
+  core_unix = janePackage {
+    pname = "core_unix";
+    version = "0.15.2";
+    hash = "sha256-9f2PiLo+4Bjnfvh3scvIiPHj0wPZozmMMiCTe7vC1EA=";
+    meta.description = "Unix-specific portions of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ core_kernel expect_test_helpers_core ocaml_intrinsics ppx_jane timezone spawn ];
+    postPatch = ''
+      patchShebangs unix_pseudo_terminal/src/discover.sh
+    '';
+  };
+
+  csvfields = janePackage {
+    pname = "csvfields";
+    version = "0.15.1";
+    hash = "sha256-bBupsarwjte2NCncNDFSkrrmMR3EYPn+D7xI9zQOhFA=";
+    propagatedBuildInputs = [ core num ];
+    meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv";
+  };
+
+  delimited_parsing = janePackage {
+    pname = "delimited_parsing";
+    hash = "0d050v58zzi8c4qiwxbfcyrdw6zvncnnl3qj79qi0yq4xkg7820r";
+    propagatedBuildInputs = [ async core_extended ];
+    meta.description = "Parsing of character (e.g., comma) separated and fixed-width values";
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "08g2bl06vkn3bkqzkmvk2646aqb6jj4a7n3wgzpcx1c2gl3iw5i6";
+    meta.description = "Library for writing Emacs plugin in OCaml";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  email_message = janePackage {
+    pname = "email_message";
+    hash = "00h66l2g5rjaay0hbyqy4v9i866g779miriwv20h9k4mliqdq7in";
+    meta.description = "E-mail message parser";
+    propagatedBuildInputs = [ angstrom async base64 cryptokit magic-mime re2 ];
+  };
+
+  expect_test_helpers_async = janePackage {
+    pname = "expect_test_helpers_async";
+    hash = "14v4966p5dmqgjb9sgrvnsixv0w0bagicn8v44g9mf9d88z8pfym";
+    meta.description = "Async helpers for writing expectation tests";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  expect_test_helpers_core = janePackage {
+    pname = "expect_test_helpers_core";
+    hash = "0bxs3g0zzym8agfcbpg5lmrh6hcb86z861bq40xhhfwqf4pzdbfa";
+    meta.description = "Helpers for writing expectation tests";
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+  };
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "0xwf9mdxlyr3f0vv5y82cyw2bsckwl8rwf6jm6bai1gqpgxjq756";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values";
+    propagatedBuildInputs = [ base ];
+  };
+
+  file_path = janePackage {
+    pname = "file_path";
+    minimalOCamlVersion = "4.11";
+    hash = "0vjvxviryywwwfdazcijwhpajp2d4mavlki7lj4qaafjrw62x14k";
+    meta.description =
+      "A library for typed manipulation of UNIX-style file paths";
+    propagatedBuildInputs = [
+      async
+      core
+      core_kernel
+      core_unix
+      expect_test_helpers_async
+      expect_test_helpers_core
+      ppx_jane
+    ];
+  };
+
+  fuzzy_match = janePackage {
+    pname = "fuzzy_match";
+    hash = "0s5w81698b07l5m11nwx8xbjcpmp54dnf5fcrnlva22jrlsf14h4";
+    meta.description = "A library for fuzzy string matching";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  fzf = janePackage {
+    pname = "fzf";
+    minimalOCamlVersion = "4.08";
+    hash = "1ha0i6dx5bgwzbdi4rn98wjwi2imv5p2i7qs7hy0c6cmg88xbdry";
+    meta.description = "A library for running the fzf command line tool";
+    propagatedBuildInputs = [ async core_kernel ppx_jane ];
+    postPatch = ''
+      substituteInPlace src/fzf.ml --replace /usr/bin/fzf ${fzf}/bin/fzf
+    '';
+  };
+
+  higher_kinded = janePackage {
+    pname = "higher_kinded";
+    minimalOCamlVersion = "4.09";
+    hash = "0rafxxajqswi070h8sinhjna0swh1hc6d7i3q7y099yj3wlr2y1l";
+    meta.description = "A library with an encoding of higher kinded types in OCaml";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  incr_dom = janePackage {
+    pname = "incr_dom";
+    hash = "1sija9w2im8vdp61h387w0mww9hh7jgkgsjcccps4lbv936ac7c1";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_js incr_map incr_select virtual_dom ];
+    patches = [ ./incr_dom_jsoo_4_0.patch ];
+  };
+
+  incr_map = janePackage {
+    pname = "incr_map";
+    hash = "0aq8wfylvq68him92vzh1fqmr7r0lfwc5cdiqr10r5x032vzpnii";
+    meta.description = "Helpers for incremental operations on map like data structures";
+    buildInputs = [ ppx_pattern_bind ];
+    propagatedBuildInputs = [ abstract_algebra incremental ];
+  };
+
+  incr_select = janePackage {
+    pname = "incr_select";
+    hash = "0qm2i4hb5jh2ra95kq881s4chkwbd2prvql1c0nahd63h829m57l";
+    meta.description = "Handling of large set of incremental outputs from a single input";
+    propagatedBuildInputs = [ incremental ];
+  };
+
+  incremental = janePackage {
+    pname = "incremental";
+    hash = "1dp30mhljnbcxqimydwbmxx0x4y4xnb55gyhldm1f5qrwdxdl747";
+    meta.description = "Library for incremental computations";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  int_repr = janePackage {
+    pname = "int_repr";
+    hash = "0ph88ym3s9dk30n17si2xam40sp8wv1xffw5cl3bskc2vfya1nvl";
+    meta.description = "Integers of various widths";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "1lzk3w66x4429n2j75lwm55xafc46mywgdrbh9nc9jwqwgzf0wwx";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Jane Street C header files";
+  };
+
+  jsonaf = janePackage {
+    pname = "jsonaf";
+    hash = "1j9rn8vsvfpgmdpmdqb5qhvss5171j8n3ii1bcgnavqinchbvqa6";
+    meta.description = "A library for parsing, manipulating, and serializing data structured as JSON";
+    propagatedBuildInputs = [ base ppx_jane angstrom faraday ];
+  };
+
+  jst-config = janePackage {
+    pname = "jst-config";
+    hash = "1lxqsj5k3v8p7g802vj1xc6bs5wrfpszh3q61xvpcd42pf3ahma9";
+    meta.description = "Compile-time configuration for Jane Street libraries";
+    buildInputs = [ dune-configurator ppx_assert stdio ];
+    patches = [
+      # remove on next release
+      (fetchpatch {
+        url = "https://github.com/janestreet/jst-config/commit/e5fdac6e5df9ba93e014a4d2db841fdbf209446f.patch";
+        sha256 = "sha256-8hVC76z5ilYD/++xRHVswy/l+zzDt63jH4hfSJ/rPaA=";
+      })
+    ];
+  };
+
+  ocaml-compiler-libs = janePackage {
+    pname = "ocaml-compiler-libs";
+    version = "0.12.4";
+    minimalOCamlVersion = "4.04.1";
+    hash = "00if2f7j9d8igdkj4rck3p74y17j6b233l91mq02drzrxj199qjv";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  ocaml-embed-file = janePackage {
+    pname = "ocaml-embed-file";
+    hash = "1nzgc0q05f0j3q1kwfpyhhhpgwrfjvmkqqifrkrm4y7d1i44bfnw";
+    propagatedBuildInputs = [ async ppx_jane ];
+    meta.description = "Files contents as module constants";
+  };
+
+  ocaml_intrinsics = janePackage {
+    pname = "ocaml_intrinsics";
+    minimalOCamlVersion = "4.08";
+    version = "0.15.2";
+    hash = "sha256-f5zqrKaokj1aEvbu7lOuK0RoWSklFr6QFpV+oWbIX9U=";
+    meta.description = "Intrinsics";
+    buildInputs = [ dune-configurator ];
+    doCheck = false; # test rules broken
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    hash = "1grzpxi39318vcqhwf723hqh11k68irh59zb3dyg9lw8wjn7752a";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "S-expression parsing library";
+    propagatedBuildInputs = [ base sexplib0 ];
+  };
+
+  patdiff = janePackage {
+    pname = "patdiff";
+    hash = "0623a7n5r659rkxbp96g361mvxkcgc6x9lcbkm3glnppplk5kxr9";
+
+    # Used by patdiff-git-wrapper.  Providing it here also causes the shebang
+    # line to be automatically patched.
+    buildInputs = [ bash ];
+    propagatedBuildInputs = [ core_unix patience_diff ocaml_pcre ];
+    meta = {
+      description = "File Diff using the Patience Diff algorithm";
+    };
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "17yrhn4qfi31m8g1ygb3m6i9z4fqd8f60fn6viazgx06s3x4xp3v";
+    meta.description = "Diff library using Bram Cohen's patience diff algorithm";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  posixat = janePackage {
+    pname = "posixat";
+    hash = "1xgycwa0janrfn9psb7xrm0820blr82mqf1lvjy9ipqalj7v9w1f";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv ];
+    meta.description = "Binding to the posix *at functions";
+  };
+
+  ppx_accessor = janePackage {
+    pname = "ppx_accessor";
+    minimalOCamlVersion = "4.09";
+    hash = "0qv51if1nk0zff2v6q946h8ac7bpd5xa4ivyixl9g4h2mk29w4qb";
+    meta.description = "[@@deriving] plugin to generate accessors for use with the Accessor libraries";
+    propagatedBuildInputs = [ accessor ];
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "0dic250q3flrjs3i70a2qqqnhqqj75ddlixpy7hdfghjw32azw90";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+    propagatedBuildInputs = [ ppx_cold ppx_compare ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "13rfmy2fxvwi7z5l1mai474ri5anqjm8q4hs7dblplsjjd9m5ld1";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Base set of ppx rewriters";
+    propagatedBuildInputs = [ ppx_cold ppx_enumerate ppx_hash ];
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    version = "0.15.1";
+    hash = "sha256-2uk3NfpAODScoQtqiU+ZaOE8zOqkayn/jpfn3GQ4vQg=";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    propagatedBuildInputs = [ ppx_inline_test ];
+  };
+
+  ppx_bin_prot = janePackage {
+    pname = "ppx_bin_prot";
+    hash = "1280wsls061fmvmdysjqn3lv4mnkyg400jnjf4jyfr14s33h1ad5";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of bin_prot readers and writers from types";
+    propagatedBuildInputs = [ bin_prot ppx_here ];
+    doCheck = false; # circular dependency with ppx_jane
+  };
+
+  ppx_cold = janePackage {
+    pname = "ppx_cold";
+    hash = "0x7xgpvy0l28k971xy08ibhr4w9nh8d9zvxc6jfxxx4fbfcv5gca";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Expands [@cold] into [@inline never][@specialise never][@local never]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "1wjwqkr71p61vjidbr80l93y4kkad7xsfyp04w8qfqrj7h5nm625";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of comparison functions from types";
+    propagatedBuildInputs = [ ppxlib base ];
+  };
+
+  ppx_conv_func = janePackage {
+    pname = "ppx_conv_func";
+    hash = "sha256-61jX8yHZYOnMx1Jlqaq9zSOz25HLOa0Wv/iG6Hu82zI=";
+    meta.description = "Part of the Jane Street's PPX rewriters collection";
+    propagatedBuildInputs = [ ppxlib base ];
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    hash = "1k8nmq6kwqz2wpkm9ymq749dz1vd8lxrjc711knp1wyz5935hnsv";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+  };
+
+  ppx_css = janePackage {
+    pname = "ppx_css";
+    hash = "09dpmj3f3m3z1ji9hq775iqr3cfmv5gh7q9zlblizj4wx4y0ibyi";
+    meta.description = "A ppx that takes in css strings and produces a module for accessing the unique names defined within";
+    propagatedBuildInputs = [ core_kernel ppxlib js_of_ocaml js_of_ocaml-ppx sedlex ];
+  };
+
+  ppx_csv_conv = janePackage {
+    pname = "ppx_csv_conv";
+    hash = "sha256-ctwgUs1buBZiNqac4760LhWd2/PMZRuxx8SE5T7yZ+g=";
+    meta.description = "Generate functions to read/write records in csv format";
+    propagatedBuildInputs = [ csvfields ppx_conv_func ];
+  };
+
+  ppx_disable_unused_warnings = janePackage {
+    pname = "ppx_disable_unused_warnings";
+    hash = "0sb5i4v7p9df2bxk66rjs30k9fqdrwsq1jgykjv6wyrx2d9bv955";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Expands [@disable_unused_warnings] into [@warning \"-20-26-32-33-34-35-36-37-38-39-60-66-67\"]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_enumerate = janePackage {
+    pname = "ppx_enumerate";
+    hash = "1i0f6jv5cappw3idd70wpg76d7x6mvxapa89kri1bwz47hhg4pkz";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generate a list containing all values of a finite type";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    version = "0.15.1";
+    hash = "sha256-qlOipzTTdN9yQ35sItKmWpCv74kbuJLDg4IHNVTKvow=";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Cram like framework for OCaml";
+    propagatedBuildInputs = [ ppx_here ppx_inline_test re ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    hash = "094wsnw7fcwgl9xg6vkjb0wbgpn9scsp847yhdd184sz9v1amz14";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Generation of accessor and iteration functions for ocaml records";
+    propagatedBuildInputs = [ fieldslib ppxlib ];
+  };
+
+  ppx_fixed_literal = janePackage {
+    pname = "ppx_fixed_literal";
+    hash = "10siwcqrqa4gh0mg6fkaby0jjskc01r81pcblc67h3vmbjjh08j9";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Simpler notation for fixed point literals";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "15agkwavadllzxdv4syjna02083nfnap8qs4yqf5s0adjw73fzyg";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "0jv81k8x18q8rxdyfwavrvx8yq9k5m3abpmgdg6zipx2ajcjzvag";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Expands [%here] into its location";
+    propagatedBuildInputs = [ ppxlib ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_ignore_instrumentation = janePackage {
+    pname = "ppx_ignore_instrumentation";
+    hash = "16fgig88g3jr0m3i636fr52h29h1yzhi8nhnl4029zn808kcdyj2";
+    minimalOCamlVersion = "4.08";
+    meta.description = "Ignore Jane Street specific instrumentation extensions";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    version = "0.15.1";
+    hash = "sha256-9Up4/VK4gayuwbPc3r6gVRj78ILO2G3opL5UDOTKOgk=";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Syntax extension for writing in-line tests in ocaml code";
+    propagatedBuildInputs = [ ppxlib time_now ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "1p6847gdfnnj6qpa4yh57s6wwpsl7rfgy0q7993chz24h9mhz5lk";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Standard Jane Street ppx rewriters";
+    propagatedBuildInputs = [ base_quickcheck ppx_bin_prot ppx_disable_unused_warnings ppx_expect ppx_fixed_literal ppx_ignore_instrumentation ppx_log ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_stable ppx_string ppx_typerep_conv ppx_variants_conv ];
+  };
+
+  ppx_jsonaf_conv = janePackage {
+    pname = "ppx_jsonaf_conv";
+    version = "0.15.1";
+    hash = "0wprs7qmscklyskj4famhaqqisi6jypy414aqba14qdyi43w0cv3";
+    minimalOCamlVersion = "4.08";
+    meta.description =
+      "[@@deriving] plugin to generate Jsonaf conversion functions";
+    propagatedBuildInputs = [ base jsonaf ppx_jane ppxlib ];
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    hash = "0q2p9pvmlncgv0hprph95xiv7s6q44ynvp4yl4dckf1qx68rb3ba";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Code style checker for Jane Street Packages";
+    propagatedBuildInputs = [ octavius ppxlib ];
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "04v3fq0vnvvavxbc7hfsrg8732pwxbyw8pjl3xfplqdqci6fj15n";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Monadic let-bindings";
+    propagatedBuildInputs = [ ppxlib ppx_here ];
+  };
+
+  ppx_log = janePackage {
+    pname = "ppx_log";
+    hash = "08i9gz3f4w3bmlrfdw7ja9awsfkhhldz03bnnc4hijfmn8sawzi0";
+    minimalOCamlVersion = "4.08.0";
+    meta.description = "Ppx_sexp_message-like extension nodes for lazily rendering log messages";
+    propagatedBuildInputs = [ base ppx_here ppx_sexp_conv ppx_sexp_message sexplib ];
+  };
+
+  ppx_module_timer = janePackage {
+    pname = "ppx_module_timer";
+    hash = "0lzi5hxi10p89ddqbrc667267f888kqslal76gfhmszyk60n20av";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Ppx rewriter that records top-level module startup times";
+    propagatedBuildInputs = [ time_now ];
+  };
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    hash = "0ypivfipi8fcr9pqyvl2ajpcivmr1irdwwv248i4x6mggpc2pl0b";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Optional compilation for OCaml";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "0amxwxhkyzamgnxx400qhvxzqr3m4sazhhkc516lm007pynv7xq2";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Pattern matching on flat options";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_pattern_bind = janePackage {
+    pname = "ppx_pattern_bind";
+    hash = "01nfdk9yvk92r7sjl4ngxfsx8fyqh2dsjxz0i299nszv9jc4rn4f";
+    minimalOCamlVersion = "4.07";
+    meta.description = "A ppx for writing fast incremental bind nodes in a pattern match";
+    propagatedBuildInputs = [ ppx_let ];
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "0sm5dghyalhws3hy1cc2ih36az1k4q02hcgj6l26gwyma3y4irvq";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_python = janePackage {
+    pname = "ppx_python";
+    hash = "1d2wf0rkvxg07q6xq2zmxh6hmvnwlsmny3mm92jsg1s7bdl39gap";
+    meta.description = "A [@@deriving] plugin to generate Python conversion functions ";
+    propagatedBuildInputs = [ ppx_base ppxlib pyml ];
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    version = "0.15.1";
+    minimalOCamlVersion = "4.08.0";
+    hash = "sha256-NYknZHyDklr71hihM2pPFQ7uAKkuKO2DJkjtsF+xc5g=";
+    meta.description = "[@@deriving] plugin to generate S-expression conversion functions";
+    propagatedBuildInputs = [ ppxlib sexplib0 base ];
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    hash = "0a7hx50bkkc5n5msc3zzc4ixnp7674x3mallknb9j31jnd8l90nj";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "0kz83j9v6yz3v8c6vr9ilhkcci4hhjd6i6r6afnx72jh6i7d3hnv";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_stable = janePackage {
+    pname = "ppx_stable";
+    hash = "1as0v0x8c9ilyhngax55lvwyyi4a2wshyan668v0f2s1608cwb1l";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Stable types conversions generator";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_string = janePackage {
+    pname = "ppx_string";
+    minimalOCamlVersion = "4.04.2";
+    hash = "1dp5frk6cig5m3m5rrh2alw63snyf845x7zlkkaljip02pqcbw1s";
+    meta.description = "Ppx extension for string interpolation";
+    propagatedBuildInputs = [ ppx_base ppxlib stdio ];
+  };
+
+  ppx_typed_fields = janePackage {
+    pname = "ppx_typed_fields";
+    hash = "0hxililjgy4jh66b4xmphrfhv6qpp7dz7xbz3islp357hf18niqy";
+    meta.description = "GADT-based field accessors and utilities";
+    propagatedBuildInputs = [ core ppx_jane ppxlib ];
+  };
+
+  ppx_typerep_conv = janePackage {
+    pname = "ppx_typerep_conv";
+    minimalOCamlVersion = "4.04.2";
+    hash = "1q1lzykpm83ra4l5jh4rfddhd3c96kx4s4rvx0w4b51z1qk56zam";
+    meta.description = "Generation of runtime types from type declarations";
+    propagatedBuildInputs = [ ppxlib typerep ];
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    minimalOCamlVersion = "4.04.2";
+    hash = "1dh0bw9dn246k00pymf59yjkl6x6bxd76lkk9b5xpq2692wwlc3s";
+    meta.description = "Generation of accessor and iteration functions for ocaml variant types";
+    propagatedBuildInputs = [ variantslib ppxlib ];
+  };
+
+  profunctor = janePackage {
+    pname = "profunctor";
+    hash = "151vk0cagjwn0isnnwryn6gmvnpds4dyj1in9jvv5is8yij203gg";
+    meta.description = "A library providing a signature for simple profunctors and traversal of a record";
+    propagatedBuildInputs = [ base ppx_jane record_builder ];
+  };
+
+  protocol_version_header = janePackage {
+    pname = "protocol_version_header";
+    hash = "0s638cwf1357gg754rc4306654hhrhzqaqm2lp3yv5vj3ml8p4qy";
+    meta.description = "Protocol versioning";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  pythonlib = janePackage {
+    pname = "pythonlib";
+    version = "0.15.1";
+    hash = "sha256-j8WXVTEiBmHtoTjkbnIh31vC4IghfAMaEL19nDLx3mc=";
+    meta.description = "A library to help writing wrappers around ocaml code for python";
+    buildInputs = [ ppx_optcomp ];
+    propagatedBuildInputs = [ ppx_expect ppx_let ppx_python stdio typerep ];
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "0z1cajd8abrryf3gz322jpynba79nv4a2kmmcdz0314ran5w68v3";
+    meta.description = "OCaml bindings for RE2, Google's regular expression library";
+    propagatedBuildInputs = [ core_kernel ];
+    prePatch = ''
+      substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++'
+      substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))'
+    '';
+  };
+
+  re2_stable = janePackage {
+    pname = "re2_stable";
+    version = "0.14.0";
+    hash = "0kjc0ff6b3509s3b9n4q8ilb06d5fngdh3z58cm95vg7zkcas9w3";
+    meta.description = "Re2_stable adds an incomplete but stable serialization of Re2";
+    propagatedBuildInputs = [ core re2 ];
+  };
+
+  record_builder = janePackage {
+    pname = "record_builder";
+    hash = "004nqcmwll0vy47mb3d3jlk21cc6adcjy62dkv2k966n9jkh472h";
+    meta.description = "A library which provides traversal of records with an applicative";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  redis-async = janePackage {
+    pname = "redis-async";
+    hash = "0pccf4gkm880yyk8x4kgy5rwblkbscxav2sbis13abpms9vr7jfn";
+    meta.description = "Redis client for Async applications";
+    propagatedBuildInputs = [ async bignum core core_kernel ppx_jane ];
+  };
+
+  resource_cache = janePackage {
+    pname = "resource_cache";
+    hash = "13wzx8ixgbb7jj5yrps890irw2wvkchnihsn7rfrcvnvrjzzjshm";
+    meta.description = "General resource cache";
+    propagatedBuildInputs = [ async_rpc_kernel ];
+  };
+
+  sexp = janePackage {
+    pname = "sexp";
+    hash = "00xlsymm1mpgs8cqkb6c36vh5hfw0saghvwiqh7jry65qc5nvv9z";
+    propagatedBuildInputs = [
+      async
+      core
+      csvfields
+      jsonaf
+      re2
+      sexp_diff
+      sexp_macro
+      sexp_pretty
+      sexp_select
+    ];
+    meta.description = "S-expression swiss knife";
+  };
+
+  sexp_diff = janePackage {
+    pname = "sexp_diff";
+    hash = "1p5xwhj634ij4a0m5k6a3abddi5315y7is1a6ha1lifdz3v985ll";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Code for computing the diff of two sexps";
+  };
+
+  sexp_macro = janePackage {
+    pname = "sexp_macro";
+    hash = "1l5dsv9gawmf5dg3rf8sxphp9qs3n4n038nlmf9rxzypzyn112k8";
+    propagatedBuildInputs = [ async sexplib ];
+    meta.description = "Sexp macros";
+  };
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    version = "0.15.1";
+    hash = "sha256-UJEO2P4C7ZaD110MEfkG4FXfGDVAAW2TAK489faV6SM=";
+    minimalOCamlVersion = "4.07";
+    meta.description = "S-expression pretty-printer";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+  };
+
+  sexp_select = janePackage {
+    pname = "sexp_select";
+    hash = "0mmvga9w3gbb2gd1h4l8f1c3l2lrpn1zld2a8xgqyfqfff3vg31p";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ base ppx_jane ];
+    meta.description = "A library to use CSS-style selectors to traverse sexp trees";
+  };
+
+  sexplib0 = janePackage {
+    pname = "sexplib0";
+    version = "0.15.1";
+    hash = "sha256-6K0yrCbVFcUalN4cQuDI1TvWvNDjfXXRDhJKUskbqRY=";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    version = "0.15.1";
+    hash = "sha256-LkGNnp717LMHeWe1Ka6qUZcpw8fKSsd5MusaLgFjm70=";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Library for serializing OCaml values to and from S-expressions";
+    propagatedBuildInputs = [ num parsexp ];
+  };
+
+  shell = janePackage {
+    pname = "shell";
+    hash = "1vzdif7w9y1kw2qynlfixwphdgiflrf43j0fzinjp9f56vlhghhy";
+    meta.description = "Yet another implementation of fork&exec and related functionality";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ textutils ];
+    checkInputs = [ ounit ];
+  };
+
+  shexp = janePackage {
+    pname = "shexp";
+    hash = "05iswnhi92f4yvrh76j3254bvls6fbrdb56mv6vc6mi5f8z4l79i";
+    minimalOCamlVersion = "4.07";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    minimalOCamlVersion = "4.02.3";
+    hash = "1fjr91psas5zmk1hxvxh0dchhn0pkyzlr4gg232f5g9vdgissi0p";
+    meta.description = "Spawning sub-processes";
+    buildInputs = [ ppx_expect ];
+  };
+
+  splay_tree = janePackage {
+    pname = "splay_tree";
+    hash = "1jxfh7f2hjrms5pm2cy1cf6ivphgiqqvyyr9hdcz8d3vi612p4dm";
+    meta.description = "A splay tree implementation";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  splittable_random = janePackage {
+    pname = "splittable_random";
+    hash = "0ap5z4z1aagz4z02q9642cbl25jzws9lbc2x5xkpyjlc0qcm9v3m";
+    meta.description = "PRNG that can be split into independent streams";
+    propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ];
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    hash = "0g00b00kpjcadikq2asng35w7kvd24q9ldkiylwmn3gv3lrbipa8";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Standard IO library for OCaml";
+    propagatedBuildInputs = [ base ];
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "1wass49h645wql9b7nck2iqlkf4648dkxvlvxixr7z80zcnb5rxr";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core_unix textutils_kernel ];
+  };
+
+  textutils_kernel = janePackage {
+    pname = "textutils_kernel";
+    hash = "068g11d98wsb5a6ds0p5xybdmx5nx9bxa0k11dmh3l57kn4c169x";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core ppx_jane uutf ];
+  };
+
+  time_now = janePackage {
+    pname = "time_now";
+    hash = "1pa0hyh470j9jylii4983qagb6hq2dz6s0q2fnrcph9qbw83bc0c";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Reports the current time";
+    buildInputs = [ jst-config ppx_optcomp ];
+    propagatedBuildInputs = [ jane-street-headers base ppx_base ];
+  };
+
+  timezone = janePackage {
+    pname = "timezone";
+    hash = "00a007aji5rbz42kgbq1w90py6fm9k9akycs5abkcfll5rd0cbhx";
+    meta.description = "Time-zone handling";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  topological_sort = janePackage {
+    pname = "topological_sort";
+    hash = "0iqhp8n6g5n1ng80brjpav54229lykm2c1fc104s58lk3rqfvj9v";
+    meta.description = "Topological sort algorithm";
+    propagatedBuildInputs = [ ppx_jane stdio ];
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "1qxfi01qim0hrgd6d0bgvpxg36i99mmm8cw4wqpr9kxyqvgzv26z";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Typerep is a library for runtime types";
+    propagatedBuildInputs = [ base ];
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "033ns8ph6bd8g5cdfryjfcnrnzkdshppjyw5kl7cvszjfrz33ij7";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Part of Jane Street's Core library";
+    propagatedBuildInputs = [ base ];
+  };
+
+  vcaml = janePackage {
+    pname = "vcaml";
+    hash = "12fd29x9dgf4f14xrx7z4y1bm1wbfynrs3jismjbiqnckfpbqrib";
+    meta.description = "OCaml bindings for the Neovim API";
+    propagatedBuildInputs = [ angstrom-async async_extra expect_test_helpers_async faraday ];
+  };
+
+  virtual_dom = janePackage {
+    pname = "virtual_dom";
+    version = "0.15.1";
+    hash = "sha256-Uv6ZDxz2/H0nHjiycUKNQwy/zZyHHmwDEHknFHwDuDs=";
+    meta.description = "OCaml bindings for the virtual-dom library";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ core_kernel gen_js_api js_of_ocaml lambdasoup tyxml ];
+  };
+
+  zarith_stubs_js = janePackage {
+    pname = "zarith_stubs_js";
+    hash = "119xgr3kla9q1bvs4a5z2ivbmsrz4db3a9z0gf77ryqg4i22ywvl";
+    minimalOCamlVersion = "4.04.2";
+    meta.description = "Javascripts stubs for the Zarith library";
+  };
+
+  zstandard = janePackage {
+    pname = "zstandard";
+    hash = "1blkv35g5q1drkc6zmc4m027gjz6vfdadra1kw1xkp1wlc2l4v3k";
+    meta.description = "OCaml bindings to Zstandard";
+    buildInputs = [ ppx_jane ];
+    propagatedBuildInputs = [ core_kernel ctypes zstd ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.16.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.16.nix
new file mode 100644
index 000000000000..59cd7539d1f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.16.nix
@@ -0,0 +1,1267 @@
+{ self
+, bash
+, fetchpatch
+, fzf
+, lib
+, openssl
+, zstd
+, krb5
+}:
+
+with self;
+
+{
+
+  abstract_algebra = janePackage {
+    pname = "abstract_algebra";
+    hash = "sha256-hAZzc2ypbGE/8mxxk4GZqr17JlIYv71gZJMQ4plsK38=";
+    meta.description = "A small library describing abstract algebra concepts";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  accessor = janePackage {
+    pname = "accessor";
+    hash = "sha256-yClfUXqwVoipF4WqbqC6VBVYc6t8MZYVoHGjchH7XQA=";
+    meta.description = "A library that makes it nicer to work with nested functional data structures";
+    propagatedBuildInputs = [ higher_kinded ];
+  };
+
+  accessor_async = janePackage {
+    pname = "accessor_async";
+    hash = "sha256-kGT7aFNOgU8/2ez9L/lefb2LN7I87+WthZHnb+dY9PE=";
+    meta.description = "Accessors for Async types, for use with the Accessor library";
+    propagatedBuildInputs = [ accessor_core async_kernel ];
+  };
+
+  accessor_base = janePackage {
+    pname = "accessor_base";
+    hash = "sha256-idnSNP6kfoV3I8QAMJ2YoUrewBpyte+0/C371aMTIxo=";
+    meta.description = "Accessors for Base types, for use with the Accessor library";
+    propagatedBuildInputs = [ ppx_accessor ];
+  };
+
+  accessor_core = janePackage {
+    pname = "accessor_core";
+    hash = "sha256-f4s/I+xDi/aca1WgaE+P3CD4e80jenS0WHg4T1Stcbg=";
+    meta.description = "Accessors for Core types, for use with the Accessor library";
+    propagatedBuildInputs = [ accessor_base core_kernel ];
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "sha256-TpsC9sn8noiNI0aYbMalUUv3xlC2LMERsv6Gr928Vzc=";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix textutils ];
+    doCheck = false; # we don't have netkit_sockets
+  };
+
+  async_durable = janePackage {
+    pname = "async_durable";
+    hash = "sha256-PImYpM9xNFUWeWRld4jFwWBRowUP1iXzdxkK/fP/rHE=";
+    meta.description = "Durable connections for use with async";
+    propagatedBuildInputs = [ async_kernel async_rpc_kernel core core_kernel ppx_jane ];
+  };
+
+  async_extra = janePackage {
+    pname = "async_extra";
+    hash = "sha256-Y+gTlJuKmwvEEPuMPu7v0iYeNQtlzP8QiS0PSgoYrrI=";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel ];
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "sha256-PG6BJx9tfP+zcDaG+7WdHiv4jUqsUH2TvHV6UXdzPAg=";
+    meta.description = "Directory traversal with Async";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_inotify = janePackage {
+    pname = "async_inotify";
+    hash = "sha256-seFbs06w3T+B49sw3nOjpXpoJbJ+IJ3qN5LnufrsE48=";
+    meta.description = "Async wrapper for inotify";
+    propagatedBuildInputs = [ async_find inotify ];
+  };
+
+  async_interactive = janePackage {
+    pname = "async_interactive";
+    hash = "sha256-xZKVT8L2rOLBeg7wK0tD6twhkDfwQp5ZKy4DPp1UWq8=";
+    meta.description = "Utilities for building simple command-line based user interfaces";
+    propagatedBuildInputs = [ async ];
+  };
+
+  async_js = janePackage {
+    pname = "async_js";
+    hash = "sha256-JyF1busOv9JWxp55oaxBozIQyCKlmAY3csBA4/98qy0=";
+    meta.description = "A small library that provide Async support for JavaScript platforms";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_rpc_kernel js_of_ocaml uri-sexp ];
+  };
+
+  async_kernel = janePackage {
+    pname = "async_kernel";
+    hash = "sha256-EDgdZc6GRyiiFtnElNE9jGPEjPIUniP9uB/JoySkZz8=";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "sha256-OccFMfhTRSQwx1LJcN8OkDpA62KabsyWn2hox84jqow=";
+    meta.description = "Platform-independent core of Async RPC library";
+    propagatedBuildInputs = [ async_kernel protocol_version_header ];
+  };
+
+  async_rpc_websocket = janePackage {
+    pname = "async_rpc_websocket";
+    hash = "sha256-S3xIw/mew9YhtenWfp8ZD82WtOQSzJHtreT1+kRivus=";
+    meta.description = "Library to serve and dispatch Async RPCs over websockets";
+    propagatedBuildInputs = [ async_rpc_kernel async_websocket cohttp_async_websocket ];
+  };
+
+  async_sendfile = janePackage {
+    pname = "async_sendfile";
+    hash = "sha256-ykl87/De56gz6JRQfTIeWrU823PT2fnFJr08GxuDYic=";
+    meta.description = "Thin wrapper around [Linux_ext.sendfile] to send full files";
+    propagatedBuildInputs = [ async_unix ];
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "sha256-DjIbadCjPymnkDsnonmxKumCWf5P9XO3ZaAwOaYRnbk=";
+    meta.description = "Shell helpers for Async";
+    propagatedBuildInputs = [ async shell ];
+  };
+
+  async_smtp = janePackage {
+    pname = "async_smtp";
+    hash = "sha256-X0eegZMMU9EnC9Oi+6DjtwNmyzQYr3EKi1duNzEAfkk=";
+    meta.description = "SMTP client and server";
+    propagatedBuildInputs = [ async_extra async_inotify async_sendfile async_shell async_ssl email_message resource_cache re2_stable sexp_macro ];
+  };
+
+  async_ssl = janePackage {
+    version = "0.16.1";
+    pname = "async_ssl";
+    hash = "sha256-83YKxvVb/JwBnQG4R/R1Ztik9T/hO4cbiNTfFnErpG4=";
+    meta.description = "Async wrappers for SSL";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ async ctypes ctypes-foreign openssl ];
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "sha256-dT+yJC73sxS4NPR/GC/FyVLbWtYpM9DqKykVk8PEEWU=";
+    meta.description = "Monadic concurrency library";
+    propagatedBuildInputs = [ async_kernel core_unix ];
+  };
+
+  async_websocket = janePackage {
+    pname = "async_websocket";
+    hash = "sha256-Qy+A8ee6u5Vr05FNeaH/6Sdp9bcq3cnaDYO9OU06VW0=";
+    meta.description = "A library that implements the websocket protocol on top of Async";
+    propagatedBuildInputs = [ async cryptokit ];
+  };
+
+  babel = janePackage {
+    pname = "babel";
+    hash = "sha256-nnMliU0d6vtHTYEy9uMi8nMaHvAsEXKN6uNByqZ28+c=";
+    meta.description = "A library for defining Rpcs that can evolve over time without breaking backward compatibility";
+    propagatedBuildInputs = [ async_rpc_kernel core ppx_jane streamable tilde_f ];
+  };
+
+  base = janePackage {
+    pname = "base";
+    version = "0.16.2";
+    hash = "sha256-8OvZe+aiWipJ6busBufx3OqERmqxBva55UOLjL8KoPc=";
+    meta.description = "Full standard library replacement for OCaml";
+    buildInputs = [ dune-configurator ];
+    propagatedBuildInputs = [ sexplib0 ];
+    checkInputs = [ alcotest ];
+  };
+
+  base_bigstring = janePackage {
+    pname = "base_bigstring";
+    hash = "sha256-gQbzdr05DEowzd0k9JBTF0gGMwlaVwTVJuoKZ0u9voU=";
+    meta.description = "String type based on [Bigarray], for use in I/O and C-bindings";
+    propagatedBuildInputs = [ int_repr ppx_jane ];
+  };
+
+  base_trie = janePackage {
+    pname = "base_trie";
+    hash = "sha256-KV/k3B0h/4rE+MY6f4qDnlaObMmewUS+NAN2M7sb+yw=";
+    meta.description = "Trie data structure library";
+    propagatedBuildInputs = [ base core expect_test_helpers_core ppx_jane ];
+  };
+
+  base_quickcheck = janePackage {
+    pname = "base_quickcheck";
+    hash = "sha256-9Flg8vAoT6f+3lw9wETQhsaA1fSsQiqKeEhzo0qtDu4=";
+    meta.description = "Randomized testing framework, designed for compatibility with Base";
+    propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let ppx_sexp_value splittable_random ];
+  };
+
+  bidirectional_map = janePackage {
+    pname = "bidirectional_map";
+    hash = "sha256-YEzOdzanBJaskI2/xN9E3ozWnBXDyxJvY3g/qEE73yI=";
+    meta.description = "A library for bidirectional maps and multimaps";
+  };
+
+  bignum = janePackage {
+    pname = "bignum";
+    hash = "sha256-PmvqGImF1Nrr6swx5q3+9mCfSbieC3RvWuz8oCTkSgg=";
+    propagatedBuildInputs = [ core_kernel zarith zarith_stubs_js ];
+    meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals";
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    hash = "sha256-qFkM6TrTLnnFKmzQHktBb68HpBTMYhiURvnRKEoAevk=";
+    meta.description = "A binary protocol generator";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_optcomp ppx_stable_witness ppx_variants_conv ];
+  };
+
+  bonsai = janePackage {
+    pname = "bonsai";
+    hash = "sha256-YJ+qkVG5PLBmioa1gP7y6jwn82smyyYDIwHwhDqNeWM=";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ ppx_pattern_bind ];
+    nativeBuildInputs = [ ppx_css js_of_ocaml-compiler ocaml-embed-file ];
+    propagatedBuildInputs = [
+      async
+      async_durable
+      async_extra
+      async_rpc_websocket
+      babel
+      cohttp-async
+      core_bench
+      fuzzy_match
+      incr_dom
+      indentation_buffer
+      js_of_ocaml-ppx
+      ordinal_abbreviation
+      patdiff
+      polling_state_rpc
+      ppx_css
+      ppx_typed_fields
+      profunctor
+      sexp_grammar
+      textutils
+    ];
+  };
+
+  cinaps = janePackage {
+    pname = "cinaps";
+    version = "0.15.1";
+    hash = "sha256-LycruanldSP251uYJjQqIfI76W0UQ6o5i5u8XjszBT0=";
+    meta.description = "Trivial metaprogramming tool";
+    minimalOCamlVersion = "4.04";
+    propagatedBuildInputs = [ re ];
+    doCheck = false; # fails because ppx_base doesn't include ppx_js_style
+  };
+
+  cohttp_async_websocket = janePackage {
+    pname = "cohttp_async_websocket";
+    hash = "sha256-OBtyKMyvfz0KNG4SWmvoTMVPnVTpO12N38q+kEbegJE=";
+    meta.description = "Websocket library for use with cohttp and async";
+    propagatedBuildInputs = [ async_websocket cohttp-async ppx_jane uri-sexp ];
+  };
+
+  cohttp_static_handler = janePackage {
+    pname = "cohttp_static_handler";
+    hash = "sha256-7NCnJVArudBEvWARQUGlJuEq3kSCjpn5YtsLsL04bf4=";
+    meta.description = "A library for easily creating a cohttp handler for static files";
+    propagatedBuildInputs = [ cohttp-async ];
+  };
+
+  content_security_policy = janePackage {
+    pname = "content_security_policy";
+    hash = "sha256-q/J+ZzeC6txyuRQzR8Hmu7cYJCQbxaMlVEmK8fj0hus=";
+    meta.description = "A library for building content-security policies";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  core = janePackage {
+    pname = "core";
+    version = "0.16.2";
+    hash = "sha256-cyOU++XJJkU2YMHfn8saFOxLoQSFhF7kARJi/9unbFQ=";
+    meta.description = "Industrial strength alternative to OCaml's standard library";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base base_bigstring base_quickcheck ppx_jane time_now ];
+    doCheck = false; # circular dependency with core_kernel
+  };
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "sha256-ASdu3ZUk+nkdNX9UbBQxKRdXBa073mWMDRW+Ceu3/t4=";
+    meta.description = "Benchmarking library";
+    propagatedBuildInputs = [ textutils ];
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "sha256-hcjmFDdVKCHK8u6D4Qn2a/HYTEZOvkXHcB6BTpbjF/s=";
+    meta.description = "Extra components that are not as closely vetted or as stable as Core";
+    propagatedBuildInputs = [ core_unix record_builder ];
+  };
+
+  core_kernel = janePackage {
+    pname = "core_kernel";
+    hash = "sha256-YB3WMNLePrOKu+mmVedNo0pWN9x5fIaBxJsby56TFJU=";
+    meta.description = "System-independent part of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ base_bigstring core int_repr sexplib ];
+    doCheck = false; # we don't have quickcheck_deprecated
+  };
+
+  core_unix = janePackage {
+    pname = "core_unix";
+    hash = "sha256-mePpxjbUumMemHDKhRgACilchgS6QHZEV1ghYtT3flg=";
+    meta.description = "Unix-specific portions of Core";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ core_kernel expect_test_helpers_core ocaml_intrinsics ppx_jane timezone spawn ];
+    postPatch = ''
+      patchShebangs unix_pseudo_terminal/src/discover.sh
+    '';
+  };
+
+  csvfields = janePackage {
+    pname = "csvfields";
+    hash = "sha256-FEkjRmLeqNvauBlrY2xtLZfxVfnFWU8w8noEArPUieo=";
+    propagatedBuildInputs = [ core num ];
+    meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv";
+  };
+
+  dedent = janePackage {
+    pname = "dedent";
+    hash = "sha256-fzytLr3tVr2vPmykUBzNFMxnyMcIeeo8S9BydsTKnQw=";
+    propagatedBuildInputs = [ base ppx_jane stdio ];
+    meta.description = "A library for improving redability of multi-line string constants in code";
+  };
+
+  delimited_parsing = janePackage {
+    pname = "delimited_parsing";
+    hash = "sha256-XyO3hzPz48i1cnMTJvZfarM6HC7qdHqdftp9SnCjPEU=";
+    propagatedBuildInputs = [ async core_extended ];
+    meta.description = "Parsing of character (e.g., comma) separated and fixed-width values";
+  };
+
+  diffable = janePackage {
+    pname = "diffable";
+    hash = "sha256-ascQUbxzvRR8XrroaupyFZ2YNQMvlXn4PemumYTwRF4=";
+    propagatedBuildInputs = [ core ppx_jane stored_reversed streamable ];
+    meta.description = "An interface for diffs";
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "sha256-VS7eTTD85ci3mJIXd2pG1Y/ygT9dCIvfzU2HtOufW6U=";
+    meta.description = "Library for writing Emacs plugin in OCaml";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  email_message = janePackage {
+    pname = "email_message";
+    hash = "sha256-eso68owbAspjaVgj/wGFQ7VQYlAwyYV3oNitLQWiRPA=";
+    meta.description = "E-mail message parser";
+    propagatedBuildInputs = [ angstrom async base64 cryptokit magic-mime re2 ];
+  };
+
+  env_config = janePackage {
+    pname = "env_config";
+    hash = "sha256-CvvpKI7F40DVC7iByrzCqW1ilPiIhdDPYaJrDoUZVSs=";
+    meta.description = "Helper library for retrieving configuration from an environment variable";
+    propagatedBuildInputs = [ async core core_unix ppx_jane ];
+  };
+
+  expect_test_helpers_async = janePackage {
+    pname = "expect_test_helpers_async";
+    hash = "sha256-dEvOMb1aCEt05XtkKIC9jWoIQ/2zM0Gj+K/ZN3bFjeI=";
+    meta.description = "Async helpers for writing expectation tests";
+    propagatedBuildInputs = [ async expect_test_helpers_core ];
+  };
+
+  expect_test_helpers_core = janePackage {
+    pname = "expect_test_helpers_core";
+    hash = "sha256-8DsMwk9WhQQ7iMNYSFBglfbcgvE5dySt4J4qjzJ3dJk=";
+    meta.description = "Helpers for writing expectation tests";
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+  };
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "sha256-dwkO65sBsPfTF0F2FKrnttEjhAY2OMbJetSgOfUXk3A=";
+    meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values";
+    propagatedBuildInputs = [ base ];
+  };
+
+  file_path = janePackage {
+    pname = "file_path";
+    hash = "sha256-EEpDZNgUgyeqivRhZgQWWlerl+7OOcvAbjjQ3e1NYOQ=";
+    meta.description =
+      "A library for typed manipulation of UNIX-style file paths";
+    propagatedBuildInputs = [
+      async
+      core
+      core_kernel
+      core_unix
+      expect_test_helpers_async
+      expect_test_helpers_core
+      ppx_jane
+    ];
+  };
+
+  fuzzy_match = janePackage {
+    pname = "fuzzy_match";
+    hash = "sha256-M3yOqP0/OZFbqZZpgDdhJ/FZU3MhKwIXbWjwuMlxe2Q=";
+    meta.description = "A library for fuzzy string matching";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  fzf = janePackage {
+    pname = "fzf";
+    hash = "sha256-IQ2wze34LlOutecDOrPhj3U7MFVJTSjQW+If3QyHoes=";
+    meta.description = "A library for running the fzf command line tool";
+    propagatedBuildInputs = [ async core_kernel ppx_jane ];
+    postPatch = ''
+      substituteInPlace src/fzf.ml --replace /usr/bin/fzf ${fzf}/bin/fzf
+    '';
+  };
+
+  hex_encode = janePackage {
+    pname = "hex_encode";
+    hash = "sha256-jnsf5T1D1++AUdrato/NO3gTVXu14klXozHFIG9HH/o=";
+    meta.description = "Hexadecimal encoding library";
+    propagatedBuildInputs = [ core ppx_jane ounit ];
+  };
+
+  higher_kinded = janePackage {
+    pname = "higher_kinded";
+    hash = "sha256-aCpYc7f4mrPsGp038YabEyw72cA6GbCKsok+5Hej5P0=";
+    meta.description = "A library with an encoding of higher kinded types in OCaml";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  incr_dom = janePackage {
+    pname = "incr_dom";
+    hash = "sha256-fnD/YnaGK6MIy/fL6bDwcoGDJhHo2+1l8dCXxwN28kg=";
+    meta.description = "A library for building dynamic webapps, using Js_of_ocaml";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ async_js incr_map incr_select virtual_dom ];
+  };
+
+  incr_map = janePackage {
+    pname = "incr_map";
+    hash = "sha256-D3ZD0C4YfZOfXw+3CtqL8DKcz+b06UL8AF7Rf9x+hps=";
+    meta.description = "Helpers for incremental operations on map like data structures";
+    buildInputs = [ ppx_pattern_bind ];
+    propagatedBuildInputs = [ abstract_algebra bignum diffable incremental streamable ];
+  };
+
+  incr_select = janePackage {
+    pname = "incr_select";
+    hash = "sha256-gRUF0QsDaZfHU7Mexl5nR8xCN+65v28/r/ciueR5NdE=";
+    meta.description = "Handling of large set of incremental outputs from a single input";
+    propagatedBuildInputs = [ incremental ];
+  };
+
+  incremental = janePackage {
+    pname = "incremental";
+    hash = "sha256-PXGY0M2xeVWDLeS3SrqXy1dqsyeKgndGT6NpuiyNQQQ=";
+    meta.description = "Library for incremental computations";
+    propagatedBuildInputs = [ core_kernel lru_cache ];
+  };
+
+  indentation_buffer = janePackage {
+    pname = "indentation_buffer";
+    hash = "sha256-5ayWs7yUnuxh5S3Dp0GbYTkGXttDMomfZak4MHePFbk=";
+    meta.description = "A library for building strings with indentation";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  int_repr = janePackage {
+    pname = "int_repr";
+    hash = "sha256-lghu2U1JwZaR4dkd9PcJEW3pZSPoaFhUluIDwFAYFK0=";
+    meta.description = "Integers of various widths";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  janestreet_cpuid = janePackage {
+    pname = "janestreet_cpuid";
+    hash = "sha256-lN8+8uhcVn3AoApWzqeCe/It1G6f0VgZzFcwFEckejk=";
+    meta.description = "A library for parsing CPU capabilities out of the `cpuid` instruction";
+    propagatedBuildInputs = [ core core_kernel ppx_jane ];
+  };
+
+  janestreet_csv = janePackage {
+    pname = "janestreet_csv";
+    hash = "sha256-XLyHxVlgBvMIBrG2wzOudbKqy+N12Boheb3K+6o9y1o=";
+    propagatedBuildInputs = [ async bignum core_kernel core_unix csvfields delimited_parsing fieldslib numeric_string ppx_jane re2 textutils tyxml ocaml_pcre ];
+    meta.description = "Tools for working with CSVs on the command line";
+  };
+
+  jane_rope = janePackage {
+    pname = "jane_rope";
+    hash = "sha256-MpjbwV+VS3qRuW8kxhjGzsITEdrPeWyr0V+LiKR6U8U=";
+    meta.description = "String representation with cheap concatenation";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "sha256-vS6tPg8LJolte/zI5KHFYCtNuZjn//cmd94Wls3bLCU=";
+    meta.description = "Jane Street C header files";
+  };
+
+  js_of_ocaml_patches = janePackage {
+    pname = "js_of_ocaml_patches";
+    hash = "sha256-Uj+X/0XUP5Za8NKfHGo9OZnqzKCiuurYJyluD6b0wOQ=";
+    meta.description = "Additions to js_of_ocaml's standard library that are required by Jane Street libraries";
+    propagatedBuildInputs = [ js_of_ocaml js_of_ocaml-ppx ];
+  };
+
+  jsonaf = janePackage {
+    pname = "jsonaf";
+    hash = "sha256-Gn54NUg4YOyrXY5kXCZhHFz24CfUT9c55cJ2sOsNVw8=";
+    meta.description = "A library for parsing, manipulating, and serializing data structured as JSON";
+    propagatedBuildInputs = [ base ppx_jane angstrom faraday ];
+  };
+
+  jst-config = janePackage {
+    pname = "jst-config";
+    hash = "sha256-GviY+zYza7UNYOlAnfAz0aH4LH2B5xA+7iELLuZLgQQ=";
+    meta.description = "Compile-time configuration for Jane Street libraries";
+    buildInputs = [ dune-configurator ppx_assert stdio ];
+  };
+
+  krb = janePackage {
+    pname = "krb";
+    hash = "sha256-+XwYKwpl668fZ23YEbL1wW9PlaIIjbP/hHwNanf3dAY=";
+    meta.description = "A library for using Kerberos for both Rpc and Tcp communication";
+    propagatedBuildInputs = [ async base core env_config hex_encode ppx_jane protocol_version_header username_kernel dune-configurator krb5 ];
+  };
+
+  lru_cache = janePackage {
+    pname = "lru_cache";
+    hash = "sha256-FqOBC4kBL9IuFIL4JrVU7iF1AUu+1R/CchR52eyEsa8=";
+    meta.description = "An LRU Cache implementation";
+    propagatedBuildInputs = [ core_kernel ppx_jane ];
+  };
+
+  man_in_the_middle_debugger = janePackage {
+    pname = "man_in_the_middle_debugger";
+    hash = "sha256-b2A/ITf9gx3thSdEY2n7jxKrMOVDpzx4JkSMB3aTyE4=";
+    meta.description = "Man-in-the-middle debugging library";
+    propagatedBuildInputs = [ async core ppx_jane angstrom angstrom-async ];
+  };
+
+  n_ary = janePackage {
+    pname = "n_ary";
+    hash = "sha256-ofstQs5R25NTP4EtBIzDE/Mzg9ZzAJKfAF838uu0zuE=";
+    meta.description = "A library for N-ary datatypes and operations";
+    propagatedBuildInputs = [ base expect_test_helpers_core ppx_compare ppx_enumerate ppx_hash ppx_jane ppx_sexp_conv ppx_sexp_message ];
+  };
+
+  numeric_string = janePackage {
+    pname = "numeric_string";
+    hash = "sha256-MzRPXMR4Pi07mfJQgOV6R1Z22y2tvQTCq22+00aY1ik=";
+    meta.description = "A comparison function for strings that sorts numeric fragments of strings according to their numeric value";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  ocaml-compiler-libs = janePackage ({
+    pname = "ocaml-compiler-libs";
+    minimalOCamlVersion = "4.04.1";
+    meta.description = "OCaml compiler libraries repackaged";
+  } // (if lib.versionAtLeast ocaml.version "5.2" then {
+    version = "0.17.0";
+    hash = "sha256-QaC6BWrpFblra6X1+TrlK+J3vZxLvLJZ2b0427DiQzM=";
+  } else {
+    version = "0.12.4";
+    hash = "00if2f7j9d8igdkj4rck3p74y17j6b233l91mq02drzrxj199qjv";
+  }));
+
+  ocaml-embed-file = janePackage {
+    pname = "ocaml-embed-file";
+    hash = "sha256-rs+68VATumUgZQ9QrG+By5yNc8cy7avL0BDeqwix0co=";
+    propagatedBuildInputs = [ async ppx_jane ];
+    meta.description = "Files contents as module constants";
+  };
+
+  ocaml_intrinsics = janePackage {
+    pname = "ocaml_intrinsics";
+    hash = "sha256-fbFXTakzxQEeCONSXRXh8FX3HD6h49LZHVsH62Zu3PA=";
+    meta.description = "Intrinsics";
+    buildInputs = [ dune-configurator ];
+    doCheck = false; # test rules broken
+  };
+
+  of_json = janePackage {
+    pname = "of_json";
+    hash = "sha256-qh9mX03Fk9Jb8yox7mZ/CGbWecszK15oaygKbJVDqa0=";
+    meta.description = "A friendly applicative interface for Jsonaf";
+    buildInputs = [ core core_extended jsonaf ppx_jane ];
+  };
+
+  ordinal_abbreviation = janePackage {
+    pname = "ordinal_abbreviation";
+    hash = "sha256-bGlzFcM6Yw8fcuovrv11WNtAB4mVYv4BjuMlkhsHomQ=";
+    meta.description = "A minimal library for generating ordinal names of integers";
+    buildInputs = [ base ppx_jane ];
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    hash = "sha256-oc2ASDtUyRBB68tjAoblryAcXF+u3XP1mkQPO5hNbKo=";
+    meta.description = "S-expression parsing library";
+    propagatedBuildInputs = [ base sexplib0 ];
+  };
+
+  patdiff = janePackage {
+    pname = "patdiff";
+    hash = "sha256-iVRYKgVBBJws3ZlUwnZt52bIydMtzV7a2R5mjksQAps=";
+
+    # Used by patdiff-git-wrapper.  Providing it here also causes the shebang
+    # line to be automatically patched.
+    buildInputs = [ bash ];
+    propagatedBuildInputs = [ core_unix patience_diff ocaml_pcre ];
+    meta = {
+      description = "File Diff using the Patience Diff algorithm";
+    };
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "sha256-JZd99bwLUNhFHng55d77yXSw9u50ahugepesXVdUl04=";
+    meta.description = "Diff library using Bram Cohen's patience diff algorithm";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  polling_state_rpc = janePackage {
+    pname = "polling_state_rpc";
+    hash = "sha256-l7SMFI+U2rde2OSUNOXPb9NBsvjPrBcxStNooxMgVB8=";
+    meta.description = "An RPC which tracks state on the client and server so it only needs to send diffs across the wire";
+    propagatedBuildInputs = [ async_kernel async_rpc_kernel core core_kernel diffable ppx_jane ];
+  };
+
+  posixat = janePackage {
+    pname = "posixat";
+    hash = "sha256-Nhp5jiK/TTwQXY5Bm4TTeH+xDTdXtvkSq5CS/Sr1UgA=";
+    propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv ];
+    meta.description = "Binding to the posix *at functions";
+  };
+
+  ppx_accessor = janePackage {
+    version = "0.16.1";
+    pname = "ppx_accessor";
+    hash = "sha256-o70q8eSbPeuGkIcCnKoK0BpaqPhy/NS7x2YYR6wfki8=";
+    meta.description = "[@@deriving] plugin to generate accessors for use with the Accessor libraries";
+    propagatedBuildInputs = [ accessor ];
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "sha256-LrpKE0BlFC3QseSXf5WhI71blshUzhH8yo2nXjAtiB8=";
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+    propagatedBuildInputs = [ ppx_cold ppx_compare ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "sha256-Ak+7+33qEGYwZWbES032SdkFOsae0+tWtR/DV+xrB10=";
+    meta.description = "Base set of ppx rewriters";
+    propagatedBuildInputs = [ ppx_cold ppx_enumerate ppx_globalize ppx_hash ];
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    hash = "sha256-NZlzEMruf89NsI4jfQJLSPhjk/PN47hLbJzGEN8GPl8=";
+    meta.description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    propagatedBuildInputs = [ ppx_inline_test ];
+  };
+
+  ppx_bin_prot = janePackage {
+    pname = "ppx_bin_prot";
+    hash = "sha256-ktfa4umCnLd9oY2WWX/5R7vPB/g7DJX8x3nF9fYLNCQ=";
+    meta.description = "Generation of bin_prot readers and writers from types";
+    propagatedBuildInputs = [ bin_prot ppx_here ];
+    doCheck = false; # circular dependency with ppx_jane
+  };
+
+  ppx_cold = janePackage {
+    pname = "ppx_cold";
+    hash = "sha256-boP07qHPbzf4ntLdV18oyID09ZUOfkIn9ZdQ0DvtrUA=";
+    meta.description = "Expands [@cold] into [@inline never][@specialise never][@local never]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "sha256-4bZdhyfnzTjH4E303O6GO2jW968ftuXwoE4/x854JOo=";
+    meta.description = "Generation of comparison functions from types";
+    propagatedBuildInputs = [ ppxlib base ];
+  };
+
+  ppx_conv_func = janePackage {
+    pname = "ppx_conv_func";
+    hash = "sha256-HPHSZHdR9ll+7EbWc36shTdRPFYB0lkApidk+XL3clI=";
+    meta.description = "Part of the Jane Street's PPX rewriters collection";
+    propagatedBuildInputs = [ ppxlib base ];
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    hash = "sha256-V30ijRgcma/rwysPxNAFnuJIb7XFrfi7mfjJxN+rSak=";
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+  };
+
+  ppx_css = janePackage {
+    pname = "ppx_css";
+    hash = "sha256-spT/dJW8YJtG4pOku9r6VVlBAMwGakTrr1euiABeqsU=";
+    meta.description = "A ppx that takes in css strings and produces a module for accessing the unique names defined within";
+    propagatedBuildInputs = [ async async_unix core_kernel core_unix ppxlib js_of_ocaml js_of_ocaml-ppx sedlex virtual_dom ];
+  };
+
+  ppx_csv_conv = janePackage {
+    pname = "ppx_csv_conv";
+    hash = "sha256-RdPcDPLzoSf45Zeon3f4HcEvlwB6Q6sAINX3LHmjmj8=";
+    meta.description = "Generate functions to read/write records in csv format";
+    propagatedBuildInputs = [ csvfields ppx_conv_func ];
+  };
+
+  ppx_demo = janePackage {
+    pname = "ppx_demo";
+    hash = "sha256-t/jz94YpwmorhWlcuflIZe0l85cESE62L9I7NMASVWM=";
+    meta.description = "PPX that exposes the source code string of an expression/module structure";
+    propagatedBuildInputs = [ core dedent ppx_jane ppxlib ];
+  };
+
+  ppx_derive_at_runtime = janePackage {
+    pname = "ppx_derive_at_runtime";
+    hash = "sha256-UESWOkyWTHJlsE6KZkty9P+iHI3oY1rLve3raRAqMbk=";
+    meta.description = "Define a new ppx deriver by naming a runtime module";
+    propagatedBuildInputs = [ base expect_test_helpers_core ppx_jane ppxlib ];
+  };
+
+  ppx_disable_unused_warnings = janePackage {
+    pname = "ppx_disable_unused_warnings";
+    hash = "sha256-jVNXmAy/Ti7MZmbdBjFuDwbmIILJB57flmmB6MoyCtY=";
+    meta.description = "Expands [@disable_unused_warnings] into [@warning \"-20-26-32-33-34-35-36-37-38-39-60-66-67\"]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_enumerate = janePackage {
+    pname = "ppx_enumerate";
+    hash = "sha256-v5JPu+qEXoZ1+mu/yTZW2sfCzU0K60/sInG/Ox1D35s=";
+    meta.description = "Generate a list containing all values of a finite type";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    hash = "sha256-H5ybRHufycdyCxKu370+QZAMUPQsHVD+6nD93tzvLn8=";
+    meta.description = "Cram like framework for OCaml";
+    propagatedBuildInputs = [ ppx_here ppx_inline_test re ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    hash = "sha256-kl0JZocMWo2KNciCWkT4nIbJZbh56ijZmlZWbxV8Qj0=";
+    meta.description = "Generation of accessor and iteration functions for ocaml records";
+    propagatedBuildInputs = [ fieldslib ppxlib ];
+  };
+
+  ppx_fixed_literal = janePackage {
+    pname = "ppx_fixed_literal";
+    hash = "sha256-vS2KcCO0fVCmiIBkUBgK6qnqdjREj57QCujHERcJTyo=";
+    meta.description = "Simpler notation for fixed point literals";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_globalize = janePackage {
+    pname = "ppx_globalize";
+    hash = "sha256-SG7710YPwWmhRVl7wN3ZQz3ZMTw3cpoywVSeVQAI3Zc=";
+    meta.description = "A ppx rewriter that generates functions to copy local values to the global heap";
+    propagatedBuildInputs = [ base ppxlib ];
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "sha256-ZmdW+q7fak8iG42jRQgZ6chmjHHwrDSy9wg7pq/6zwk=";
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "sha256-ULEom0pTusxf2k2hduv+5NVp7pW5doA/e3QGQNJfGoM=";
+    meta.description = "Expands [%here] into its location";
+    propagatedBuildInputs = [ ppxlib ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_ignore_instrumentation = janePackage {
+    pname = "ppx_ignore_instrumentation";
+    hash = "sha256-rAdxCgAKz0jNR8ppRJO4oAEvgXbcU4J4mpreAyeGe6k=";
+    meta.description = "Ignore Jane Street specific instrumentation extensions";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    hash = "sha256-Ql0/80KitKvW3xffeCapYREmZvlg+QWCb2JM2T4Rjlc=";
+    meta.description = "Syntax extension for writing in-line tests in ocaml code";
+    propagatedBuildInputs = [ ppxlib time_now ];
+    doCheck = false; # test build rules broken
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "sha256-v+/wdEGaXdMWDBa0eJO0uR18G/pDwHjsjaskoEuLusA=";
+    meta.description = "Standard Jane Street ppx rewriters";
+    propagatedBuildInputs = [ base_quickcheck ppx_bin_prot ppx_disable_unused_warnings ppx_expect ppx_fixed_literal ppx_ignore_instrumentation ppx_log ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_stable ppx_string ppx_tydi ppx_typerep_conv ppx_variants_conv ];
+  };
+
+  ppx_jsonaf_conv = janePackage {
+    pname = "ppx_jsonaf_conv";
+    hash = "sha256-GWDhSLtr2+VG3XFIbHgWUcLJFniC7/z90ndiE919CBo=";
+    meta.description =
+      "[@@deriving] plugin to generate Jsonaf conversion functions";
+    propagatedBuildInputs = [ base jsonaf ppx_jane ppxlib ];
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    hash = "sha256-q5CLyeu+5qjegLrJkQVMnId3HMvZ8j3c0PqEa2vTBtU=";
+    meta.description = "Code style checker for Jane Street Packages";
+    propagatedBuildInputs = [ octavius ppxlib ];
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "sha256-/kEkYXFZ5OyTM4i/WWViaxKvigpoKKoiWtUWuEMkgBE=";
+    meta.description = "Monadic let-bindings";
+    propagatedBuildInputs = [ ppxlib ppx_here ];
+  };
+
+  ppx_log = janePackage {
+    pname = "ppx_log";
+    hash = "sha256-/HwoxBWKuVqTDYe4u0cYNGqg2Lj0h49U2VrFa4cpE2g=";
+    meta.description = "Ppx_sexp_message-like extension nodes for lazily rendering log messages";
+    propagatedBuildInputs = [ base ppx_here ppx_sexp_conv ppx_sexp_message sexplib ];
+  };
+
+  ppx_module_timer = janePackage {
+    pname = "ppx_module_timer";
+    hash = "sha256-AfG+ZnacrR6p7MOvtktVKVLrMBpNMkX9b2+eqNZNRF4=";
+    meta.description = "Ppx rewriter that records top-level module startup times";
+    propagatedBuildInputs = [ time_now ];
+  };
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    hash = "sha256-TONxBQq/b0kc89f3+jItHd9SnerNx8xa2AjO7HOW+xQ=";
+    meta.description = "Optional compilation for OCaml";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "sha256-1GpKEEH1Ul+W0k4/8Mra/qYlyFpeMfZ3xrmB3X7uve0=";
+    meta.description = "Pattern matching on flat options";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_pattern_bind = janePackage {
+    pname = "ppx_pattern_bind";
+    hash = "sha256-ShR8N71a7sz5XaKDyybsy+K0Uu7sYMgvpMADVxmrI/g=";
+    meta.description = "A ppx for writing fast incremental bind nodes in a pattern match";
+    propagatedBuildInputs = [ ppx_let ];
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "sha256-gSS+vfsYw3FFOFZ8/iRnP3rxokKAU7EPa1wXq7SbJBk=";
+    meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_python = janePackage {
+    pname = "ppx_python";
+    hash = "sha256-lpc6F+Scc5ECdOXPWowKSWRnFSzKbmE8oHs7zCjq3j8=";
+    meta.description = "A [@@deriving] plugin to generate Python conversion functions ";
+    propagatedBuildInputs = [ ppx_base ppxlib pyml ];
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    hash = "sha256-eCQfYAxZZmfNTbPrFW0sqrj63kIdIQ1MAlImCaMop68=";
+    meta.description = "[@@deriving] plugin to generate S-expression conversion functions";
+    propagatedBuildInputs = [ ppxlib sexplib0 base ];
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    hash = "sha256-4g3Fjrjqhw+XNkCyxrXkgZDEa3e+ytPsEtQA2xSv+jA=";
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "sha256-LsP+deeFYxB38xXw7LLB3gOMGZiUOFRYklGVY7DMmvE=";
+    meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values";
+    propagatedBuildInputs = [ ppx_here ppx_sexp_conv ];
+  };
+
+  ppx_stable = janePackage {
+    pname = "ppx_stable";
+    hash = "sha256-DFCBJY+Q8LjXSF9vHwPpUJLNyMoAXdDwQZrvhl+9g0U=";
+    meta.description = "Stable types conversions generator";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_stable_witness = janePackage {
+    pname = "ppx_stable_witness";
+    hash = "sha256-W1CN4xspM8NJiXfi7OsngfzWnLEUmBs+IRLwHfxX9d4=";
+    meta.description = "Ppx extension for deriving a witness that a type is intended to be stable";
+    propagatedBuildInputs = [ base ppxlib ];
+  };
+
+  ppx_string = janePackage {
+    pname = "ppx_string";
+    hash = "sha256-GQlgiaES8wc6Y7rTgmPrf9UfMfu125VoNGEbdc7kFsk=";
+    meta.description = "Ppx extension for string interpolation";
+    propagatedBuildInputs = [ ppx_base ppxlib stdio ];
+  };
+
+  ppx_tydi = janePackage {
+    pname = "ppx_tydi";
+    hash = "sha256-neu2Z7TgQdBzf8UtYDRhnGp3Iggfd90Fr+gQuwVTMOo=";
+    meta.description = "Let expressions, inferring pattern type from expression";
+    propagatedBuildInputs = [ base ppxlib ];
+  };
+
+  ppx_typed_fields = janePackage {
+    pname = "ppx_typed_fields";
+    hash = "sha256-l4lCQ4n5FLPS82sb3FgW+HF2OEY/kY10sNfr+aQF8x8=";
+    meta.description = "GADT-based field accessors and utilities";
+    propagatedBuildInputs = [ core ppx_jane ppxlib ];
+  };
+
+  ppx_typerep_conv = janePackage {
+    pname = "ppx_typerep_conv";
+    hash = "sha256-DxjgwZee0jOea7qyPfEhRrdcKWQb2jtjrowiJszS+Fs=";
+    meta.description = "Generation of runtime types from type declarations";
+    propagatedBuildInputs = [ ppxlib typerep ];
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    hash = "sha256-Q/CCcMrD+XN5YRMzKvXuiQHfcwXwI773s8x150/eMzs=";
+    meta.description = "Generation of accessor and iteration functions for ocaml variant types";
+    propagatedBuildInputs = [ variantslib ppxlib ];
+  };
+
+  pythonlib = janePackage {
+    pname = "pythonlib";
+    version = "0.16";
+    hash = "sha256-HrsdtwPSDSaMB9CDIR9P5iaAmLihUrReuNAPIYa+s3Y=";
+    meta.description = "A library to help writing wrappers around ocaml code for python";
+    propagatedBuildInputs = [ base core expect_test_helpers_core ppx_compare ppx_expect ppx_here ppx_let ppx_python ppx_string stdio typerep pyml ];
+    meta.broken = lib.versionAtLeast ocaml.version "4.14";
+  };
+
+  profunctor = janePackage {
+    pname = "profunctor";
+    hash = "sha256-CFHMtCuBnrlr+B2cdJm2Tamt0A/e+f3SnjEavvE31xQ=";
+    meta.description = "A library providing a signature for simple profunctors and traversal of a record";
+    propagatedBuildInputs = [ base ppx_jane record_builder ];
+  };
+
+  protocol_version_header = janePackage {
+    pname = "protocol_version_header";
+    hash = "sha256-GVjnwne6ksjY9ptLOpbsgG0La6eiCJf1w4teYEtgJrA=";
+    meta.description = "Protocol versioning";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "sha256-ZRJ7ooXtatEEh0sPL8M9OZ+6s7xNdTuw0Ot6txiG16I=";
+    meta.description = "OCaml bindings for RE2, Google's regular expression library";
+    propagatedBuildInputs = [ core_kernel jane_rope regex_parser_intf ];
+    prePatch = ''
+      substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++'
+      substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))'
+    '';
+  };
+
+  re2_stable = janePackage {
+    pname = "re2_stable";
+    version = "0.14.0";
+    hash = "sha256-gyet2Pzn7ZIqQ+UP2J51pRmwaESY2LSGTqCMZZwDTE4=";
+    meta.description = "Re2_stable adds an incomplete but stable serialization of Re2";
+    propagatedBuildInputs = [ core re2 ];
+  };
+
+  record_builder = janePackage {
+    pname = "record_builder";
+    hash = "sha256-46zGgN9RlDjoSbi8RimuQVrMhy65Gpic0YPZpHOeoo0=";
+    meta.description = "A library which provides traversal of records with an applicative";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  redis-async = janePackage {
+    pname = "redis-async";
+    hash = "sha256-5msIS2m8nkaprR8NEBfKFWZBWaDJiUtjHbfPelg9/os=";
+    meta.description = "Redis client for Async applications";
+    propagatedBuildInputs = [ async bignum core core_kernel ppx_jane ];
+  };
+
+  regex_parser_intf = janePackage {
+    pname = "regex_parser_intf";
+    hash = "sha256-huzHtUIIVRd5pE7VU1oUjN20S55L6+WCvoLlQ0FCD7A=";
+    meta.description = "Interface shared by Re_parser and Re2.Parser";
+    propagatedBuildInputs = [ base ];
+  };
+
+  resource_cache = janePackage {
+    pname = "resource_cache";
+    hash = "sha256-dN4skSHswgRYLZqN/tqhFFTfgoN8H/LgTgoe+5ZI5zE=";
+    meta.description = "General resource cache";
+    propagatedBuildInputs = [ async_rpc_kernel ];
+  };
+
+  semantic_version = janePackage {
+    pname = "semantic_version";
+    hash = "sha256-KJanaDUW56ndvnTlnPeQgh0C7zsRqXJ328gcEiVDrmc=";
+    meta.description = "Semantic versioning";
+    propagatedBuildInputs = [ core ppx_jane re ];
+  };
+
+  sexp = janePackage {
+    pname = "sexp";
+    hash = "sha256-JWRYi5lX9UOKg+RGvW6FO61t2HlnJKXhzctOHXe0bCM=";
+    propagatedBuildInputs = [
+      async
+      core
+      csvfields
+      jsonaf
+      re2
+      sexp_diff
+      sexp_macro
+      sexp_pretty
+      sexp_select
+      shell
+    ];
+    meta.description = "S-expression swiss knife";
+  };
+
+  sexp_grammar = janePackage {
+    pname = "sexp_grammar";
+    hash = "sha256-Y/abRingL4+3qvaKgW9jH46E9uq7jYE2+kgr8ERKqfI=";
+    propagatedBuildInputs = [ core ppx_bin_prot ppx_compare ppx_hash ppx_let ppx_sexp_conv ppx_sexp_message zarith ];
+    meta.description = "Helpers for manipulating [Sexplib.Sexp_grammar] values";
+  };
+
+  sexp_diff = janePackage {
+    pname = "sexp_diff";
+    hash = "sha256-2dMBKf7eUbKZtvV7Ol2mPMzYJOCDHuOm9xFZ8vkmp/0=";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Code for computing the diff of two sexps";
+  };
+
+  sexp_macro = janePackage {
+    pname = "sexp_macro";
+    hash = "sha256-x9WsFFrV7wUqgPUw8KkfyzOxLrS5h5++OSK8QljeQqg=";
+    propagatedBuildInputs = [ async sexplib ];
+    meta.description = "Sexp macros";
+  };
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    hash = "sha256-tcWdYZ717LkGowRSRoEcUNY7VCMX64uhCaY3bXhWxKM=";
+    meta.description = "S-expression pretty-printer";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+  };
+
+  sexp_select = janePackage {
+    pname = "sexp_select";
+    hash = "sha256-HEzZowojeK9yDOoTY/l01fYLUdolzQGlMO9u3phV8so=";
+    propagatedBuildInputs = [ base ppx_jane ];
+    meta.description = "A library to use CSS-style selectors to traverse sexp trees";
+  };
+
+  sexplib0 = janePackage {
+    pname = "sexplib0";
+    hash = "sha256-wRr1M243Bqu/XLSsr5IVPH5RTVWeVgZjxkKOrm+PW5E=";
+    minimalOCamlVersion = "4.08.0";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    hash = "sha256-6MwggpjHo4FmKF88fP56LN9OHi2uIJc13TvKx4T7gEI=";
+    meta.description = "Library for serializing OCaml values to and from S-expressions";
+    propagatedBuildInputs = [ num parsexp ];
+  };
+
+  shell = janePackage {
+    pname = "shell";
+    hash = "sha256-pK434+ToeYURQHRV+gK57rC7BFvznWEvIu5NAib2ZTU=";
+    meta.description = "Yet another implementation of fork&exec and related functionality";
+    buildInputs = [ jst-config ];
+    propagatedBuildInputs = [ textutils ];
+    checkInputs = [ ounit ];
+  };
+
+  shexp = janePackage {
+    pname = "shexp";
+    hash = "sha256-npIcrxMOcIgsecdUEx5XHYp0KVrXiMzMLi8jskAp4vo=";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    minimalOCamlVersion = "4.02.3";
+    version = "0.15.0";
+    hash = "1fjr91psas5zmk1hxvxh0dchhn0pkyzlr4gg232f5g9vdgissi0p";
+    meta.description = "Spawning sub-processes";
+    buildInputs = [ ppx_expect ];
+  };
+
+  splay_tree = janePackage {
+    pname = "splay_tree";
+    hash = "sha256-Ag6yqTofEZ3v0qF+Z7xpXQOh7+HWtvRLlY+iAYqcReg=";
+    meta.description = "A splay tree implementation";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  splittable_random = janePackage {
+    pname = "splittable_random";
+    hash = "sha256-wMmLuzhKmnS2iTYVTPUx5Rv2LhL/ygmWmb9t2pUjz+E=";
+    meta.description = "PRNG that can be split into independent streams";
+    propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ];
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    hash = "sha256-+QgxqSMqO4VGoMWWJ3QoXdtJKcVpxlSQ/OI7dmcNqjw=";
+    meta.description = "Standard IO library for OCaml";
+    propagatedBuildInputs = [ base ];
+  };
+
+  stored_reversed = janePackage {
+    pname = "stored_reversed";
+    hash = "sha256-ef11f0qifEvxKChM49Hnfk6J6hL+b0tMlm0iDLd5Y0Q=";
+    meta.description = "A library for representing a list temporarily stored in reverse order";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  streamable = janePackage {
+    version = "0.16.1";
+    pname = "streamable";
+    hash = "sha256-3djrUW2tPKaEmoOIpdjN6ok7U9i07yreqbi1kP+6pnY=";
+    meta.description = "A collection of types suitable for incremental serialization";
+    propagatedBuildInputs = [ async_kernel async_rpc_kernel base core core_kernel ppx_jane ppxlib ];
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "sha256-2qy99MUMpkuNCvCYlk36k4kN6cPjrEILbwEUv4DyNYw=";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core_unix textutils_kernel ];
+  };
+
+  textutils_kernel = janePackage {
+    pname = "textutils_kernel";
+    hash = "sha256-DiXemANj5ONmvMzp+tly3AJud5u9i7HdaHmn8aVQS48=";
+    meta.description = "Text output utilities";
+    propagatedBuildInputs = [ core ppx_jane uutf ];
+  };
+
+  tilde_f = janePackage {
+    pname = "tilde_f";
+    hash = "sha256-qLjM9liJfMIh2fqRPBdnmtUf4xhzk2MY8dFNdON3Aew=";
+    meta.description = "Provides a let-syntax for continuation-passing style";
+    propagatedBuildInputs = [ base ppx_jane ];
+  };
+
+  time_now = janePackage {
+    pname = "time_now";
+    hash = "sha256-DjSrx/HgwCYS0Xzm2gFvWUVLD7a1KuFVIyVrJjBi8Tc=";
+    meta.description = "Reports the current time";
+    buildInputs = [ jst-config ppx_optcomp ];
+    propagatedBuildInputs = [ jane-street-headers base ppx_base ];
+  };
+
+  timezone = janePackage {
+    pname = "timezone";
+    hash = "sha256-pmXUMvLfgAwP6TV/aP9wMlOs0KfwEWtaJfdjUFLbOu0=";
+    meta.description = "Time-zone handling";
+    propagatedBuildInputs = [ core_kernel ];
+  };
+
+  topological_sort = janePackage {
+    pname = "topological_sort";
+    hash = "sha256-um5++60mR++iHAruKqoQfd4EbQ1kb3L+cPOWhs9sIHI=";
+    meta.description = "Topological sort algorithm";
+    propagatedBuildInputs = [ ppx_jane stdio ];
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "sha256-iJnIjWZYCTaH29x7nFviCrbnTmHRChZkkj6E5sgi4mU=";
+    meta.description = "Typerep is a library for runtime types";
+    propagatedBuildInputs = [ base ];
+  };
+
+  username_kernel = janePackage {
+    pname = "username_kernel";
+    hash = "sha256-UvFL/M9OsD+SOs9MYMKiKzZilLJHzriop6SPA4bOhZQ=";
+    meta.description = "An identifier for a user";
+    propagatedBuildInputs = [ core ppx_jane ];
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "sha256-8NoNkyIP7iEEiei+Q1zrPoJjnWwhCsLsY1vgua22gnw=";
+    meta.description = "Part of Jane Street's Core library";
+    propagatedBuildInputs = [ base ];
+  };
+
+  vcaml = janePackage {
+    pname = "vcaml";
+    hash = "sha256-pmEKi24+22T76SzI3RpBmQF7ZrQwlngrpFYLoBdLwe0=";
+    meta.description = "OCaml bindings for the Neovim API";
+    propagatedBuildInputs = [ angstrom-async async_extra expect_test_helpers_async faraday jsonaf man_in_the_middle_debugger semantic_version ];
+    patches = [ ./vcaml.patch ];
+  };
+
+  virtual_dom = janePackage {
+    pname = "virtual_dom";
+    hash = "sha256-nXW9cDHQVugriR0+GkayuV4S3HKothQAoNJef02iALM=";
+    meta.description = "OCaml bindings for the virtual-dom library";
+    buildInputs = [ js_of_ocaml-ppx ];
+    propagatedBuildInputs = [ base64 core_kernel gen_js_api js_of_ocaml js_of_ocaml_patches lambdasoup tyxml uri ];
+  };
+
+  zarith_stubs_js = janePackage {
+    pname = "zarith_stubs_js";
+    hash = "sha256-oKD+JE08Mgvk5l8XFHSZ7xqiWPaOvKC87+zHLaQ/7q0=";
+    meta.description = "Javascripts stubs for the Zarith library";
+  };
+
+  zstandard = janePackage {
+    pname = "zstandard";
+    hash = "sha256-QcYqlOpCAr0owmO6sLDJhki8lUnNvtkaxldKb5I5AF0=";
+    meta.description = "OCaml bindings to Zstandard";
+    buildInputs = [ ppx_jane ];
+    propagatedBuildInputs = [ core_kernel ctypes zstd ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/bonsai_jsoo_4_0.patch b/nixpkgs/pkgs/development/ocaml-modules/janestreet/bonsai_jsoo_4_0.patch
new file mode 100644
index 000000000000..e658ba05ca4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/bonsai_jsoo_4_0.patch
@@ -0,0 +1,13 @@
+diff --git a/web_ui/element_size_hooks/visibility_tracker.ml b/web_ui/element_size_hooks/visibility_tracker.ml
+index 2e5dbe0..61df433 100644
+--- a/web_ui/element_size_hooks/visibility_tracker.ml
++++ b/web_ui/element_size_hooks/visibility_tracker.ml
+@@ -23,8 +23,6 @@ let get_conservative_vis_bounds (element : Dom_html.element Js.t) : Bounds.t opt
+   and client_height = client_bounds##.height
+   and window_height = Dom_html.window##.innerHeight
+   and window_width = Dom_html.window##.innerWidth in
+-  let%bind.Option window_height = Js.Optdef.to_option window_height in
+-  let%bind.Option window_width = Js.Optdef.to_option window_width in
+   let window_height = Float.of_int window_height
+   and window_width = Float.of_int window_width
+   and client_width = Js.Optdef.get client_width (Fn.const 0.0)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix
new file mode 100644
index 000000000000..a496c2c73cf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix
@@ -0,0 +1,27 @@
+{ }:
+
+# Minimal set of names assumed to be defined by the rest of ocamlPackages
+{
+  async = null;
+  async_kernel = null;
+  async_unix = null;
+  base = null;
+  core = null;
+  core_bench = null;
+  core_kernel = null;
+  ocaml-compiler-libs = null;
+  ppx_custom_printf = null;
+  ppx_expect = null;
+  ppx_hash = null;
+  ppx_here = null;
+  ppx_inline_test = null;
+  ppx_jane = null;
+  ppx_js_style = null;
+  ppx_let = null;
+  ppx_optcomp = null;
+  ppx_sexp_conv = null;
+  sexplib0 = null;
+  sexplib = null;
+  spawn = null;
+  stdio = null;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/incr_dom_jsoo_4_0.patch b/nixpkgs/pkgs/development/ocaml-modules/janestreet/incr_dom_jsoo_4_0.patch
new file mode 100644
index 000000000000..4e7a45ce96d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/incr_dom_jsoo_4_0.patch
@@ -0,0 +1,24 @@
+diff --git a/src/js_misc.ml b/src/js_misc.ml
+index 65f7b44..bfef103 100644
+--- a/src/js_misc.ml
++++ b/src/js_misc.ml
+@@ -28,17 +28,11 @@ type rows_or_columns =
+ [@@deriving sexp, bin_io, variants, compare]
+ 
+ let innerHeight () =
+-  Js.Optdef.case
+-    Dom_html.window##.innerHeight
+-    (fun () -> Dom_html.document##.documentElement##.clientHeight)
+-    Fn.id
++  Dom_html.window##.innerHeight
+ ;;
+ 
+ let innerWidth () =
+-  Js.Optdef.case
+-    Dom_html.window##.innerWidth
+-    (fun () -> Dom_html.document##.documentElement##.clientWidth)
+-    Fn.id
++  Dom_html.window##.innerWidth
+ ;;
+ 
+ let element_is_in_viewport (elt : Dom_html.element Js.t) =
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
new file mode 100644
index 000000000000..bbfd492cb64f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
@@ -0,0 +1,21 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.12.0" }:
+
+{ pname, version ? defaultVersion, duneVersion ? "3", hash, ...}@args:
+
+buildDunePackage (args // {
+  inherit version duneVersion;
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = hash;
+  };
+
+  meta = {
+    license = lib.licenses.mit;
+    homepage = "https://github.com/janestreet/${pname}";
+  } // args.meta;
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix
new file mode 100644
index 000000000000..59fd0e3e9818
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.14.0" }:
+
+{ pname
+, version ? defaultVersion
+, hash
+, minimalOCamlVersion ? "4.08"
+, doCheck ? true
+, buildInputs ? []
+, ...}@args:
+
+buildDunePackage (args // {
+  duneVersion = "3";
+  inherit version buildInputs;
+
+  inherit minimalOCamlVersion;
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = hash;
+  };
+
+  inherit doCheck;
+
+  meta = {
+    license = lib.licenses.mit;
+    homepage = "https://github.com/janestreet/${pname}";
+  } // args.meta;
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_15.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_15.nix
new file mode 100644
index 000000000000..ca590e2f1a72
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_15.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.15.0" }:
+
+{ pname
+, version ? defaultVersion
+, hash
+, minimalOCamlVersion ? "4.11"
+, doCheck ? true
+, buildInputs ? []
+, ...}@args:
+
+buildDunePackage (args // {
+  duneVersion = "3";
+  inherit version buildInputs;
+
+  inherit minimalOCamlVersion;
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = hash;
+  };
+
+  inherit doCheck;
+
+  meta = {
+    license = lib.licenses.mit;
+    homepage = "https://github.com/janestreet/${pname}";
+  } // args.meta;
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_16.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_16.nix
new file mode 100644
index 000000000000..c1b2ed2a9139
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_16.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.16.0" }:
+
+{ pname
+, version ? defaultVersion
+, hash
+, minimalOCamlVersion ? "4.14"
+, doCheck ? true
+, buildInputs ? []
+, ...}@args:
+
+buildDunePackage (args // {
+  duneVersion = "3";
+  inherit version buildInputs;
+
+  inherit minimalOCamlVersion;
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = hash;
+  };
+
+  inherit doCheck;
+
+  meta = {
+    license = lib.licenses.mit;
+    homepage = "https://github.com/janestreet/${pname}";
+  } // args.meta;
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/sexp.patch b/nixpkgs/pkgs/development/ocaml-modules/janestreet/sexp.patch
new file mode 100644
index 000000000000..e56ce6508db1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/sexp.patch
@@ -0,0 +1,30 @@
+diff --git a/lazy_list/src/dune b/lazy_list/src/dune
+index f1650ad..df90914 100644
+--- a/lazy_list/src/dune
++++ b/lazy_list/src/dune
+@@ -1,2 +1,3 @@
+ (library (name lazy_list) (libraries core_kernel)
++ (public_name sexp.lazy_list)
+  (preprocess (pps ppx_jane)))
+\ No newline at end of file
+diff --git a/sexp_app/pattern/dune b/sexp_app/pattern/dune
+index b7d2c3b..baf136b 100644
+--- a/sexp_app/pattern/dune
++++ b/sexp_app/pattern/dune
+@@ -1,4 +1,5 @@
+ (library (name sexp_app_pattern) (libraries core re2 sexplib str)
++ (public_name sexp.sexp_app_pattern)
+  (preprocess (pps ppx_jane)))
+ 
+ (ocamllex lexer)
+diff --git a/sexp_app/src/dune b/sexp_app/src/dune
+index b91ff40..a07a4e7 100644
+--- a/sexp_app/src/dune
++++ b/sexp_app/src/dune
+@@ -1,4 +1,5 @@
+ (library (name sexp_app) (libraries core lazy_list re2 sexplib str)
++ (public_name sexp.sexp_app)
+  (preprocess (pps ppx_jane -allow-unannotated-ignores)))
+ 
+ (ocamllex csv_lexeme)
+\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/vcaml.patch b/nixpkgs/pkgs/development/ocaml-modules/janestreet/vcaml.patch
new file mode 100644
index 000000000000..5d0fbbec4d33
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/vcaml.patch
@@ -0,0 +1,22 @@
+diff --git a/src/api_call.ml b/src/api_call.ml
+index 66f5083..6e96e95 100644
+--- a/src/api_call.ml
++++ b/src/api_call.ml
+@@ -112,7 +112,7 @@ include
+       include T
+     end)
+     (Open_on_rhs_intf)
+-    ()
++    (struct end)
+ 
+ module Or_error = struct
+   type nonrec 'a t = 'a Or_error.t t
+@@ -138,7 +138,7 @@ module Or_error = struct
+         include T
+       end)
+       (Open_on_rhs_intf)
+-      ()
++      (struct end)
+ 
+   let error_s sexp = Const (Or_error.error_s sexp)
+   let ignore_m t = map t ~f:ignore
diff --git a/nixpkgs/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch b/nixpkgs/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch
new file mode 100644
index 000000000000..c06144a75c06
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch
@@ -0,0 +1,9 @@
+--- javalib-2.3-orig/Makefile.config.example	2013-10-30 08:35:30.000000000 +0100
++++ javalib-2.3/Makefile.config.example	2014-07-06 17:32:29.799398394 +0200
+@@ -1,6 +1,3 @@
+-export OCAMLFIND_DESTDIR=$(LOCALDEST)
+-export OCAMLPATH=$(LOCALDEST)
+-
+ OCAMLC = $(FINDER) ocamlc $(FLAGS)
+ OCAMLOPT = $(FINDER) ocamlopt $(OPT_FLAGS)
+ OCAMLDOC = $(FINDER) ocamldoc
diff --git a/nixpkgs/pkgs/development/ocaml-modules/javalib/configure.sh.patch b/nixpkgs/pkgs/development/ocaml-modules/javalib/configure.sh.patch
new file mode 100644
index 000000000000..67e019b277af
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/javalib/configure.sh.patch
@@ -0,0 +1,11 @@
+--- javalib-2.3-orig/configure.sh	2013-10-30 08:35:30.000000000 +0100
++++ javalib-2.3/configure.sh	2014-07-06 17:28:39.025066199 +0200
+@@ -44,7 +44,7 @@
+ DESTDIR=
+ # The ocamlpath variable for the compiler to locate the locally-installed
+ # packages (depends on LOCALDEST)
+-OCAMLPATH=
++#OCAMLPATH=
+ # The packages that need to be made in addition to Savalib / Sawja
+ MAKEDEP=
+ # The packages that need to be made in addition to Savalib / Sawja
diff --git a/nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix
new file mode 100644
index 000000000000..e6685ec0b558
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, which
+, ocaml
+, findlib
+, camlzip
+, extlib
+}:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "javalib is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-javalib";
+  version = "3.2.2";
+
+  src = fetchFromGitHub {
+    owner = "javalib-team";
+    repo = "javalib";
+    rev = version;
+    hash = "sha256-XaI7GTU/O5UEWuYX4yqaIRmEoH7FuvCg/+gtKbE/P1s=";
+  };
+
+  nativeBuildInputs = [ which ocaml findlib ];
+
+  strictDeps = true;
+
+  patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
+
+  createFindlibDestdir = true;
+
+  configureScript = "./configure.sh";
+  dontAddPrefix = "true";
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [ ];
+
+  propagatedBuildInputs = [ camlzip extlib ];
+
+  meta = with lib; {
+    description = "Library that parses Java .class files into OCaml data structures";
+    homepage = "https://javalib-team.github.io/javalib/";
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix
new file mode 100644
index 000000000000..595a5cbb18a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml
+, menhir, ppxlib, ppx_deriving, re, uutf, uucp, ounit2
+}:
+
+buildDunePackage rec {
+  pname = "jingoo";
+  version = "1.4.4";
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner = "tategakibunko";
+    repo = "jingoo";
+    rev = "v${version}";
+    sha256 = "sha256-qIw69OE7wYyZYKnIc9QrmF8MzY5Fg5pBFyIpexmaYxA=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [ ppxlib ppx_deriving re uutf uucp ];
+  checkInputs = [ ounit2 ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+
+  meta = with lib; {
+    homepage = "https://github.com/tategakibunko/jingoo";
+    description = "OCaml template engine almost compatible with jinja2";
+    mainProgram = "jingoo";
+    license = licenses.mit;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix
new file mode 100644
index 000000000000..46810ab1566b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, json-data-encoding, ocplib-endian, crowbar, alcotest }:
+
+buildDunePackage {
+  pname = "json-data-encoding-bson";
+
+  inherit (json-data-encoding) version src doCheck;
+
+  propagatedBuildInputs = [
+    json-data-encoding
+    ocplib-endian
+  ];
+
+  checkInputs = [
+    crowbar
+    alcotest
+  ];
+
+  meta = json-data-encoding.meta // {
+    description = "Type-safe encoding to and decoding from JSON (bson support)";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix
new file mode 100644
index 000000000000..5bb3f7701bba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitLab, buildDunePackage, hex, uri }:
+
+buildDunePackage rec {
+  pname = "json-data-encoding";
+  version = "1.0.1";
+  minimalOCamlVersion = "4.10";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "data-encoding";
+    rev = "v${version}";
+    hash = "sha256-KoA4xX4tNyi6bX5kso/Wof1LA7431EXJ34eD5X4jnd8=";
+  };
+
+  propagatedBuildInputs = [
+    hex
+    uri
+  ];
+
+  meta = {
+    homepage = "https://gitlab.com/nomadic-labs/json-data-encoding";
+    description = "Type-safe encoding to and decoding from JSON";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix
new file mode 100644
index 000000000000..ada427aef866
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-jsonm";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/jsonm/releases/jsonm-${version}.tbz";
+    hash = "sha256-6ikjn+tAUyAd8+Hm0nws4SOIKsRljhyL6plYvhGKe9Y=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ uutf ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "OCaml non-blocking streaming codec to decode and encode the JSON data format";
+    homepage = "https://erratique.ch/software/jsonm";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ vbgl ];
+    mainProgram = "jsontrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix b/nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix
new file mode 100644
index 000000000000..6bcdbab33498
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, junit, alcotest }:
+
+buildDunePackage ({
+  pname = "junit_alcotest";
+
+  inherit (junit) src version meta;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    junit
+    alcotest
+  ];
+
+  doCheck = false; # 2 tests fail: 1) "Test with unexpected exception"; 2) "with wrong result";
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/junit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/junit/default.nix
new file mode 100644
index 000000000000..ff3c31519ed4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, ptime, tyxml }:
+
+buildDunePackage (rec {
+  pname = "junit";
+  version = "2.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/Khady/ocaml-junit/releases/download/${version}/junit-${version}.tbz";
+    sha256 = "00bbx5j8vsy9fqbc04xa3lsalaxicirmbczr65bllfk1afv43agx";
+  };
+
+  propagatedBuildInputs = [
+    ptime
+    tyxml
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "ocaml-junit is an OCaml package for the creation of JUnit XML reports, proving a typed API to produce valid reports acceptable to Jenkins, comes with packages supporting OUnit and Alcotest";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ ];
+    homepage = "https://github.com/Khady/ocaml-junit";
+  };
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix b/nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix
new file mode 100644
index 000000000000..c7d53ecc4f50
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, junit, ounit }:
+
+buildDunePackage ({
+  pname = "junit_ounit";
+
+  inherit (junit) src version meta;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    junit
+    ounit
+  ];
+
+  doCheck = true;
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix b/nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix
new file mode 100644
index 000000000000..745f86dff52b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub, alcotest, digestif, fmt, yojson
+, ppxlib
+, base64, re, ppx_deriving }:
+
+buildDunePackage rec {
+  pname = "jwto";
+  version = "0.4.0";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "sporto";
+    repo = "jwto";
+    rev = version;
+    hash = "sha256-TOWwNyrOqboCm8Y4mM6GgtmxGO3NmyDdAX7m8CifA7Y=";
+  };
+
+  buildInputs = [ ppxlib ];
+
+  propagatedBuildInputs =
+    [ digestif fmt yojson base64 re ppx_deriving ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/sporto/jwto";
+    description = "JSON Web Tokens (JWT) for OCaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ Zimmi48 jtcoolen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix b/nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix
new file mode 100644
index 000000000000..28c380a4616d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage
+, rdkafka, zlib }:
+
+buildDunePackage rec {
+  pname = "kafka";
+  version = "0.5";
+
+  src = fetchurl {
+    url = "https://github.com/didier-wenzek/ocaml-kafka/releases/download/${version}/kafka-${version}.tbz";
+    sha256 = "0m9212yap0a00hd0f61i4y4fna3141p77qj3mm7jl1h4q60jdhvy";
+  };
+
+  propagatedBuildInputs = [ rdkafka zlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/didier-wenzek/ocaml-kafka";
+    description = "OCaml bindings for Kafka";
+    license     = licenses.mit;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix
new file mode 100644
index 000000000000..da931d6e8bff
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage
+, ocaml
+, lib
+, kafka
+, lwt
+, cmdliner
+}:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "kafka_lwt is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "kafka_lwt";
+
+  inherit (kafka) version src;
+
+  buildInputs = [ cmdliner ];
+
+  propagatedBuildInputs = [ kafka lwt ];
+
+  meta = kafka.meta // {
+    description = "OCaml bindings for Kafka, Lwt bindings";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/kcas/default.nix b/nixpkgs/pkgs/development/ocaml-modules/kcas/default.nix
new file mode 100644
index 000000000000..2d840b9a750b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kcas/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl
+, domain-local-await, domain-local-timeout
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "kcas";
+  version = "0.6.1";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/kcas/releases/download/${version}/kcas-${version}.tbz";
+    hash = "sha256-u3Z8uAvITRUhOcB2EUYjWtpxIFJMvm2O/kyNr/AELWI=";
+  };
+
+  propagatedBuildInputs = [ domain-local-await domain-local-timeout ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/kcas";
+    description = "STM based on lock-free MCAS";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ke/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ke/default.nix
new file mode 100644
index 000000000000..35f083a876ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ke/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl
+, bigarray-compat, fmt
+, alcotest, bigstringaf
+}:
+
+buildDunePackage rec {
+  pname = "ke";
+  version = "0.6";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ke/releases/download/v${version}/ke-${version}.tbz";
+    sha256 = "sha256-YSFyB+IgCwSxd1lzZhD/kggmmmR/hUy1rnLNrA1nIwU=";
+  };
+
+  propagatedBuildInputs = [ fmt ];
+
+  checkInputs = [ alcotest bigstringaf ];
+  doCheck = true;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  meta = {
+    description = "Fast implementation of queue in OCaml";
+    homepage = "https://github.com/mirage/ke";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/kicadsch/default.nix b/nixpkgs/pkgs/development/ocaml-modules/kicadsch/default.nix
new file mode 100644
index 000000000000..69b4aae3eafb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kicadsch/default.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildDunePackage
+, fetchurl
+}:
+
+buildDunePackage rec {
+  pname = "kicadsch";
+  version = "0.9.0";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/jnavila/plotkicadsch/releases/download/v${version}/plotkicadsch-${version}.tbz";
+    sha256 = "sha256-B+vnEPyd3SUzviTdNoyvYk0p7Hrg/XTJm8KxsY8A4jQ=";
+  };
+
+  meta = with lib; {
+    description = "OCaml library for exporting Kicad Sch files to SVG pictures";
+    homepage = "https://github.com/jnavila/plotkicadsch";
+    license = licenses.isc;
+    maintainers = with maintainers; [ leungbk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/kqueue/default.nix b/nixpkgs/pkgs/development/ocaml-modules/kqueue/default.nix
new file mode 100644
index 000000000000..6666d58cfb1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kqueue/default.nix
@@ -0,0 +1,39 @@
+{ buildDunePackage
+, dune-configurator
+, lib
+, fetchurl
+, ppx_expect
+, ppx_optcomp
+}:
+
+buildDunePackage rec {
+  pname = "kqueue";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/anuragsoni/kqueue-ml/releases/download/${version}/kqueue-${version}.tbz";
+    hash = "sha256-MKRCyN6q9euTEgHIhldGGH8FwuLblWYNG+SiCMWBP6Y=";
+  };
+
+  buildInputs = [
+    dune-configurator
+    ppx_optcomp
+  ];
+
+  checkInputs = [
+    ppx_expect
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "OCaml bindings for kqueue event notification interface";
+    homepage = "https://github.com/anuragsoni/kqueue-ml";
+    changelog = "https://github.com/anuragsoni/kqueue-ml/blob/${version}/CHANGES.md";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgl/META.patch b/nixpkgs/pkgs/development/ocaml-modules/lablgl/META.patch
new file mode 100644
index 000000000000..bf5b2184ac0a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgl/META.patch
@@ -0,0 +1,18 @@
+diff -r 562eb6ecb8ca META
+--- a/META	Wed Oct 01 20:09:24 2014 +0100
++++ b/META	Wed Oct 01 20:22:15 2014 +0100
+@@ -1,6 +1,5 @@
+-description "Bindings for OpenGL"
++description="Bindings for OpenGL"
+ version="1.05"
+-directory="+lablGL"
+ archive(byte) = "lablgl.cma"
+ archive(native) = "lablgl.cmxa"
+ 
+@@ -16,4 +15,4 @@
+   requires = "lablgl"
+   archive(byte) = "lablglut.cma"
+   archive(native) = "lablglut.cmxa"
+-)
+\ No newline at end of file
++)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch b/nixpkgs/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch
new file mode 100644
index 000000000000..3d880c00947e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch
@@ -0,0 +1,67 @@
+diff -Naur lablGL.ori/Makefile.config lablGL/Makefile.config
+--- lablGL.ori/Makefile.config	1970-01-01 01:00:00.000000000 +0100
++++ lablGL/Makefile.config	2013-06-02 08:13:10.000000000 +0200
+@@ -0,0 +1,63 @@
++#	LablGL and Togl configuration file
++#
++# Please have a look at the config/Makefile in the Objective Caml distribution,
++# or at the labltklink script to get the information needed here
++#
++
++##### Adjust these always
++
++# Uncomment if you have the fast ".opt" compilers
++#CAMLC = ocamlc.opt
++#CAMLOPT = ocamlopt.opt
++
++# Where to put the lablgl script
++BINDIR = @BINDIR@
++
++# Where to find X headers
++XINCLUDES = @XINCLUDES@
++# X libs (for broken RTLD_GLOBAL: e.g. FreeBSD 4.0)
++#XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lX11 -lXi
++
++# Where to find Tcl/Tk headers
++# This must the same version as for LablTk
++TKINCLUDES = @TKINCLUDES@
++# Tcl/Tk libs (for broken RTLD_GLOBAL: e.g. FreeBSD 4.0)
++#TKLIBS = -L/usr/local/lib -ltk84 -ltcl84
++
++# Where to find OpenGL/Mesa/Glut headers and libraries
++GLINCLUDES =
++GLLIBS = -lGL -lGLU
++GLUTLIBS = -lglut
++# The following libraries may be required (try to add them one at a time)
++#GLLIBS = -lGL -lGLU -lXmu -lXext -lXi -lcipher -lpthread
++
++# How to index a library after installing (ranlib required on MacOSX)
++RANLIB = :
++#RANLIB = ranlib
++
++##### Uncomment these for windows
++#TKLIBS = tk83.lib tcl83.lib gdi32.lib user32.lib
++#GLLIBS = opengl32.lib glu32.lib
++#TOOLCHAIN = msvc
++#XA = .lib
++#XB = .bat
++#XE = .exe
++#XO = .obj
++#XS = .dll
++
++##### Adjust these if non standard
++
++# The Objective Caml library directory
++#LIBDIR = `ocamlc -where`
++
++# Where to put dlls (if dynamic loading available)
++DLLDIR = @DLLDIR@
++
++# Where to put LablGL (standard)
++INSTALLDIR = @INSTALLDIR@
++
++# Where is Togl (default)
++#TOGLDIR = Togl
++
++# C Compiler options
++#COPTS = -c -O
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix
new file mode 100644
index 000000000000..abe1649e0094
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut, camlp-streams, darwin } :
+
+if lib.versionOlder ocaml.version "4.06"
+then throw "lablgl is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-lablgl";
+  version = "1.07";
+
+  src = fetchFromGitHub {
+    owner = "garrigue";
+    repo = "lablgl";
+    rev = "v${version}";
+    hash = "sha256-GiQKHMn5zHyvDrA2ve12X5YTm3/RZp8tukIqifgVaW4=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ freeglut camlp-streams ];
+  propagatedBuildInputs = [
+    libGLU
+    libGL
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.GLUT
+    darwin.apple_sdk.libs.Xplugin
+  ];
+
+  patches = [ ./Makefile.config.patch ./META.patch ];
+
+  preConfigure = ''
+    mkdir -p $out/bin
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+    substituteInPlace Makefile.config \
+      --subst-var-by BINDIR $out/bin/ \
+      --subst-var-by INSTALLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl/ \
+      --subst-var-by DLLDIR $out/lib/ocaml/${ocaml.version}/site-lib/stublibs/ \
+      --subst-var-by TKINCLUDES "" \
+      --subst-var-by XINCLUDES ""
+  '';
+
+  buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
+
+  postInstall = ''
+    cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
+  '';
+
+  meta = with lib; {
+    description = "OpenGL bindings for ocaml";
+    homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub vbgl ];
+    mainProgram = "lablglut";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix
new file mode 100644
index 000000000000..6b8ee76985c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-lablgtk-extras";
+  version = "1.4";
+
+  src = fetchurl {
+    url = "http://forge.ocamlcore.org/frs/download.php/1282/lablgtkextras-${version}.tar.gz";
+    sha256 = "09fqxwdib7r9yxynknc9gv3jw2hnhj5cak7q5jngk6m8rzvmhfcc";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib camlp4 ];
+  propagatedBuildInputs = [ config-file lablgtk xmlm ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    platforms = ocaml.meta.platforms or [ ];
+    maintainers = with lib.maintainers; [ vbgl ];
+    homepage = "http://gtk-extras.forge.ocamlcore.org/";
+    description = "Collection of libraries and modules useful when developing OCaml/LablGtk2 applications";
+    license = lib.licenses.lgpl2Plus;
+    branch = "1.4";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix
new file mode 100644
index 000000000000..bca24a9240ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchFromGitLab, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }:
+
+if lib.versionOlder ocaml.version "4.02"
+|| lib.versionAtLeast ocaml.version "4.13"
+then throw "lablgtk-extras is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "1.6";
+  pname = "ocaml${ocaml.version}-lablgtk-extras";
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "lablgtk-extras";
+    rev = "release-${version}";
+    sha256 = "1bbdp5j18s582mmyd7qiaq1p08g2ag4gl7x65pmzahbhg719hjda";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib camlp4 ];
+  propagatedBuildInputs = [ config-file lablgtk xmlm ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    inherit (ocaml.meta) platforms;
+    maintainers = with lib.maintainers; [ vbgl ];
+    homepage = "https://framagit.org/zoggy/lablgtk-extras/";
+    description = "Collection of libraries and modules useful when developing OCaml/LablGtk2 applications";
+    license = lib.licenses.lgpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix
new file mode 100644
index 000000000000..fc3aebd33d23
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, gtksourceview
+, camlp-streams, gnumake42
+}:
+
+let param =
+  let check = lib.versionAtLeast ocaml.version; in
+  if check "4.06" then rec {
+    version = "2.18.13";
+    src = fetchFromGitHub {
+      owner = "garrigue";
+      repo = "lablgtk";
+      rev = version;
+      sha256 = "sha256-69Svno0qLaUifMscnVuPUJlCo9d8Lee+1qiYx34G3Po=";
+    };
+    env = { };
+    buildInputs = [ camlp-streams ];
+  } else if check "3.12" then {
+    version = "2.18.5";
+    src = fetchurl {
+      url = "https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz";
+      sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib";
+    };
+    # Workaround build failure on -fno-common toolchains like upstream
+    # gcc-10. Otherwise build fails as:
+    #   ld: ml_gtktree.o:(.bss+0x0): multiple definition of
+    #     `ml_table_extension_events'; ml_gdkpixbuf.o:(.bss+0x0): first defined here
+    env.NIX_CFLAGS_COMPILE = "-fcommon";
+  } else throw "lablgtk is not available for OCaml ${ocaml.version}";
+in
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-lablgtk";
+  inherit (param) version src env;
+
+  # gnumake42: https://github.com/garrigue/lablgtk/issues/162
+  nativeBuildInputs = [ pkg-config ocaml findlib gnumake42 ];
+  buildInputs = [ gtk2 libgnomecanvas gtksourceview ]
+  ++ param.buildInputs or [];
+
+  configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ];
+  buildFlags = [ "world" ];
+
+  preInstall = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib
+    export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH
+  '';
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "OCaml interface to GTK";
+    homepage = "http://lablgtk.forge.ocamlcore.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ maggesi roconnor vbgl ];
+    mainProgram = "lablgtk2";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix
new file mode 100644
index 000000000000..371372579598
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchurl, fetchpatch, pkg-config, buildDunePackage, dune-configurator
+, gtk3, cairo2
+, camlp-streams
+}:
+
+buildDunePackage rec {
+  version = "3.1.4";
+  pname = "lablgtk3";
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/garrigue/lablgtk/releases/download/${version}/lablgtk3-${version}.tbz";
+    hash = "sha256-bxEVMzfnaH5yHVxAmifNYOy8GnSivLLgSE/9+1yxBI4=";
+  };
+
+  # Fix build with clang 16
+  # See: https://github.com/garrigue/lablgtk/pull/175
+  patches = fetchpatch {
+    url = "https://github.com/garrigue/lablgtk/commit/a9b64b9ed8a13855c672cde0a2d9f78687f4214b.patch";
+    hash = "sha256-j/L+yYKLlj410jx2VG77hnn9SVHCcSzmr3wpOMZhX5w=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator camlp-streams ];
+  propagatedBuildInputs = [ gtk3 cairo2 ];
+
+  meta = {
+    description = "OCaml interface to GTK 3";
+    homepage = "http://lablgtk.forge.ocamlcore.org/";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix
new file mode 100644
index 000000000000..be57c7e7146f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix
@@ -0,0 +1,8 @@
+{ buildDunePackage, gtkspell3, lablgtk3 }:
+
+buildDunePackage {
+  pname = "lablgtk3-gtkspell3";
+  buildInputs = [ gtkspell3 ] ++ lablgtk3.buildInputs;
+  propagatedBuildInputs = [ lablgtk3 ];
+  inherit (lablgtk3) src version meta nativeBuildInputs;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/rsvg2.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/rsvg2.nix
new file mode 100644
index 000000000000..463f50f18e62
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/rsvg2.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage
+, dune-configurator
+, lablgtk3
+, librsvg
+, pkg-config
+}:
+
+buildDunePackage rec {
+  pname = "lablgtk3-rsvg2";
+
+  inherit (lablgtk3) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ lablgtk3 librsvg ];
+
+  meta = lablgtk3.meta // {
+    description = "OCaml interface to Gnome rsvg2 library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix
new file mode 100644
index 000000000000..0e8ba3ef3ffe
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix
@@ -0,0 +1,8 @@
+{ buildDunePackage, gtksourceview, lablgtk3 }:
+
+buildDunePackage {
+  pname = "lablgtk3-sourceview3";
+  buildInputs = lablgtk3.buildInputs ++ [ gtksourceview ];
+  propagatedBuildInputs = [ lablgtk3 ];
+  inherit (lablgtk3) src version meta nativeBuildInputs;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix
new file mode 100644
index 000000000000..465c82da1210
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix
@@ -0,0 +1,92 @@
+{ stdenv, lib, makeWrapper, fetchzip, Cocoa, ocaml, findlib, tcl, tk }:
+
+let
+ params =
+  let mkNewParam = { version, sha256, rev ? version }: {
+    inherit version;
+    src = fetchzip {
+      url = "https://github.com/garrigue/labltk/archive/${rev}.tar.gz";
+      inherit sha256;
+    };
+  }; in
+ rec {
+  "4.06" = mkNewParam {
+    version = "8.06.4";
+    rev = "labltk-8.06.4";
+    sha256 = "03xwnnnahb2rf4siymzqyqy8zgrx3h26qxjgbp5dh1wdl7n02c7g";
+  };
+  "4.07" = mkNewParam {
+    version = "8.06.5";
+    rev = "1b71e2c6f3ae6847d3d5e79bf099deb7330fb419";
+    sha256 = "02vchmrm3izrk7daldd22harhgrjhmbw6i1pqw6hmfmrmrypypg2";
+  };
+  _8_06_7 = mkNewParam {
+    version = "8.06.7";
+    sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h";
+  };
+  "4.08" = _8_06_7;
+  "4.09" = _8_06_7;
+  "4.10" = mkNewParam {
+    version = "8.06.8";
+    sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw";
+  };
+  "4.11" = mkNewParam {
+    version = "8.06.9";
+    sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0";
+  };
+  "4.12" = mkNewParam {
+    version = "8.06.10";
+    sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a";
+  };
+  "4.13" = mkNewParam {
+    version = "8.06.11";
+    sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy";
+  };
+  "4.14" = mkNewParam {
+    version = "8.06.12";
+    sha256 = "sha256:17fmb13l18isgwr38hg9r5a0nayf2hhw6acj5153cy1sygsdg3b5";
+  };
+  "5.0" = mkNewParam {
+    version = "8.06.13";
+    sha256 = "sha256-Vpf13g3DEWlUI5aypiowGp2fkQPK0cOGv2XiRUY/Ip4=";
+  };
+ };
+ param = params . ${lib.versions.majorMinor ocaml.version}
+   or (throw "labltk is not available for OCaml ${ocaml.version}");
+in
+
+stdenv.mkDerivation rec {
+  inherit (param) version src;
+  pname = "ocaml${ocaml.version}-labltk";
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib makeWrapper ];
+  buildInputs = [ tcl tk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ];
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  buildFlags = [ "all" "opt" ];
+
+  createFindlibDestdir = true;
+
+  postInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR/stublibs
+    mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/
+    for p in $out/bin/*
+    do
+      wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs
+    done
+  '';
+
+  meta = {
+    description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser";
+    homepage = "http://labltk.forge.ocamlcore.org/";
+    license = lib.licenses.lgpl21;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lacaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lacaml/default.nix
new file mode 100644
index 000000000000..04880bca3ac5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lacaml/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, darwin, buildDunePackage, dune-configurator
+, lapack, blas
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+buildDunePackage rec {
+  pname = "lacaml";
+  version = "11.0.10";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/lacaml/releases/download/${version}/lacaml-${version}.tbz";
+    sha256 = "sha256-Vg6Hl31u1bvh0hfWU9eqoI8pGZt4YhpGRf3ul3h+SJk=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ lapack blas ] ++
+    lib.optionals stdenv.isDarwin
+      [ darwin.apple_sdk.frameworks.Accelerate ];
+
+  meta = with lib; {
+    homepage = "https://mmottl.github.io/lacaml";
+    description = "OCaml bindings for BLAS and LAPACK";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ladspa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ladspa/default.nix
new file mode 100644
index 000000000000..b037a61a0fb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ladspa/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ladspaH }:
+
+buildDunePackage rec {
+  pname = "ladspa";
+  version = "0.2.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ladspa";
+    rev = "v${version}";
+    sha256 = "1y83infjaz9apzyvaaqw331zqdysmn3bpidfab061v3bczv4jzbz";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ladspaH ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-alsa";
+    description = "Bindings for the LADSPA API which provides audio effects";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix
new file mode 100644
index 000000000000..2846ff128451
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix
@@ -0,0 +1,51 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, zed, lwt_log, lwt_react, mew_vi, uucp, logs }:
+
+let params =
+  if lib.versionAtLeast ocaml.version "4.08" then {
+    version = "3.3.2";
+    sha256 = "sha256-T2DDpHqLar1sgmju0PLvhAZef5VzOpPWcFVhuZlPQmM=";
+  } else {
+    version = "3.1.0";
+    sha256 = "1k0ykiz0vhpyyj9fkss29ajas4fh1xh449j702xkvayqipzj1mkg";
+  }
+; in
+
+buildDunePackage rec {
+  pname = "lambda-term";
+  inherit (params) version;
+
+  duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "2";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    inherit (params) sha256;
+  };
+
+  propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ]
+    ++ lib.optionals (lib.versionAtLeast version "3.3.1") [ uucp logs ] ;
+
+  meta = {
+    description = "Terminal manipulation library for OCaml";
+    longDescription = ''
+    Lambda-term is a cross-platform library for
+    manipulating the terminal. It provides an abstraction for keys,
+    mouse events, colors, as well as a set of widgets to write
+    curses-like applications.
+
+    The main objective of lambda-term is to provide a higher level
+    functional interface to terminal manipulation than, for example,
+    ncurses, by providing a native OCaml interface instead of bindings to
+    a C library.
+
+    Lambda-term integrates with zed to provide text edition facilities in
+    console applications.
+    '';
+
+    inherit (src.meta) homepage;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.gal_bolle ];
+    mainProgram = "lambda-term-actions";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lambdapi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lambdapi/default.nix
new file mode 100644
index 000000000000..f4d1cdb717b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lambdapi/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, alcotest
+, dedukti
+, bindlib
+, camlp-streams
+, cmdliner
+, menhir
+, pratter
+, sedlex
+, stdlib-shims
+, timed
+, why3
+, yojson
+}:
+
+buildDunePackage rec {
+  pname = "lambdapi";
+  version = "2.3.1";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/Deducteam/lambdapi/releases/download/${version}/lambdapi-${version}.tbz";
+    hash = "sha256-7ww2TjVcbEQyfmLnnEhLGAjW4US9a4mdOfDJw6NR1fI=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [
+    bindlib camlp-streams cmdliner pratter sedlex stdlib-shims timed why3 yojson
+  ];
+
+  checkInputs = [ alcotest dedukti ];
+  doCheck = false; # anomaly: Sys_error("/homeless-shelter/.why3.conf: No such file or directory")
+
+  meta = with lib; {
+    homepage = "https://github.com/Deducteam/lambdapi";
+    description = "Proof assistant based on the λΠ-calculus modulo rewriting";
+    license = licenses.cecill21;
+    changelog = "https://github.com/Deducteam/lambdapi/raw/${version}/CHANGES.md";
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix
new file mode 100644
index 000000000000..a5b61880da7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, camlp-streams, markup, ounit2 }:
+
+buildDunePackage rec {
+  pname = "lambdasoup";
+  version = "1.0.0";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = pname;
+    rev = version;
+    hash = "sha256-PZkhN5vkkLu8A3gYrh5O+nq9wFtig0Q4qD8zLGUGTRI=";
+  };
+
+  propagatedBuildInputs = [ camlp-streams markup ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit2 ];
+
+  meta = {
+    description = "Functional HTML scraping and rewriting with CSS in OCaml";
+    homepage = "https://aantron.github.io/lambdasoup/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lame/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lame/default.nix
new file mode 100644
index 000000000000..2e23a3715dac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lame/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, pkg-config, dune-configurator, lame }:
+
+buildDunePackage rec {
+  pname = "lame";
+  version = "0.3.7";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-lame";
+    rev = "v${version}";
+    sha256 = "sha256-/ZzoGFQQrBf17TaBPSFDQ1yHaQnva56YLmscOacrKBI=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ lame ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-lame";
+    description = "Bindings for the lame library which provides functions for encoding mp3 files";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/landmarks-ppx/default.nix b/nixpkgs/pkgs/development/ocaml-modules/landmarks-ppx/default.nix
new file mode 100644
index 000000000000..f15c86b9e1f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/landmarks-ppx/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, ocaml, landmarks, ppxlib }:
+
+buildDunePackage {
+  pname = "landmarks-ppx";
+  minimalOCamlVersion = "4.08";
+
+  inherit (landmarks) src version;
+
+  buildInputs = [ ppxlib ];
+  propagatedBuildInputs = [ landmarks ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08"
+    && lib.versionOlder ocaml.version "5.0";
+
+  meta = landmarks.meta // {
+    description = "Preprocessor instrumenting code using the landmarks library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/landmarks/default.nix b/nixpkgs/pkgs/development/ocaml-modules/landmarks/default.nix
new file mode 100644
index 000000000000..e25bf1ae7904
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/landmarks/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+
+buildDunePackage {
+  pname = "landmarks";
+  version = "1.4";
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "LexiFi";
+    repo = "landmarks";
+    rev = "b0c753cd2a4c4aa00dffdd3be187d8ed592fabf7";
+    hash = "sha256-Wpr76JURUFrj7v39rdM/2Lr7boa7nL/bnPEz1vMrmQo";
+  };
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08"
+    && lib.versionOlder ocaml.version "5.0";
+
+  meta = with lib; {
+    description = "Simple Profiling Library for OCaml";
+    maintainers = [ maintainers.kenran ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lastfm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lastfm/default.nix
new file mode 100644
index 000000000000..807589e19b57
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lastfm/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, pkg-config
+, dune-configurator
+, re
+, xmlplaylist
+}:
+
+buildDunePackage rec {
+  pname = "lastfm";
+  version = "0.3.4";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-lastfm";
+    rev = "v${version}";
+    sha256 = "sha256-1te9B2+sUmkT/i2K5ueswWAWpvJf9rXob0zR4CMOJlg=";
+  };
+
+  propagatedBuildInputs = [
+    re
+    xmlplaylist
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-lastfm";
+    description = "OCaml API to lastfm radio and audioscrobbler";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lem/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lem/default.nix
new file mode 100644
index 000000000000..1e797cbb7cb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lem/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, ncurses
+, makeWrapper
+, ocamlbuild
+, findlib
+, ocaml
+, num
+, zarith
+}:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
+  "lem is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-lem";
+  version = "2022-12-10";
+
+  src = fetchFromGitHub {
+    owner = "rems-project";
+    repo = "lem";
+    rev = version;
+    hash = "sha256-ZQgcuIVRkJS0KtpzjbO4OPHGg6B0TadWA6XpRir30y8=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ocamlbuild findlib ocaml ];
+  propagatedBuildInputs = [ zarith num ];
+
+  installFlags = [ "INSTALL_DIR=$(out)" ];
+
+  createFindlibDestdir = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/lem --set LEMLIB $out/share/lem/library
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/rems-project/lem";
+    description = "Tool for lightweight executable mathematics";
+    mainProgram = "lem";
+    maintainers = with maintainers; [ genericnerdyusername ];
+    license = with licenses; [ bsd3 gpl2 ];
+    platforms = ocaml.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lens/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lens/default.nix
new file mode 100644
index 000000000000..0de5773a5975
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lens/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, ppx_deriving, ppxlib, buildDunePackage, ounit }:
+
+buildDunePackage rec {
+  pname = "lens";
+  version = "1.2.5";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "pdonadeo";
+    repo = "ocaml-lens";
+    rev = "v${version}";
+    sha256 = "1k23n7pa945fk6nbaq6nlkag5kg97wsw045ghz4gqp8b9i2im3vn";
+  };
+
+  minimalOCamlVersion = "4.10";
+  buildInputs = [ ppx_deriving ppxlib ];
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  meta = with lib; {
+    homepage = "https://github.com/pdonadeo/ocaml-lens";
+    description = "Functional lenses";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [
+      kazcw
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/app.nix b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/app.nix
new file mode 100644
index 000000000000..0b20eb5c3e6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/app.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildDunePackage
+, letsencrypt
+, letsencrypt-dns
+, cmdliner
+, cohttp-lwt-unix
+, logs
+, fmt
+, lwt
+, mirage-crypto-rng
+, ptime
+, bos
+, fpath
+, randomconv
+, cstruct
+}:
+
+buildDunePackage {
+  pname = "letsencrypt-app";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  inherit (letsencrypt)
+    src
+    version
+    ;
+
+  buildInputs = [
+    letsencrypt
+    letsencrypt-dns
+    cmdliner
+    cohttp-lwt-unix
+    logs
+    fmt
+    lwt
+    mirage-crypto-rng
+    ptime
+    bos
+    fpath
+    randomconv
+    cstruct
+  ];
+
+  meta = letsencrypt.meta // {
+    description = "ACME client implementation of the ACME protocol (RFC 8555) for OCaml";
+    mainProgram = "oacmel";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix
new file mode 100644
index 000000000000..3eb8c2c08b55
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix
@@ -0,0 +1,63 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, asn1-combinators
+, uri
+, base64
+, logs
+, fmt
+, lwt
+, mirage-crypto
+, mirage-crypto-ec
+, mirage-crypto-pk
+, mirage-crypto-rng
+, x509
+, yojson
+, ounit
+, ptime
+, domain-name
+, cstruct
+}:
+
+buildDunePackage rec {
+  pname = "letsencrypt";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "https://github.com/mmaker/ocaml-letsencrypt/releases/download/v${version}/letsencrypt-${version}.tbz";
+    hash = "sha256-uQOHpdyPg5kms+negxpQMxfhow6auZ0ipt5ksoXYo1w=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  buildInputs = [
+    fmt
+    ptime
+    domain-name
+  ];
+
+  propagatedBuildInputs = [
+    logs
+    yojson
+    lwt
+    base64
+    mirage-crypto
+    mirage-crypto-ec
+    mirage-crypto-pk
+    asn1-combinators
+    x509
+    uri
+    cstruct
+  ];
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "ACME implementation in OCaml";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.sternenseemann ];
+    homepage = "https://github.com/mmaker/ocaml-letsencrypt";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/dns.nix b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/dns.nix
new file mode 100644
index 000000000000..4f2f04843163
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/dns.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildDunePackage
+, letsencrypt
+, logs
+, fmt
+, lwt
+, dns
+, dns-tsig
+, domain-name
+}:
+
+buildDunePackage {
+  pname = "letsencrypt-dns";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  inherit (letsencrypt)
+    version
+    src
+    ;
+
+  propagatedBuildInputs = [
+    letsencrypt
+    dns
+    dns-tsig
+    domain-name
+    logs
+    lwt
+    fmt
+  ];
+
+  meta = letsencrypt.meta // {
+    description = "DNS solver for the ACME implementation in OCaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/mirage.nix
new file mode 100644
index 000000000000..f43ab9812c7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/mirage.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage
+, letsencrypt
+, emile
+, http-mirage-client
+, paf
+}:
+
+buildDunePackage {
+  pname = "letsencrypt-mirage";
+
+  inherit (letsencrypt) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ emile http-mirage-client letsencrypt paf ];
+
+  meta = letsencrypt.meta // {
+    description = "ACME implementation in OCaml for MirageOS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/libc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/libc/default.nix
new file mode 100644
index 000000000000..13e0f04ddfc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/libc/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, config
+}:
+
+buildDunePackage rec {
+  pname = "libc";
+  version = "0.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-sys/libc.ml/releases/download/${version}/libc-${version}.tbz";
+    hash = "sha256-e5x5Yae7V6qOpq+aLZaV+6L9ldy9qDqd9Kc8nkAsENg=";
+  };
+
+  buildInputs = [
+    config
+  ];
+
+  meta = {
+    description = "Raw definitions and bindings to platforms system libraries";
+    homepage = "https://github.com/ocaml-sys/libc.ml";
+    license = lib.licenses.mit;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lilv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lilv/default.nix
new file mode 100644
index 000000000000..a5def260eb29
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lilv/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ctypes, ctypes-foreign, lilv }:
+
+buildDunePackage rec {
+  pname = "lilv";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-lilv";
+    rev = "v${version}";
+    sha256 = "080ja8c4sxprk5qnldpfzxriag57m9603vny3b4bnwh5xm1id08c";
+  };
+
+  minimalOCamlVersion = "4.03.0";
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ctypes ctypes-foreign lilv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-lilv";
+    description = "OCaml bindings for lilv";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix b/nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix
new file mode 100644
index 000000000000..96d00c28fce6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, result }:
+
+buildDunePackage rec {
+  pname = "linenoise";
+  version = "1.5.1";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "fxfactorial";
+    repo = "ocaml-${pname}";
+    rev = "v${version}";
+    sha256 = "sha256-yWBWMbk1anXaF4hIakTOcRZFCYmxI0xG3bHFFOAyEDA=";
+  };
+
+  propagatedBuildInputs = [ result ];
+
+  meta = {
+    description = "OCaml bindings to linenoise";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/linksem/default.nix b/nixpkgs/pkgs/development/ocaml-modules/linksem/default.nix
new file mode 100644
index 000000000000..2e88c7f0d45f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/linksem/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, fetchFromGitHub
+, stdenv
+, findlib
+, ocaml
+, lem
+}:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
+  "linksem is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-linksem";
+  version = "0.8";
+
+  src = fetchFromGitHub {
+    owner = "rems-project";
+    repo = "linksem";
+    rev = version;
+    hash = "sha256-7/YfDK3TruKCckMzAPLRrwBkHRJcX1S+AzXHWRxkZPA=";
+  };
+
+  nativeBuildInputs = [ findlib ocaml ];
+
+  propagatedBuildInputs = [ lem ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/rems-project/linksem";
+    description = "Formalisation of substantial parts of ELF linking and DWARF debug information";
+    maintainers = with maintainers; [ genericnerdyusername ];
+    license = licenses.bsd2;
+    platforms = ocaml.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/linol/default.nix b/nixpkgs/pkgs/development/ocaml-modules/linol/default.nix
new file mode 100644
index 000000000000..28f2bc105d15
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/linol/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, fetchpatch, buildDunePackage, yojson, logs, lsp, ppx_yojson_conv_lib, trace }:
+
+buildDunePackage
+rec {
+  pname = "linol";
+  version = "0.5";
+
+  minimalOCamlVersion = "4.14";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "linol";
+    rev = "v${version}";
+    hash = "sha256-ULPOB/hb+2VXDB/eK66WDDh/wj0bOwUt0tZsiIXqndo=";
+  };
+
+  patches = fetchpatch {
+    url = "https://github.com/c-cube/linol/commit/d8ebcf9a60f1e7251d14cdcd0b2ebd5b7f8eec6d.patch";
+    hash = "sha256-JHR0P0X3ep5HvDWW43dMb452/WsFKS4e+5Qhk4MzaxQ=";
+  };
+
+  propagatedBuildInputs = [ yojson logs lsp ppx_yojson_conv_lib trace ];
+
+  meta = with lib; {
+    description = "LSP server library";
+    license = licenses.mit;
+    maintainers = [ maintainers.ulrikstrid ];
+    homepage = "https://github.com/c-cube/linol";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/linol/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/linol/lwt.nix
new file mode 100644
index 000000000000..67b0b7b07fbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/linol/lwt.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, linol, jsonrpc, lwt, yojson }:
+
+buildDunePackage {
+  pname = "linol-lwt";
+  inherit (linol) version src;
+
+  propagatedBuildInputs = [
+    linol
+    jsonrpc
+    lwt
+    yojson
+  ];
+
+  meta = linol.meta // {
+    description = "LSP server library (with Lwt for concurrency)";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix
new file mode 100644
index 000000000000..948d326d6594
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, python3, cmake, libllvm, ocaml, findlib, ctypes }:
+
+let version = lib.getVersion libllvm; in
+
+stdenv.mkDerivation {
+  pname = "ocaml-llvm";
+  inherit version;
+
+  inherit (libllvm) src;
+
+  nativeBuildInputs = [ cmake python3 ocaml findlib ];
+  buildInputs = [ ctypes ];
+  propagatedBuildInputs = [ libllvm ];
+
+  strictDeps = true;
+
+  preConfigure = lib.optionalString (lib.versionAtLeast version "13.0.0") ''
+    cd llvm
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=YES" # fixes bytecode builds
+    "-DLLVM_OCAML_OUT_OF_TREE=TRUE"
+    "-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml"
+    "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${lib.getLib libllvm}/lib"
+  ];
+
+  buildFlags = [ "ocaml_all" ];
+
+  installFlags = [ "-C" "bindings/ocaml" ];
+
+  postInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR/
+    mv $out/ocaml $OCAMLFIND_DESTDIR/llvm
+    mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
+    mv $OCAMLFIND_DESTDIR/llvm/stublibs $OCAMLFIND_DESTDIR/stublibs
+  '';
+
+  passthru = {
+    inherit libllvm;
+  };
+
+  meta = {
+    inherit (libllvm.meta) license homepage;
+    inherit (ocaml.meta) platforms;
+    description = "OCaml bindings distributed with LLVM";
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lo/default.nix
new file mode 100644
index 000000000000..6da5854f9de2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lo/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, liblo }:
+
+buildDunePackage rec {
+  pname = "lo";
+  version = "0.2.0";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-lo";
+    rev = "v${version}";
+    sha256 = "0mi8h6f6syxjkxz493l5c3l270pvxx33pz0k3v5465wqjsnppar2";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ liblo ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-lo";
+    description = "Bindings for LO library";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/logs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/logs/default.nix
new file mode 100644
index 000000000000..bd7326883829
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/logs/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild
+, topkg, result, lwt, cmdliner, fmt
+, fmtSupport ? lib.versionAtLeast ocaml.version "4.08"
+, js_of_ocaml
+, jsooSupport ? true
+, lwtSupport ? true
+, cmdlinerSupport ? true
+}:
+let
+  pname = "logs";
+  webpage = "https://erratique.ch/software/${pname}";
+
+  optional_deps = [
+    { pkg = js_of_ocaml; enable_flag = "--with-js_of_ocaml"; enabled = jsooSupport; }
+    { pkg = fmt; enable_flag = "--with-fmt"; enabled = fmtSupport; }
+    { pkg = lwt; enable_flag = "--with-lwt"; enabled = lwtSupport; }
+    { pkg = cmdliner; enable_flag = "--with-cmdliner"; enabled = cmdlinerSupport; }
+  ];
+  enable_flags =
+    lib.concatMap (d: [ d.enable_flag (lib.boolToString d.enabled)]) optional_deps;
+  optional_buildInputs =
+    map (d: d.pkg) (lib.filter (d: d.enabled) optional_deps);
+in
+
+if lib.versionOlder ocaml.version "4.03"
+then throw "logs is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "0.7.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1jnmd675wmsmdwyb5mx5b0ac66g4c6gpv5s4mrx2j6pb0wla1x46";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ] ++ optional_buildInputs;
+  propagatedBuildInputs = [ result ];
+
+  strictDeps = true;
+
+  buildPhase = "${topkg.run} build ${lib.escapeShellArgs enable_flags}";
+
+  inherit (topkg) installPhase;
+
+  meta = with lib; {
+    description = "Logging infrastructure for OCaml";
+    homepage = webpage;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.sternenseemann ];
+    license = licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lru/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lru/default.nix
new file mode 100644
index 000000000000..2c8a3e99df57
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lru/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, ocaml, psq, qcheck-alcotest }:
+
+buildDunePackage rec {
+  pname = "lru";
+  version = "0.3.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/lru/releases/download/v${version}/lru-${version}.tbz";
+    hash = "sha256-bL4j0np9WyRPhpwLiBQNR/cPQTpkYu81wACTJdSyNv0=";
+  };
+
+  propagatedBuildInputs = [ psq ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ qcheck-alcotest ];
+
+  meta = {
+    homepage = "https://github.com/pqwy/lru";
+    description = "Scalable LRU caches for OCaml";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix
new file mode 100644
index 000000000000..bec9b9a998dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }:
+
+if lib.versionOlder ocaml.version "4.07"
+then throw "lua-ml is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "lua-ml";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "0.9.2";
+
+  src = fetchFromGitHub {
+    owner = "lindig";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-xkjsjKD89W7Y5XK8kfL/ZErYKS14z0u0QCARN0DbTC8=";
+  };
+
+  nativeBuildInputs = [ opaline ocaml findlib ocamlbuild ];
+
+  strictDeps = true;
+
+  buildFlags = [ "lib" ];
+
+  installPhase = ''
+    opaline -prefix $out -libdir $OCAMLFIND_DESTDIR
+  '';
+
+  meta = {
+    description = "Embeddable Lua 2.5 interpreter implemented in OCaml";
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lun/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lun/default.nix
new file mode 100644
index 000000000000..c7303d0a0081
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lun/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "lun";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.12.0";
+
+  src = fetchurl {
+    url = "https://github.com/robur-coop/lun/releases/download/v${version}/lun-${version}.tbz";
+    hash = "sha256-zKi63/g7Rw/c+xhAEW+Oim8suGzeL0TtKM8my/aSp5M=";
+  };
+
+  meta = {
+    description = "Optics in OCaml";
+    homepage = "https://git.robur.coop/robur/lun";
+    license = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lun/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/lun/ppx.nix
new file mode 100644
index 000000000000..d4212a3d9595
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lun/ppx.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, fmt, lun, ppxlib }:
+
+buildDunePackage {
+  pname = "ppx_lun";
+  inherit (lun) version src;
+
+  propagatedBuildInputs = [ lun ppxlib ];
+
+  checkInputs = [ fmt ];
+
+  doCheck = true;
+
+  meta = lun.meta // {
+    description = "Optics with lun package and PPX";
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lustre-v6/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lustre-v6/default.nix
new file mode 100644
index 000000000000..d4ecdc7e2881
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lustre-v6/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl, extlib, lutils, rdbg, yaml }:
+
+buildDunePackage rec {
+  pname = "lustre-v6";
+  version = "6.107.4";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/lustre-v6.v${version}.tgz";
+    hash = "sha256-baT5ZJtg5oFoJ5eHb3ISsmY6G31UG10KlNXC+ta+M1c=";
+  };
+
+  propagatedBuildInputs = [
+    extlib
+    lutils
+    rdbg
+    yaml
+  ];
+
+  meta = with lib; {
+    description = "Lustre V6 compiler";
+    homepage = "https://www-verimag.imag.fr/lustre-v6.html";
+    license = licenses.cecill21;
+    maintainers = with maintainers; [ delta wegank ];
+    mainProgram = "lv6";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lutils/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lutils/default.nix
new file mode 100644
index 000000000000..38bd10077ce0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lutils/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, camlp-streams, num }:
+
+buildDunePackage rec {
+  pname = "lutils";
+  version = "1.54.1";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/lutils.v${version}.tgz";
+    hash = "sha512:d3c3b80286b1aa236ba922d9e18a133721fc80126c8b89520fb811dce9400e217aaa75b5d49e03988be7f6bf5f2e1a391d02ceeaa5ec0a0cd5ce218083a29514";
+  };
+
+  propagatedBuildInputs = [
+    camlp-streams num
+  ];
+
+  meta = with lib; {
+    homepage = "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/";
+    description = "Tools and libs shared by Verimag/synchronous tools (lustre, lutin, rdbg)";
+    changelog = "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/-/releases/v${version}";
+    license = lib.licenses.cecill21;
+    mainProgram = "gnuplot-rif";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/luv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/luv/default.nix
new file mode 100644
index 000000000000..3f2d462fd15e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/luv/default.nix
@@ -0,0 +1,37 @@
+{ lib, buildDunePackage, ocaml, fetchurl
+, ctypes, result
+, alcotest
+, file
+}:
+
+buildDunePackage rec {
+  pname = "luv";
+  version = "0.5.12";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/aantron/luv/releases/download/${version}/luv-${version}.tar.gz";
+    sha256 = "sha256-dp9qCIYqSdROIAQ+Jw73F3vMe7hnkDe8BgZWImNMVsA=";
+  };
+
+  postConfigure = ''
+    for f in src/c/vendor/configure/{ltmain.sh,configure}; do
+      substituteInPlace "$f" --replace /usr/bin/file file
+    done
+  '';
+
+  nativeBuildInputs = [ file ];
+  propagatedBuildInputs = [ ctypes result ];
+  checkInputs = [ alcotest ];
+  # Alcotest depends on fmt that needs 4.08 or newer
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    homepage = "https://github.com/aantron/luv";
+    description = "Binding to libuv: cross-platform asynchronous I/O";
+    # MIT-licensed, extra licenses apply partially to libuv vendor
+    license = with licenses; [ mit bsd2 bsd3 cc-by-sa-40 ];
+    maintainers = with maintainers; [ locallycompact sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwd/default.nix
new file mode 100644
index 000000000000..43e13bbcc893
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwd/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage, seq }:
+
+buildDunePackage rec {
+  pname = "lwd";
+  version = "0.3";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url =
+      "https://github.com/let-def/lwd/releases/download/v${version}/lwd-${version}.tbz";
+    sha256 = "sha256-H/vyW2tn2OBuWwcmPs8NcINXgFe93MSxRd8dzeoXARI=";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  meta = with lib; {
+    description = "Lightweight reactive documents";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/let-def/lwd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix
new file mode 100644
index 000000000000..09a4a8ba228e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-lwt.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, lwd, lwt, nottui }:
+
+buildDunePackage {
+  pname = "nottui-lwt";
+
+  inherit (lwd) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ lwt nottui ];
+
+  meta = with lib; {
+    description = "Run Nottui UIs in Lwt";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/let-def/lwd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix
new file mode 100644
index 000000000000..ac9b18ff3b4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui-pretty.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, lwd, nottui }:
+
+buildDunePackage {
+  pname = "nottui-pretty";
+
+  inherit (lwd) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ nottui ];
+
+  meta = with lib; {
+    description = "Pretty-printer based on PPrint rendering UIs";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/let-def/lwd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui.nix b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui.nix
new file mode 100644
index 000000000000..bffab13a5e1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwd/nottui.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, lwd, notty }:
+
+buildDunePackage {
+  pname = "nottui";
+
+  inherit (lwd) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ lwd notty ];
+
+  meta = with lib; {
+    description = "UI toolkit for the terminal built on top of Notty and Lwd";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/let-def/lwd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix b/nixpkgs/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix
new file mode 100644
index 000000000000..f391eba7d622
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwd/tyxml-lwd.nix
@@ -0,0 +1,25 @@
+{ lib, fetchpatch, buildDunePackage, js_of_ocaml, js_of_ocaml-ppx, lwd, tyxml }:
+
+buildDunePackage {
+  pname = "tyxml-lwd";
+
+  inherit (lwd) version src;
+
+  # Compatibility with latest Tyxml (4.6.x)
+  patches = fetchpatch {
+    url = "https://github.com/let-def/lwd/commit/7f3364ec593b5ccf0d0294b97bcd1e28e4164691.patch";
+    hash = "sha256-W1HjExZxDKRwsrB9ZTkvHTMKO0K5iZl+FrNqPs6BPGU=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [ js_of_ocaml-ppx ];
+  propagatedBuildInputs = [ js_of_ocaml lwd tyxml ];
+
+  meta = with lib; {
+    description = "Make reactive webpages in Js_of_ocaml using Tyxml and Lwd";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/let-def/lwd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt-canceler/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-canceler/default.nix
new file mode 100644
index 000000000000..97b27157265e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt-canceler/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitLab, buildDunePackage, lwt }:
+
+buildDunePackage rec {
+  pname = "lwt-canceler";
+  version = "0.3";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "lwt-canceler";
+    rev = "v${version}";
+    sha256 = "1xbb7012hp901b755kxmfgg293rz34rkhwzg2z9i6sakwd7i0h9p";
+  };
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    lwt
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/nomadic-labs/lwt-canceler";
+    description = "Cancellation synchronization object";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt-dllist/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-dllist/default.nix
new file mode 100644
index 000000000000..b28981b1b779
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt-dllist/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, lwt, ocaml }:
+
+buildDunePackage rec {
+  pname = "lwt-dllist";
+  version = "1.0.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "e86ce75e40f00d51514cf8b2e71e5184c4cb5dae96136be24613406cfc0dba6e";
+  };
+
+  checkInputs = [
+    lwt
+  ];
+  doCheck = lib.versionAtLeast ocaml.version "4.03";
+
+  meta = with lib; {
+    description = "Mutable doubly-linked list with Lwt iterators";
+    homepage = "https://github.com/mirage/lwt-dllist";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt-exit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-exit/default.nix
new file mode 100644
index 000000000000..52bcc0ab2de3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt-exit/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, lwt
+, ptime
+}:
+
+buildDunePackage rec {
+  pname = "lwt-exit";
+  version = "1.0";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = pname;
+    rev = version;
+    sha256 = "1k763bmj1asj9ijar39rh3h1d59rckmsf21h2y8966lgglsf42bd";
+  };
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    lwt
+    ptime
+  ];
+
+  # for some reason this never exits
+  doCheck = false;
+
+  meta = {
+    description = "Opinionated clean-exit and signal-handling library for Lwt programs";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt-watcher/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-watcher/default.nix
new file mode 100644
index 000000000000..db94ce3d62d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt-watcher/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, lwt
+}:
+
+buildDunePackage rec {
+  pname = "lwt-watcher";
+  version = "0.2";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-35Z73bSzEEgTabNH2cD9lRdDczsyIMZR2ktyKx4aN9k=";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    lwt
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "One-to-many broadcast in Lwt";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix
new file mode 100644
index 000000000000..de8252c55549
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, camlp4 }:
+
+buildDunePackage rec {
+  pname = "lwt_camlp4";
+  version = "unstable-2018-03-25";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = "45f25a081e01071ab566924b48ba5f7553bb33ac";
+    sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9";
+  };
+
+  duneVersion = "1";
+
+  minimalOCamlVersion = "4.02";
+
+  nativeBuildInputs = [ camlp4 ];
+  propagatedBuildInputs = [ camlp4 ];
+
+  preBuild = "rm META.lwt_camlp4";
+
+  meta = {
+    description = "Camlp4 syntax extension for Lwt (deprecated)";
+    license = lib.licenses.lgpl21;
+    inherit (src.meta) homepage;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix
new file mode 100644
index 000000000000..61cf05151a30
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, libev, buildDunePackage
+, ocaml, cppo, dune-configurator, ocplib-endian
+}:
+
+buildDunePackage rec {
+  pname = "lwt";
+  version = "5.7.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "lwt";
+    rev = version;
+    hash = "sha256-o0wPK6dPdnsr/LzwcSwbIGcL85wkDjdFuEcAxuS/UEs=";
+  };
+
+  nativeBuildInputs = [ cppo ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libev ocplib-endian ];
+
+  meta = {
+    homepage = "https://ocsigen.org/lwt/";
+    description = "Cooperative threads library for OCaml";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix
new file mode 100644
index 000000000000..2881560c6f8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix
@@ -0,0 +1,30 @@
+{ fetchFromGitHub, buildDunePackage, lwt, ppxlib }:
+
+buildDunePackage {
+  pname = "lwt_ppx";
+  version = "2.1.0";
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.04";
+
+  # `lwt_ppx` has a different release cycle than Lwt, but it's included in
+  # one of its release bundles.
+  # Because there could exist an Lwt release _without_ a `lwt_ppx` release,
+  # this `src` field doesn't inherit from the Lwt derivation.
+  #
+  # This is particularly useful for overriding Lwt without breaking `lwt_ppx`,
+  # as new Lwt releases may contain broken `lwt_ppx` code.
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "lwt";
+    rev = "5.6.0";
+    hash = "sha256-DLQupCkZ14kOuSQatbb7j07I+jvvDCKpdlaR3rijT4s=";
+  };
+
+  propagatedBuildInputs = [ lwt ppxlib ];
+
+  meta = {
+    description = "Ppx syntax extension for Lwt";
+    inherit (lwt.meta) license homepage maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix
new file mode 100644
index 000000000000..5a57c31969e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, lwt }:
+
+buildDunePackage rec {
+  pname = "lwt_log";
+  version = "1.1.2";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-ODTD3KceEnrEzD01CeuNg4BNKOtKZEpYaDIB+RIte1U=";
+  };
+
+  propagatedBuildInputs = [ lwt ];
+
+  meta = {
+    description = "Lwt logging library (deprecated)";
+    homepage = "https://github.com/aantron/lwt_log";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix
new file mode 100644
index 000000000000..f6f2bc0f4ef3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, cppo, lwt, react }:
+
+buildDunePackage {
+  pname = "lwt_react";
+  version = "1.1.5";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "lwt";
+    rev = "5.5.0";
+    sha256 = "sha256:1jbjz2rsz3j56k8vh5qlmm87hhkr250bs2m3dvpy9vsri8rkzj9z";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  propagatedBuildInputs = [ lwt react ];
+
+  meta = {
+    description = "Helpers for using React with Lwt";
+    inherit (lwt.meta) homepage license maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix
new file mode 100644
index 000000000000..7b74d92c2e50
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage, ssl, lwt }:
+
+buildDunePackage rec {
+  pname = "lwt_ssl";
+  version = "1.2.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/ocsigen/lwt_ssl/releases/download/${version}/lwt_ssl-${version}.tbz";
+    hash = "sha256-swIK0nrs83fhw/J0Cgizbcu6mR+EMGZRE1dBBUiImnc=";
+  };
+
+  propagatedBuildInputs = [ ssl lwt ];
+
+  meta = {
+    homepage = "https://github.com/aantron/lwt_ssl";
+    description = "OpenSSL binding with concurrent I/O";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/macaddr/cstruct.nix b/nixpkgs/pkgs/development/ocaml-modules/macaddr/cstruct.nix
new file mode 100644
index 000000000000..9fb3ce304d95
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaddr/cstruct.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage
+, macaddr, cstruct
+}:
+
+buildDunePackage {
+  pname = "macaddr-cstruct";
+
+  inherit (macaddr) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ macaddr cstruct ];
+
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "Library for manipulation of MAC address representations using Cstructs";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix
new file mode 100644
index 000000000000..4c405f2fff83
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, ppx_sexp_conv, ounit2
+}:
+
+buildDunePackage rec {
+  pname = "macaddr";
+  version = "5.5.0";
+
+  minimalOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-ipaddr/releases/download/v${version}/ipaddr-${version}.tbz";
+    hash = "sha256-YokLMW4DV5KtKa8a2XFFbRDe/VJbdLU9sbZ/pCN1wXg=";
+  };
+
+  checkInputs = [ ppx_sexp_conv ounit2 ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-ipaddr";
+    description = "Library for manipulation of MAC address representations";
+    license = licenses.isc;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix b/nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix
new file mode 100644
index 000000000000..62e2acba4d3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage
+, macaddr, ppx_sexp_conv, macaddr-cstruct, ounit2
+}:
+
+buildDunePackage {
+  pname = "macaddr-sexp";
+
+  inherit (macaddr) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ ppx_sexp_conv ];
+
+  checkInputs = [ macaddr-cstruct ounit2 ];
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "Library for manipulation of MAC address representations using sexp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mad/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mad/default.nix
new file mode 100644
index 000000000000..096987f737f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mad/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libmad }:
+
+buildDunePackage rec {
+  pname = "mad";
+  version = "0.5.3";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-mad";
+    rev = "v${version}";
+    sha256 = "sha256-rSFzWyUYTrGL7GvVsY5qKdCXqY/XJQkuBerexG838jc=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libmad ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-mad";
+    description = "Bindings for the mad library which provides functions for encoding wave audio files into mp3";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix
new file mode 100644
index 000000000000..a400e073f215
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "magic-mime";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-magic-mime/releases/download/v${version}/magic-mime-${version}.tbz";
+    hash = "sha256-4CNNA2Jduh76xY5X44dnLXWl6aYh/0ms/g9gnADxOwg=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  meta = with lib; {
+    description = "Convert file extensions to MIME types";
+    homepage = "https://github.com/mirage/ocaml-magic-mime";
+    license = licenses.isc;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/magic-trace/default.nix b/nixpkgs/pkgs/development/ocaml-modules/magic-trace/default.nix
new file mode 100644
index 000000000000..b4e1c557e812
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/magic-trace/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, ocaml-crunch
+, angstrom
+, async
+, cohttp
+, cohttp_static_handler ? null
+, core
+, core_unix ? null
+, fzf
+, owee
+, ppx_jane
+, re
+, shell ? null
+}:
+
+buildDunePackage rec {
+  pname = "magic-trace";
+  version = "1.2.3";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = "magic-trace";
+    rev = "v${version}";
+    hash = "sha256-cAoaAXZOeWNQh6emm17a9oCis8s4jJxPQMI/NfiUa7g=";
+  };
+
+  nativeBuildInputs = [
+    ocaml-crunch
+  ];
+  buildInputs = [
+    angstrom
+    async
+    cohttp
+    cohttp_static_handler
+    core
+    core_unix
+    fzf
+    owee
+    ppx_jane
+    re
+    shell
+  ];
+
+  meta = with lib; {
+    description =
+      "Collects and displays high-resolution traces of what a process is doing";
+    license = licenses.mit;
+    maintainers = [ maintainers.alizter ];
+    homepage = "https://github.com/janestreet/magic-trace";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/magic/default.nix b/nixpkgs/pkgs/development/ocaml-modules/magic/default.nix
new file mode 100644
index 000000000000..29ff7e67832c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/magic/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, which, file }:
+
+stdenv.mkDerivation rec {
+  pname = "magic";
+  version = "0.7.3";
+
+  src = fetchFromGitHub {
+    owner = "Chris00";
+    repo = "ocaml-magic";
+    rev = "510c473d222a3d3d900b8ae1892d13e0d49d08be"; # no tags in repo
+    sha256 = "0qks3v51xvzxhidai414mbszxhcl8wg8g7zxd04qi260433g77yg";
+  };
+
+  createFindlibDestdir = true;
+
+  nativeBuildInputs = [ which ];
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ file ];
+
+  meta = with lib; {
+    homepage = "https://github.com/Chris00/ocaml-magic";
+    description = "Bindings for libmagic";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix
new file mode 100644
index 000000000000..3ac6027b22fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix
@@ -0,0 +1,49 @@
+{ lib, fetchurl, stdenv
+, fetchpatch
+, ocaml, findlib, ocamlbuild, camlp-streams
+, ctypes, mariadb, libmysqlclient }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
+  "mariadb is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-mariadb";
+  version = "1.1.6";
+
+  src = fetchurl {
+    url = "https://github.com/andrenth/ocaml-mariadb/releases/download/${version}/ocaml-mariadb-${version}.tar.gz";
+    sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM=";
+  };
+
+  patches = lib.lists.map (x:
+    fetchpatch {
+      url = "https://github.com/andrenth/ocaml-mariadb/commit/${x.path}.patch";
+      inherit (x) hash;
+    })
+  [ { path = "9db2e4d8dec7c584213d0e0f03d079a36a35d9d5";
+      hash = "sha256-heROtU02cYBJ5edIHMdYP1xNXcLv8h79GYGBuudJhgE="; }
+    { path = "40cd3102bc7cce4ed826ed609464daeb1bbb4581";
+      hash = "sha256-YVsAMJiOgWRk9xPaRz2sDihBYLlXv+rhWtQIMOVLtSg="; }
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.ml --replace '#use "topfind"' \
+      '#directory "${findlib}/lib/ocaml/${ocaml.version}/site-lib/";; #use "topfind"'
+  '';
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ mariadb libmysqlclient camlp-streams ocamlbuild ];
+  propagatedBuildInputs = [ ctypes ];
+
+  strictDeps = true;
+
+  preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs";
+
+  meta = {
+    description = "OCaml bindings for MariaDB";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bcc32 ];
+    homepage = "https://github.com/andrenth/ocaml-mariadb";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/markup/default.nix b/nixpkgs/pkgs/development/ocaml-modules/markup/default.nix
new file mode 100644
index 000000000000..2de510919edf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/markup/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, uchar, uutf, ounit2 }:
+
+buildDunePackage rec {
+  pname = "markup";
+  version = "1.0.3";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = "markup.ml";
+    rev = version;
+    sha256 = "sha256-tsXz39qFSyL6vPYKG7P73zSEiraaFuOySL1n0uFij6k=";
+  };
+
+  propagatedBuildInputs = [ uchar uutf ];
+
+  checkInputs = [ ounit2 ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    homepage = "https://github.com/aantron/markup.ml/";
+    description = "Pair of best-effort parsers implementing the HTML5 and XML specifications";
+    license = licenses.mit;
+    maintainers = with maintainers; [ gal_bolle ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mccs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mccs/default.nix
new file mode 100644
index 000000000000..8a2f195c9445
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mccs/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, buildDunePackage, cudf }:
+
+buildDunePackage rec {
+  pname = "mccs";
+  version = "1.1+13";
+
+  src = fetchFromGitHub {
+    owner = "AltGr";
+    repo = "ocaml-mccs";
+    rev = version;
+    sha256 = "sha256-K249E9qkWNK4BC+ynaR3bVEyu9Tk8iCE7GptKk/aVJc=";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    cudf
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library providing a multi criteria CUDF solver, part of MANCOOSI project";
+    downloadPage = "https://github.com/AltGr/ocaml-mccs";
+    homepage = "https://www.i3s.unice.fr/~cpjm/misc/";
+    license = with licenses; [ lgpl21 gpl3 ];
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix
new file mode 100644
index 000000000000..d11c80644821
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix
@@ -0,0 +1,44 @@
+{ lib, fetchurl, buildDunePackage, ocaml, findlib
+, alcotest
+, astring, cppo, fmt, logs, ocaml-version, camlp-streams, lwt, re, csexp
+, gitUpdater
+}:
+
+buildDunePackage rec {
+  pname = "mdx";
+  version = "2.4.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
+    hash = "sha256-GkDMkcxVPe0KIMmNQ0NUlTvbdZ7Mka02u7mn3QQSrxM=";
+  };
+
+  nativeBuildInputs = [ cppo ];
+  propagatedBuildInputs = [
+    astring fmt logs csexp ocaml-version camlp-streams re findlib
+  ];
+  checkInputs = [ alcotest lwt ];
+
+  doCheck = true;
+
+  outputs = [ "bin" "lib" "out" ];
+
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib ${pname}
+    runHook postInstall
+  '';
+
+  passthru.updateScript = gitUpdater { };
+
+  meta = {
+    description = "Executable OCaml code blocks inside markdown files";
+    homepage = "https://github.com/realworldocaml/mdx";
+    changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.romildo ];
+    mainProgram = "ocaml-mdx";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mec/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mec/default.nix
new file mode 100644
index 000000000000..ddb610f5570b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mec/default.nix
@@ -0,0 +1,42 @@
+{ lib, fetchzip, buildDunePackage, ocaml
+, zarith, eqaf, bigarray-compat, hex, ff-sig, ff
+, alcotest, bisect_ppx
+}:
+
+buildDunePackage rec {
+  pname = "mec";
+  version = "0.1.0";
+  src = fetchzip {
+    url = "https://gitlab.com/nomadic-labs/cryptography/ocaml-ec/-/archive/${version}/ocaml-ec-${version}.tar.bz2";
+    sha256 = "sha256-uIcGj/exSfuuzsv6C/bnJXpYRu3OY3dcKMW/7+qwi2U=";
+  };
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.12";
+
+  propagatedBuildInputs = [
+    eqaf
+    bigarray-compat
+    hex
+    ff-sig
+    ff
+    alcotest
+  ];
+
+  buildInputs = [
+    zarith
+  ];
+
+  checkInputs = [
+    alcotest
+    bisect_ppx
+  ];
+
+  meta = {
+    description = "Mec - Mini Elliptic Curve library";
+    homepage = "https://gitlab.com/nomadic-labs/cryptography/ocaml-ec";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/memprof-limits/default.nix b/nixpkgs/pkgs/development/ocaml-modules/memprof-limits/default.nix
new file mode 100644
index 000000000000..768c04487282
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/memprof-limits/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitLab, ocaml }:
+
+if !(lib.versionOlder ocaml.version "5.0.0") then
+  throw "memprof-limits is not available for OCaml ${ocaml.version}"
+else
+  buildDunePackage rec {
+    pname = "memprof-limits";
+    version = "0.2.1";
+
+    src = fetchFromGitLab rec {
+      owner = "gadmm";
+      repo = pname;
+      rev = "v${version}";
+      hash = "sha256-Pmuln5TihPoPZuehZlqPfERif6lf7O+0454kW9y3aKc=";
+    };
+
+    minimalOCamlVersion = "4.12";
+
+    meta = with lib; {
+      homepage = "https://ocaml.org/p/memprof-limits/latest";
+      description =
+        "Memory limits, allocation limits, and thread cancellation for OCaml";
+      license = licenses.lgpl3;
+      maintainers = with maintainers; [ alizter ];
+    };
+  }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/memtrace/default.nix b/nixpkgs/pkgs/development/ocaml-modules/memtrace/default.nix
new file mode 100644
index 000000000000..03ed32af9213
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/memtrace/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub
+}:
+
+buildDunePackage rec {
+  pname = "memtrace";
+  version = "0.2.3";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-dWkTrN8ZgNUz7BW7Aut8mfx8o4n8f6UZaDv/7rbbwNs=";
+  };
+
+  minimalOCamlVersion = "4.11";
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/${pname}";
+    description = "Streaming client for OCaml's Memprof";
+    license = licenses.mit;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix b/nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix
new file mode 100644
index 000000000000..afe2d5cf593a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix
@@ -0,0 +1,18 @@
+{ buildDunePackage
+, menhirLib, menhirSdk
+}:
+
+buildDunePackage rec {
+  pname = "menhir";
+
+  minimalOCamlVersion = "4.03";
+
+  inherit (menhirLib) version src;
+
+  buildInputs = [ menhirLib menhirSdk ];
+
+  meta = menhirSdk.meta // {
+    description = "LR(1) parser generator for OCaml";
+    mainProgram = "menhir";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix b/nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix
new file mode 100644
index 000000000000..a694c7a54c3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "menhirLib";
+  version = "20231231";
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = "menhir";
+    rev = version;
+    hash = "sha256-veB0ORHp6jdRwCyDDAfc7a7ov8sOeHUmiELdOFf/QYk=";
+  };
+
+  meta = with lib; {
+    homepage = "http://pauillac.inria.fr/~fpottier/menhir/";
+    description = "Runtime support library for parsers generated by Menhir";
+    longDescription = ''
+      Menhir is a LR(1) parser generator for the Objective Caml programming
+      language.  That is, Menhir compiles LR(1) grammar specifications down
+      to OCaml code.  Menhir was designed and implemented by François Pottier
+      and Yann Régis-Gianas.
+    '';
+    license = with licenses; [ lgpl2Only ];
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/menhir/sdk.nix b/nixpkgs/pkgs/development/ocaml-modules/menhir/sdk.nix
new file mode 100644
index 000000000000..ad406c8a31dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/sdk.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage
+, menhirLib
+}:
+
+buildDunePackage rec {
+  pname = "menhirSdk";
+
+  inherit (menhirLib) version src;
+
+  meta = menhirLib.meta // {
+    description = "Compile-time library for auxiliary tools related to Menhir";
+    license = with lib.licenses; [ gpl2Only ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/merlin-extend/default.nix b/nixpkgs/pkgs/development/ocaml-modules/merlin-extend/default.nix
new file mode 100644
index 000000000000..a8ccd2cf4a01
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/merlin-extend/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl, cppo }:
+
+buildDunePackage rec {
+  pname = "merlin-extend";
+  version = "0.6";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/let-def/merlin-extend/releases/download/v${version}/merlin-extend-v${version}.tbz";
+    sha256 = "0hvc4mz92x3rl2dxwrhvhzwl4gilnyvvwcqgr45vmdpyjyp3dwn2";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  meta = with lib; {
+    homepage = "https://github.com/let-def/merlin-extend";
+    description = "SDK to extend Merlin";
+    license = licenses.mit;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metadata/default.nix b/nixpkgs/pkgs/development/ocaml-modules/metadata/default.nix
new file mode 100644
index 000000000000..2d9ea0da8deb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metadata/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, ogg, flac }:
+
+buildDunePackage rec {
+  pname = "metadata";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-metadata";
+    rev = "v${version}";
+    sha256 = "sha256-SQ8fNl62fvoCgbIt0axQyE3Eqwl8EOtYiz3xN96al+g=";
+  };
+
+  minimalOCamlVersion = "4.14";
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-metadata";
+    description = "Library to read metadata from files in various formats. ";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/default.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/default.nix
new file mode 100644
index 000000000000..9a0de6212f20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, alcotest, fmt }:
+
+buildDunePackage rec {
+  pname = "metrics";
+  version = "0.4.1";
+
+  minimalOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/metrics/releases/download/v${version}/metrics-${version}.tbz";
+    sha256 = "sha256-d+DCD7XB0GED27DsC8YEW+48YcAK0EI8l4Uqx/PGFE0=";
+  };
+
+  propagatedBuildInputs = [ fmt ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Metrics infrastructure for OCaml";
+    homepage = "https://github.com/mirage/metrics";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix
new file mode 100644
index 000000000000..f004c1042aa7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, metrics
+, duration, fmt, lwt
+}:
+
+buildDunePackage rec {
+  pname = "metrics-influx";
+  inherit (metrics) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ duration fmt lwt metrics ];
+
+  meta = metrics.meta // {
+    description = "Influx reporter for the Metrics library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix
new file mode 100644
index 000000000000..465f4adc5c5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, logs, lwt, metrics }:
+
+buildDunePackage {
+  pname = "metrics-lwt";
+
+  inherit (metrics) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ logs lwt metrics ];
+
+  meta = metrics.meta // {
+    description = "Lwt backend for the Metrics library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/rusage.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/rusage.nix
new file mode 100644
index 000000000000..ed944fb6dfc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/rusage.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, metrics
+, fmt, logs
+}:
+
+buildDunePackage {
+  pname = "metrics-rusage";
+  inherit (metrics) src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ fmt logs metrics ];
+
+  doCheck = true;
+
+  meta = metrics.meta // {
+    description = "Resource usage (getrusage) sources for the Metrics library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix
new file mode 100644
index 000000000000..0c3a1465c2b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, gnuplot, lwt, metrics, metrics-lwt, mtime, uuidm }:
+
+buildDunePackage rec {
+
+  pname = "metrics-unix";
+
+  inherit (metrics) version src;
+
+  propagatedBuildInputs = [ gnuplot lwt metrics mtime uuidm ];
+
+  nativeCheckInputs = [ gnuplot ];
+  checkInputs = [ metrics-lwt ];
+
+  doCheck = true;
+
+  meta = metrics.meta // {
+    description = "Unix backend for the Metrics library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mew/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mew/default.nix
new file mode 100644
index 000000000000..819bb020050c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mew/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, result, trie
+}:
+
+buildDunePackage rec {
+  pname = "mew";
+  version = "0.1.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "kandu";
+    repo = pname;
+    rev = version;
+    sha256 = "0417xsghj92v3xa5q4dk4nzf2r4mylrx2fd18i7cg3nzja65nia2";
+  };
+
+  propagatedBuildInputs = [ result trie ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    description = "Modal Editing Witch";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mew_vi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mew_vi/default.nix
new file mode 100644
index 000000000000..39228585fe3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mew_vi/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, mew, react
+}:
+
+buildDunePackage rec {
+  pname = "mew_vi";
+  version = "0.5.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "kandu";
+    repo = pname;
+    rev = version;
+    sha256 = "0lihbf822k5zasl60w5mhwmdkljlq49c9saayrws7g4qc1j353r8";
+  };
+
+  propagatedBuildInputs = [ mew react ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    description = "Modal Editing Witch, VI interpreter";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/middleware/default.nix b/nixpkgs/pkgs/development/ocaml-modules/middleware/default.nix
new file mode 100644
index 000000000000..2cdef2e5a3c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/middleware/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "middleware";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.14.0";
+
+  src = fetchurl {
+    url = "https://github.com/skolemlabs/middleware/releases/download/${version}/${pname}-${version}.tbz";
+    hash = "sha256-zhLEGvyZiKrdBKWcEbB4PHvYzBlkrp1Ldnon0mP2Ypg=";
+  };
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Composable stacked functions, which can respond to inner calls";
+    homepage = "https://github.com/skolemlabs/middleware";
+    changelog = "https://github.com/skolemlabs/middleware/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix
new file mode 100644
index 000000000000..eb910c5a5b04
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildDunePackage, fetchurl
+, fmt, mirage-flow, cstruct, logs, ke, lwt
+, alcotest, alcotest-lwt, bigstringaf
+}:
+
+buildDunePackage rec {
+  pname = "mimic";
+  version = "0.0.6";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/mimic/releases/download/${version}/mimic-${version}.tbz";
+    sha256 = "sha256-gVvBj4NqqKR2mn944g9F0bFZ8Me+WC87skti0dBW3Cg=";
+  };
+
+  propagatedBuildInputs = [
+    fmt
+    lwt
+    mirage-flow
+    logs
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    bigstringaf
+    cstruct
+    ke
+  ];
+
+  meta = with lib; {
+    description = "Simple protocol dispatcher";
+    license = licenses.isc;
+    homepage = "https://github.com/mirage/ocaml-git";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mimic/happy-eyeballs.nix b/nixpkgs/pkgs/development/ocaml-modules/mimic/happy-eyeballs.nix
new file mode 100644
index 000000000000..569cc713fd1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mimic/happy-eyeballs.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, mimic, happy-eyeballs-mirage }:
+
+buildDunePackage {
+  pname = "mimic-happy-eyeballs";
+
+  inherit (mimic) src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  strictDeps = true;
+
+  propagatedBuildInputs = [
+    mimic
+    happy-eyeballs-mirage
+  ];
+  doCheck = false;
+
+  meta = {
+    description = "Happy-eyeballs integration into mimic";
+    maintainers = [ lib.maintainers.ulrikstrid ];
+    inherit (mimic.meta) license homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix
new file mode 100644
index 000000000000..3a7c222c9572
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "minisat";
+  version = "0.6";
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner  = "c-cube";
+    repo   = "ocaml-minisat";
+    rev    = "v${version}";
+    hash   = "sha256-dH0Ndlyo/DTZ6Ao1S478aBuxoZFSkRBi5HblkTWCPas=";
+  };
+
+  meta = {
+    homepage = "https://c-cube.github.io/ocaml-minisat/";
+    description = "Simple bindings to Minisat-C";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/minttea/default.nix b/nixpkgs/pkgs/development/ocaml-modules/minttea/default.nix
new file mode 100644
index 000000000000..07084c12c876
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/minttea/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, riot
+, tty
+}:
+
+buildDunePackage rec {
+  pname = "minttea";
+  version = "0.0.3";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/minttea/releases/download/${version}/minttea-${version}.tbz";
+    hash = "sha256-WEaJVCCvsmKcF8+yzovljt8dGWaIv4UmAr74jq6Vo9M=";
+  };
+
+  propagatedBuildInputs = [
+    riot
+    tty
+  ];
+
+  meta = {
+    description = "Fun, functional, and stateful way to build terminal apps in OCaml heavily inspired by Go's BubbleTea";
+    homepage = "https://github.com/leostera/minttea";
+    changelog = "https://github.com/leostera/minttea/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/miou/default.nix b/nixpkgs/pkgs/development/ocaml-modules/miou/default.nix
new file mode 100644
index 000000000000..909bf019cda7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/miou/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "miou";
+  version = "0.1.0";
+
+  minimalOCamlVersion = "5.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/robur-coop/miou/releases/download/v${version}/miou-${version}.tbz";
+    hash = "sha256-WTs6L9j4z1/0wKcGIZVwaNrATRGCTN5A6RwO7tY2phE=";
+  };
+
+  meta = {
+    description = "Composable concurrency primitives for OCaml";
+    homepage = "https://git.robur.coop/robur/miou";
+    changelog = "https://git.robur.coop/robur/miou/src/tag/v${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix
new file mode 100644
index 000000000000..a6978d3d5811
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage, io-page, mirage-block }:
+
+buildDunePackage rec {
+  pname = "mirage-block-ramdisk";
+  version = "0.5";
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/mirage-block-ramdisk/releases/download/${version}/mirage-block-ramdisk-${version}.tbz";
+    sha256 = "cc0e814fd54efe7a5b7a8c5eb1c04e2dece751b7d8dee2d95908a0768896e8af";
+  };
+
+  # Make compatible with cstruct 6.1.0
+  postPatch = ''
+    substituteInPlace src/ramdisk.ml --replace 'Cstruct.len' 'Cstruct.length'
+  '';
+
+  minimalOCamlVersion = "4.06";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ io-page mirage-block ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "In-memory BLOCK device for MirageOS";
+    homepage = "https://github.com/mirage/mirage-block-ramdisk";
+    license = licenses.isc;
+    maintainers = with maintainers; [ ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix
new file mode 100644
index 000000000000..e32523c85eb6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage, cstruct-lwt, diet, logs
+, mirage-block, ounit2, rresult, uri
+}:
+
+buildDunePackage rec {
+  pname = "mirage-block-unix";
+  version = "2.14.2";
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/mirage-block-unix/releases/download/v${version}/mirage-block-unix-${version}.tbz";
+    sha256 = "sha256-6ReAzd+pCd5ccmXOh6GlSxHo4GuEgptxLha62n+dBsE=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ cstruct-lwt logs mirage-block rresult uri ];
+
+  doCheck = true;
+  checkInputs = [ diet ounit2 ];
+
+  meta = with lib; {
+    description = "MirageOS disk block driver for Unix";
+    homepage = "https://github.com/mirage/mirage-block-unix";
+    license = licenses.isc;
+    maintainers = with maintainers; [ ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix
new file mode 100644
index 000000000000..fc50002da1e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, mirage-block, logs }:
+
+buildDunePackage rec {
+  pname = "mirage-block-combinators";
+  inherit (mirage-block) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ mirage-block logs ];
+
+  meta = mirage-block.meta // {
+    description = "Block signatures and implementations for MirageOS using Lwt";
+    longDescription = ''
+      This repo contains generic operations over Mirage `BLOCK` devices.
+      This package is specialised to the Lwt concurrency library for IO.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-block/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/default.nix
new file mode 100644
index 000000000000..0cd1f1717ea6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, lwt, fmt
+}:
+
+buildDunePackage rec {
+  pname = "mirage-block";
+  version = "3.0.2";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-block/releases/download/v${version}/mirage-block-${version}.tbz";
+    hash = "sha256-UALUfeL0G1mfSsLgAb/HpQ6OV12YtY+GUOYG6yhUwAI=";
+  };
+
+  propagatedBuildInputs = [ cstruct lwt fmt ];
+
+  meta = with lib; {
+    description = "Block signatures and implementations for MirageOS";
+    homepage = "https://github.com/mirage/mirage-block";
+    license = licenses.isc;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix
new file mode 100644
index 000000000000..d34513afef9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, lwt, parse-argv
+}:
+
+buildDunePackage rec {
+  pname = "mirage-bootvar-unix";
+  version = "0.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-bootvar-unix/releases/download/${version}/mirage-bootvar-unix-${version}.tbz";
+    sha256 = "0r92s6y7nxg0ci330a7p0hii4if51iq0sixn20cnm5j4a2clprbf";
+  };
+
+  propagatedBuildInputs = [ lwt parse-argv ];
+
+  meta = {
+    description = "Unix implementation of MirageOS Bootvar interface";
+    homepage = "https://github.com/mirage/mirage-bootvar-unix";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix
new file mode 100644
index 000000000000..1bf622714788
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, mirage-xen
+, parse-argv
+, lwt
+}:
+
+buildDunePackage rec {
+  pname = "mirage-bootvar-xen";
+  version = "0.8.0";
+
+  minimalOCamlVersion = "4.08";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-bootvar-xen/releases/download/v${version}/mirage-bootvar-xen-v${version}.tbz";
+    hash = "sha256:0nk80giq9ng3svbnm68fjby2f1dnarddm3lk7mw7w59av71q0rcv";
+  };
+
+  propagatedBuildInputs = [
+    mirage-xen
+    lwt
+    parse-argv
+  ];
+
+  meta = with lib; {
+    description = "Handle boot-time arguments for Xen platform";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/mirage-bootvar-xen";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-channel/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-channel/default.nix
new file mode 100644
index 000000000000..74ff38f9a70a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-channel/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, logs, lwt, mirage-flow
+, alcotest, mirage-flow-combinators
+}:
+
+buildDunePackage rec {
+  pname = "mirage-channel";
+  version = "4.1.0";
+
+  minimalOCamlVersion = "4.07";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-channel/releases/download/v${version}/mirage-channel-${version}.tbz";
+    hash = "sha256-sBdoUdTd9ZeNcHK0IBGBeOYDDqULM7EYX+Pz2f2nIQA=";
+  };
+
+  propagatedBuildInputs = [ cstruct logs lwt mirage-flow ];
+
+  doCheck = true;
+  checkInputs = [ alcotest mirage-flow-combinators ];
+
+  meta = {
+    description = "Buffered channels for MirageOS FLOW types";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/mirage/mirage-channel";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix
new file mode 100644
index 000000000000..a436f0b59c07
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "mirage-clock";
+  version = "4.2.0";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-clock/releases/download/v${version}/mirage-clock-${version}.tbz";
+    hash = "sha256-+hfRXVviPHm6dB9ffLiO1xEt4WpEEM6oHHG5gIaImEc=";
+  };
+
+  meta = {
+    description = "Libraries and module types for portable clocks";
+    homepage = "https://github.com/mirage/mirage-clock";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/solo5.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/solo5.nix
new file mode 100644
index 000000000000..d787c08e1bb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/solo5.nix
@@ -0,0 +1,21 @@
+{ lib
+, buildDunePackage
+, mirage-clock
+}:
+
+buildDunePackage {
+  pname = "mirage-clock-solo5";
+
+  inherit (mirage-clock)
+    version
+    src
+    ;
+
+  propagatedBuildInputs = [
+    mirage-clock
+  ];
+
+  meta = mirage-clock.meta // {
+    description = "Paravirtual implementation of the MirageOS Clock interface";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/unix.nix
new file mode 100644
index 000000000000..6489a4d2566b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/unix.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, mirage-clock, dune-configurator }:
+
+buildDunePackage {
+  pname = "mirage-clock-unix";
+
+  inherit (mirage-clock) version src;
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ mirage-clock ];
+
+  meta = mirage-clock.meta // {
+    description = "Unix-based implementation for the MirageOS Clock interface";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix
new file mode 100644
index 000000000000..b0746c54162a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage
+, lwt, mirage-flow
+}:
+
+buildDunePackage rec {
+  pname = "mirage-console";
+  version = "5.1.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-console/releases/download/v${version}/mirage-console-${version}.tbz";
+    hash = "sha256-mjYRisbNOJbYoSuWaGoPueXakmqAwmWh0ATvLLsvpNM=";
+  };
+
+  propagatedBuildInputs = [ lwt mirage-flow ];
+
+  meta = {
+    description = "Implementations of Mirage console devices";
+    homepage = "https://github.com/mirage/mirage-console";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix
new file mode 100644
index 000000000000..ca8c2aeac5e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, mirage-console, lwt, cstruct, cstruct-lwt }:
+
+buildDunePackage {
+  pname = "mirage-console-unix";
+
+  inherit (mirage-console) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    mirage-console
+    cstruct
+    cstruct-lwt
+  ];
+
+  meta = mirage-console.meta // {
+    description = "Implementation of Mirage consoles for Unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix
new file mode 100644
index 000000000000..74e9a455bebe
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix
@@ -0,0 +1,39 @@
+{ lib, fetchurl, buildDunePackage, ounit2, cstruct, dune-configurator, eqaf, pkg-config
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  pname = "mirage-crypto";
+  version = "0.11.3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-crypto/releases/download/v${version}/mirage-crypto-${version}.tbz";
+    sha256 = "sha256-v7Uw+hac2QXrx+JEnzQHz71nAjrAspG4tvShQ3pdlbE=";
+  };
+
+  doCheck = true;
+  checkInputs = [ ounit2 ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator  ];
+  propagatedBuildInputs = [
+    cstruct eqaf
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage-crypto";
+    description = "Simple symmetric cryptography for the modern age";
+    license = [
+      licenses.isc  # default license
+      licenses.bsd2 # mirage-crypto-rng-mirage
+      licenses.mit  # mirage-crypto-ec
+    ];
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix
new file mode 100644
index 000000000000..b17182a5efda
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix
@@ -0,0 +1,57 @@
+{ lib
+, ocaml
+, buildDunePackage
+, mirage-crypto
+, dune-configurator
+, pkg-config
+, cstruct
+, mirage-crypto-rng
+, mirage-crypto-pk
+, hex
+, alcotest
+, asn1-combinators
+, ppx_deriving_yojson
+, ppx_deriving
+, yojson
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  pname = "mirage-crypto-ec";
+
+  inherit (mirage-crypto)
+    src
+    version;
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    dune-configurator
+  ];
+  propagatedBuildInputs = [
+    cstruct
+    mirage-crypto
+    mirage-crypto-rng
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  strictDeps = true;
+
+  doCheck = true;
+  checkInputs = [
+    hex
+    alcotest
+    asn1-combinators
+    ppx_deriving_yojson
+    ppx_deriving
+    yojson
+    mirage-crypto-pk
+  ];
+
+  meta = mirage-crypto.meta // {
+    description = "Elliptic Curve Cryptography with primitives taken from Fiat";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix
new file mode 100644
index 000000000000..e50838e50bbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, ounit2, randomconv, mirage-crypto, mirage-crypto-rng
+, cstruct, sexplib0, zarith, eqaf, gmp }:
+
+buildDunePackage rec {
+  pname = "mirage-crypto-pk";
+
+  inherit (mirage-crypto) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [ gmp ];
+  propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng
+                            zarith eqaf sexplib0 ];
+
+  doCheck = true;
+  checkInputs = [ ounit2 randomconv ];
+
+  meta = mirage-crypto.meta // {
+    description = "Simple public-key cryptography for the modern age";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix
new file mode 100644
index 000000000000..b9979b446d20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage
+, mirage-crypto, mirage-crypto-rng
+, dune-configurator, async, logs
+}:
+
+buildDunePackage {
+  pname = "mirage-crypto-rng-async";
+
+  inherit (mirage-crypto) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    async
+    logs
+    mirage-crypto
+    mirage-crypto-rng
+  ];
+
+  strictDeps = true;
+
+  meta = mirage-crypto.meta // {
+    description = "Feed the entropy source in an Async-friendly way";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix
new file mode 100644
index 000000000000..bcaac601c95c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, mirage-crypto, mirage-crypto-rng, dune-configurator
+, duration, logs, mtime, lwt }:
+
+buildDunePackage rec {
+  pname = "mirage-crypto-rng-lwt";
+
+  inherit (mirage-crypto) version src;
+
+  duneVersion = "3";
+
+  doCheck = true;
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ mirage-crypto mirage-crypto-rng duration logs mtime lwt ];
+
+  meta = mirage-crypto-rng.meta;
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix
new file mode 100644
index 000000000000..3e0cde29c52d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, mirage-crypto-rng, duration, cstruct, mirage-runtime
+, mirage-time, mirage-clock, mirage-unix, mirage-time-unix, mirage-clock-unix
+, logs, lwt
+}:
+
+buildDunePackage rec {
+  pname = "mirage-crypto-rng-mirage";
+
+  inherit (mirage-crypto-rng) version src;
+  duneVersion = "3";
+
+  doCheck = true;
+  checkInputs = [ mirage-unix mirage-clock-unix mirage-time-unix ];
+
+  propagatedBuildInputs = [ duration cstruct mirage-crypto-rng mirage-runtime
+                            mirage-time mirage-clock logs lwt ];
+
+  meta = mirage-crypto-rng.meta // {
+    description = "Entropy collection for a cryptographically secure PRNG";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix
new file mode 100644
index 000000000000..79ff29a05de4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, mirage-crypto, ounit2, randomconv, dune-configurator
+, cstruct, duration, logs }:
+
+buildDunePackage rec {
+  pname = "mirage-crypto-rng";
+
+  inherit (mirage-crypto) version src;
+
+  doCheck = true;
+  checkInputs = [ ounit2 randomconv ];
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ cstruct mirage-crypto duration logs ];
+
+  strictDeps = true;
+
+  meta = mirage-crypto.meta // {
+    description = "Cryptographically secure PRNG";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-device/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-device/default.nix
new file mode 100644
index 000000000000..d233277b7a79
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-device/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, fmt, ocaml_lwt }:
+
+buildDunePackage rec {
+  pname = "mirage-device";
+  version = "2.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-device/releases/download/v${version}/mirage-device-v${version}.tbz";
+    sha256 = "18alxyi6wlxqvb4lajjlbdfkgcajsmklxi9xqmpcz07j51knqa04";
+  };
+
+  propagatedBuildInputs = [ fmt ocaml_lwt ];
+
+  meta = {
+    description = "Abstract devices for MirageOS";
+    homepage = "https://github.com/mirage/mirage-device";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix
new file mode 100644
index 000000000000..5500d0551253
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, mirage-flow, fmt, lwt, logs, cstruct, mirage-clock }:
+
+buildDunePackage {
+  pname = "mirage-flow-combinators";
+
+  inherit (mirage-flow) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ lwt logs cstruct mirage-clock mirage-flow ];
+
+  meta = mirage-flow.meta // {
+    description = "Flow implementations and combinators for MirageOS specialized to lwt";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix
new file mode 100644
index 000000000000..6b454512915b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, cstruct, fmt, lwt }:
+
+buildDunePackage rec {
+  pname = "mirage-flow";
+  version = "3.0.0";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-flow/releases/download/v${version}/mirage-flow-v${version}.tbz";
+    hash = "sha256-1wvabIXsJ0e+2IvE2V8mnSgQUDuSkT8IB75SkWlhOPw=";
+  };
+
+  propagatedBuildInputs = [ cstruct fmt lwt ];
+
+  meta = {
+    description = "Flow implementations and combinators for MirageOS";
+    homepage = "https://github.com/mirage/mirage-flow";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix
new file mode 100644
index 000000000000..12681911a3de
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix
@@ -0,0 +1,25 @@
+{ buildDunePackage, fmt, logs, mirage-flow, ocaml_lwt, cstruct
+, alcotest, mirage-flow-combinators
+}:
+
+buildDunePackage {
+  pname = "mirage-flow-unix";
+
+  inherit (mirage-flow) version src;
+
+  duneVersion = "3";
+
+  # Make tests compatible with alcotest 1.4.0
+  postPatch = ''
+    substituteInPlace test/test.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)'
+  '';
+
+  propagatedBuildInputs = [ fmt logs mirage-flow ocaml_lwt cstruct ];
+
+  doCheck = true;
+  checkInputs = [ alcotest mirage-flow-combinators ];
+
+  meta = mirage-flow.meta // {
+    description = "Flow implementations and combinators for MirageOS on Unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix
new file mode 100644
index 000000000000..97eb3128e15b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage
+, fmt
+, lwt
+, optint
+, ptime
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "mirage-kv";
+  version = "6.1.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-kv/releases/download/v${version}/mirage-kv-${version}.tbz";
+    hash = "sha256-fNXNlaDpb5zUA2rTwi5h1j4v4LQmovxG+Am6u+1guPQ=";
+  };
+
+  propagatedBuildInputs = [ fmt lwt optint ptime ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "MirageOS signatures for key/value devices";
+    homepage = "https://github.com/mirage/mirage-kv";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix
new file mode 100644
index 000000000000..be9592fb374b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, logs, lwt, mirage-clock, ptime
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "mirage-logs";
+  version = "1.3.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-logs/releases/download/v${version}/mirage-logs-${version}.tbz";
+    hash = "sha256-c1YQIutqp58TRz+a9Vd/69FCv0jnGRvFnei9BtSbOxA=";
+  };
+
+  propagatedBuildInputs = [ logs lwt mirage-clock ptime ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Reporter for the Logs library that writes log messages to stderr, using a Mirage `CLOCK` to add timestamps";
+    homepage = "https://github.com/mirage/mirage-logs";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix
new file mode 100644
index 000000000000..f0a89f37f418
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix
@@ -0,0 +1,39 @@
+{ lib, buildDunePackage, fetchurl
+, ipaddr, cstruct, logs, lru
+, tcpip, ethernet
+, alcotest, mirage-clock-unix
+}:
+
+buildDunePackage rec {
+  pname = "mirage-nat";
+  version = "3.0.2";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-Z1g3qb26x/S6asYv6roTW77r41SHy7OGN7MoZJ/E8Is=";
+  };
+
+  propagatedBuildInputs = [
+    ipaddr
+    cstruct
+    logs
+    lru
+    tcpip
+    ethernet
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    mirage-clock-unix
+  ];
+
+  meta = with lib; {
+    description = "Mirage-nat is a library for network address translation to be used with MirageOS";
+    homepage = "https://github.com/mirage/${pname}";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-net-xen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-net-xen/default.nix
new file mode 100644
index 000000000000..e03e17905faa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-net-xen/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildDunePackage
+, netchannel
+, ppx_sexp_conv
+, lwt
+, cstruct
+, mirage-net
+, mirage-xen
+, io-page
+, lwt-dllist
+, logs
+}:
+
+buildDunePackage {
+  pname = "mirage-net-xen";
+
+  inherit (netchannel)
+    src
+    version
+    meta
+    ;
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [
+    ppx_sexp_conv
+  ];
+
+  propagatedBuildInputs = [
+    lwt
+    cstruct
+    netchannel
+    mirage-net
+    mirage-xen
+    io-page
+    lwt-dllist
+    logs
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-net/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-net/default.nix
new file mode 100644
index 000000000000..bf4992df76f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-net/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, fmt, lwt, macaddr, mirage-device
+}:
+
+buildDunePackage rec {
+  pname = "mirage-net";
+  version = "4.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-net/releases/download/v${version}/mirage-net-v${version}.tbz";
+    hash = "sha256-Zo7/0Ye4GgqzJFCHDBXbuJ/5ETl/8ziolRgH4lDhlM4=";
+  };
+
+  propagatedBuildInputs = [ cstruct fmt lwt macaddr mirage-device ];
+
+  meta = {
+    description = "Network signatures for MirageOS";
+    homepage = "https://github.com/mirage/mirage-net";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-profile/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-profile/default.nix
new file mode 100644
index 000000000000..2aba97944e17
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-profile/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_cstruct, stdlib-shims
+, cstruct, lwt
+}:
+
+buildDunePackage rec {
+  pname = "mirage-profile";
+  version = "0.9.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-profile/releases/download/v${version}/mirage-profile-v${version}.tbz";
+    sha256 = "0lh3591ad4v7nxpd410b75idmgdq668mqdilvkg4avrwqw1wzdib";
+  };
+
+  buildInputs = [ ppx_cstruct ];
+  propagatedBuildInputs = [ cstruct lwt stdlib-shims ];
+
+  meta = with lib; {
+    description = "Collect runtime profiling information in CTF format";
+    homepage = "https://github.com/mirage/mirage-profile";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-protocols/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-protocols/default.nix
new file mode 100644
index 000000000000..2c80507051e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-protocols/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, arp
+, ethernet
+, ipaddr
+, tcpip
+}:
+
+buildDunePackage rec {
+  pname = "mirage-protocols";
+  version = "8.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-protocols/releases/download/v${version}/mirage-protocols-v${version}.tbz";
+    hash = "sha256-UDCR4Jq3tw9P/Ilw7T4+3+yi9Q7VFqnHhXeSCvg9dyw=";
+  };
+
+  propagatedBuildInputs = [ arp ethernet ipaddr tcpip ];
+
+  meta = {
+    description = "MirageOS signatures for network protocols";
+    homepage = "https://github.com/mirage/mirage-protocols";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix
new file mode 100644
index 000000000000..24339b49568c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, mirage-random
+}:
+
+buildDunePackage rec {
+  pname = "mirage-random-test";
+  version = "0.1.0";
+
+  minimalOCamlVersion = "4.06";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "1jmjyb9a4v7l0xxgdwpr9zshzr8xk3hybra6y2dp51anbwk8kv46";
+  };
+
+  propagatedBuildInputs = [
+    cstruct
+    mirage-random
+  ];
+
+  meta = with lib; {
+    description = "Stub random device implementation for testing";
+    homepage = "https://github.com/mirage/mirage-random";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-random/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-random/default.nix
new file mode 100644
index 000000000000..ba70665c6ede
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-random/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl, cstruct }:
+
+buildDunePackage rec {
+  pname = "mirage-random";
+  version = "3.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-random/releases/download/v${version}/mirage-random-v${version}.tbz";
+    sha256 = "sha256-Sf4/KB1kMMwXI+yr5H/JuOmynYPNXwlk9dAA+gFAZs8=";
+  };
+
+  propagatedBuildInputs = [ cstruct ];
+
+  meta = {
+    description = "Random signatures for MirageOS";
+    homepage = "https://github.com/mirage/mirage-random";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-time/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/default.nix
new file mode 100644
index 000000000000..6b4b5f9ac721
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, lwt }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+
+  pname = "mirage-time";
+  version = "3.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-time/releases/download/v${version}/mirage-time-v${version}.tbz";
+    hash = "sha256-DUCUm1jix+i3YszIzgZjRQRiM8jJXQ49F6JC/yicvXw=";
+  };
+
+  propagatedBuildInputs = [ lwt ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage-time";
+    description = "Time operations for MirageOS";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-time/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/unix.nix
new file mode 100644
index 000000000000..5771a3e2deea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/unix.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, mirage-time, lwt, duration }:
+
+buildDunePackage {
+  pname = "mirage-time-unix";
+
+  inherit (mirage-time) src version;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ mirage-time lwt duration ];
+
+  meta = mirage-time.meta // {
+    description = "Time operations for MirageOS on Unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix
new file mode 100644
index 000000000000..c0ce9fec102c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, lwt, duration, mirage-runtime }:
+
+buildDunePackage rec {
+  pname = "mirage-unix";
+  version = "5.0.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-U1oLznUDBcJLcVygfSiyl5qRLDM27cm/WrjT0vSGhPg=";
+  };
+
+  propagatedBuildInputs = [ lwt duration mirage-runtime ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage-unix";
+    description = "Unix core platform libraries for MirageOS";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix
new file mode 100644
index 000000000000..94b5f39820fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix
@@ -0,0 +1,36 @@
+{ lib, buildDunePackage, fetchurl
+, lwt, mirage-net
+, cstruct, ipaddr, macaddr, mirage-profile
+, duration, logs
+}:
+
+buildDunePackage rec {
+  pname = "mirage-vnetif";
+  version = "0.6.0";
+
+  minimalOCamlVersion = "4.06";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-fzRoNFqdnj4Ke+eNdo5crvbnKDx6/+dQyu+K3rD5dYw=";
+  };
+
+  propagatedBuildInputs = [
+    lwt
+    mirage-net
+    cstruct
+    ipaddr
+    macaddr
+    mirage-profile
+    duration
+    logs
+  ];
+
+  meta = with lib; {
+    description = "Virtual network interface and software switch for Mirage";
+    homepage = "https://github.com/mirage/${pname}";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix
new file mode 100644
index 000000000000..8f174f01ccb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, cstruct
+, lwt
+, shared-memory-ring-lwt
+, xenstore
+, lwt-dllist
+, mirage-profile
+, mirage-runtime
+, logs
+, fmt
+, bheap
+, duration
+, io-page
+}:
+
+buildDunePackage rec {
+  pname = "mirage-xen";
+  version = "8.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-xen/releases/download/v${version}/mirage-xen-${version}.tbz";
+    hash = "sha256-x8i2Kbz0EcifZK/lbDIFa9Kwtl1/xzbYV9h9E+EtGP4=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    cstruct
+    lwt
+    shared-memory-ring-lwt
+    xenstore
+    lwt-dllist
+    mirage-profile
+    mirage-runtime
+    io-page
+    logs
+    fmt
+    bheap
+    duration
+  ];
+
+  meta = with lib; {
+    description = "Xen core platform libraries for MirageOS";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/mirage-xen";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix
new file mode 100644
index 000000000000..6342184e805d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix
@@ -0,0 +1,39 @@
+{ lib, buildDunePackage, ocaml, alcotest
+, functoria, mirage-runtime, bos
+, ipaddr, astring, logs, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "mirage";
+  inherit (mirage-runtime) version src;
+
+  minimalOCamlVersion = "4.08";
+
+  outputs = [ "out" "dev" ];
+
+  propagatedBuildInputs = [
+    ipaddr
+    functoria
+    mirage-runtime
+    bos
+    astring
+    logs
+    stdlib-shims
+  ];
+
+  # Tests need opam-monorepo
+  doCheck = false;
+  checkInputs = [
+    alcotest
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix=$out --libdir=$dev/lib/ocaml/${ocaml.version}/site-lib/ ${pname}
+    runHook postInstall
+  '';
+
+  meta = mirage-runtime.meta // {
+    description = "MirageOS library operating system";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix
new file mode 100644
index 000000000000..d3b847d6da47
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, ipaddr, functoria-runtime
+, logs, lwt
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "mirage-runtime";
+  inherit (functoria-runtime) src version;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ ipaddr functoria-runtime logs lwt ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage";
+    description = "Base MirageOS runtime library, part of every MirageOS unikernel";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mldoc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mldoc/default.nix
new file mode 100644
index 000000000000..6a74ef4cec82
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mldoc/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, fetchpatch
+, angstrom
+, cmdliner
+, core
+, core_bench
+, core_unix ? null
+, js_of_ocaml
+, js_of_ocaml-ppx
+, ppx_deriving_yojson
+, uri
+, yojson
+, lwt
+, xmlm
+}:
+let
+  angstrom' = angstrom.overrideAttrs (attrs: {
+    patches = attrs.patches or [ ] ++ [
+      # mldoc requires Angstrom to expose `unsafe_lookahead`
+      (fetchpatch {
+        url = "https://github.com/logseq/angstrom/commit/bbe36c99c13678937d4c983a427e02a733d6cc24.patch";
+        sha256 = "sha256-RapY1QJ8U0HOqJ9TFDnCYB4tFLFuThESzdBZqjYuDUA=";
+      })
+    ];
+  });
+  uri' = uri.override { angstrom = angstrom'; };
+in
+buildDunePackage rec {
+  pname = "mldoc";
+  version = "1.5.8";
+
+  minimalOCamlVersion = "4.10";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "logseq";
+    repo = "mldoc";
+    rev = "v${version}";
+    hash = "sha256-7uuNUFMSQEgakTKfpYixp43gnfpQSW++snBzgr0Ni0Y=";
+  };
+
+  buildInputs = [
+    cmdliner
+    core
+    core_bench
+    core_unix
+    js_of_ocaml
+    js_of_ocaml-ppx
+    lwt
+  ];
+
+  propagatedBuildInputs = [
+    angstrom'
+    uri'
+    yojson
+    ppx_deriving_yojson
+    xmlm
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/logseq/mldoc";
+    description = "Another Emacs Org-mode and Markdown parser";
+    license = licenses.agpl3Only;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mlgmp/META b/nixpkgs/pkgs/development/ocaml-modules/mlgmp/META
new file mode 100644
index 000000000000..e132e179b33f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mlgmp/META
@@ -0,0 +1,7 @@
+name="gmp"
+version="@VERSION@"
+description="bindings to GNU MP library"
+archive(byte)="gmp.cma"
+archive(native)="gmp.cmxa"
+requires=""
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix
new file mode 100644
index 000000000000..c28a6fba9902
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, perl, ocaml, findlib, camlidl, gmp, mpfr, bigarray-compat }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-mlgmpidl";
+  version = "1.3.0";
+  src = fetchFromGitHub {
+    owner = "nberth";
+    repo = "mlgmpidl";
+    rev = version;
+    hash = "sha256-ZmSDKZiHko8MCeIuZL53HjupfwO6PAm8QOCc9O3xJOk=";
+  };
+
+  nativeBuildInputs = [ perl ocaml findlib camlidl ];
+  buildInputs = [ gmp mpfr ];
+  propagatedBuildInputs = [ bigarray-compat ];
+
+  strictDeps = true;
+
+  prefixKey = "-prefix ";
+
+  postConfigure = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+  '';
+
+  meta = {
+    description = "OCaml interface to the GMP library";
+    homepage = "https://www.inrialpes.fr/pop-art/people/bjeannet/mlxxxidl-forge/mlgmpidl/";
+    license = lib.licenses.lgpl21;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mm/default.nix
new file mode 100644
index 000000000000..a9a393faf5d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mm/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator
+, alsa, ao, mad, pulseaudio, theora
+}:
+
+buildDunePackage rec {
+  pname = "mm";
+  version = "0.8.5";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-mm";
+    rev = "v${version}";
+    sha256 = "sha256-/83coQdUoaa1+5yapF/joV87uYpVsmWU7LH867Vmmo0=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ alsa ao mad pulseaudio theora ]; # ocamlsdl is blocked in nixpkgs from building for ocaml >= 4.06
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-mm";
+    description = "High-level library to create and manipulate multimedia streams";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mmap/default.nix
new file mode 100644
index 000000000000..b13639150b0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mmap/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "mmap";
+  version = "1.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mmap/releases/download/v${version}/mmap-v${version}.tbz";
+    sha256 = "0l6waidal2n8mkdn74avbslvc10sf49f5d889n838z03pra5chsc";
+  };
+
+  meta = {
+    homepage = "https://github.com/mirage/mmap";
+    description = "Function for mapping files in memory";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/morbig/default.nix b/nixpkgs/pkgs/development/ocaml-modules/morbig/default.nix
new file mode 100644
index 000000000000..6b8adcf7429c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/morbig/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, menhir, menhirLib, ppx_deriving_yojson, visitors, yojson
+}:
+
+buildDunePackage rec {
+  pname = "morbig";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "colis-anr";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-fOBaJHHP/Imi9UDLflI52OdKDcmMxpl+NH3pfofmv/o=";
+  };
+
+  duneVersion = "3";
+
+  nativeBuildInputs = [
+    menhir
+  ];
+
+  propagatedBuildInputs = [
+    menhirLib
+    ppx_deriving_yojson
+    visitors
+    yojson
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/colis-anr/${pname}";
+    description = "Static parser for POSIX Shell";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mparser/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mparser/default.nix
new file mode 100644
index 000000000000..602545382bc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mparser/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "mparser";
+  version = "1.3";
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "murmour";
+    repo = "mparser";
+    rev = version;
+    sha256 = "16j19v16r42gcsii6a337zrs5cxnf12ig0vaysxyr7sq5lplqhkx";
+  };
+
+  meta = {
+    description = "Simple monadic parser combinator OCaml library";
+    license = lib.licenses.lgpl21Plus;
+    homepage = "https://github.com/murmour/mparser";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mparser/pcre.nix b/nixpkgs/pkgs/development/ocaml-modules/mparser/pcre.nix
new file mode 100644
index 000000000000..6656deef1471
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mparser/pcre.nix
@@ -0,0 +1,12 @@
+{ buildDunePackage, ocaml_pcre, mparser }:
+
+buildDunePackage rec {
+  pname = "mparser-pcre";
+  useDune2 = true;
+
+  inherit (mparser) src version;
+
+  propagatedBuildInputs = [ ocaml_pcre mparser ];
+
+  meta = mparser.meta // { description = "PCRE-based regular expressions"; };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mrmime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mrmime/default.nix
new file mode 100644
index 000000000000..a2d118765616
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mrmime/default.nix
@@ -0,0 +1,78 @@
+{ afl-persistent
+, alcotest
+, angstrom
+, base64
+, bigarray-compat
+, bigarray-overlap
+, bigstringaf
+, buildDunePackage
+, cmdliner
+, emile
+, fetchzip
+, fmt
+, fpath
+, hxd
+, ipaddr
+, jsonm
+, ke
+, lib
+, mirage-crypto-rng
+, ocaml
+, pecu
+, prettym
+, ptime
+, rosetta
+, rresult
+, unstrctrd
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "mrmime";
+  version = "0.5.0";
+
+  src = fetchzip {
+    url = "https://github.com/mirage/mrmime/releases/download/v${version}/mrmime-v${version}.tbz";
+    sha256 = "14k67v0b39b8jq3ny2ymi8g8sqx2gd81mlzsjphdzdqnlx6fk716";
+  };
+
+  duneVersion = "3";
+
+  buildInputs = [ cmdliner hxd ];
+
+  propagatedBuildInputs = [
+    angstrom
+    base64
+    emile
+    fmt
+    ipaddr
+    ke
+    pecu
+    prettym
+    ptime
+    rosetta
+    rresult
+    unstrctrd
+    uutf
+    afl-persistent
+    bigarray-compat
+    bigarray-overlap
+    bigstringaf
+    fpath
+    mirage-crypto-rng
+  ];
+
+  checkInputs = [
+    alcotest
+    jsonm
+  ];
+  doCheck = lib.versionOlder ocaml.version "5.0";
+
+  meta = {
+    description = "Parser and generator of mail in OCaml";
+    homepage = "https://github.com/mirage/mrmime";
+    license = lib.licenses.mit;
+    maintainers = [ ];
+    mainProgram = "mrmime.generate";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/msat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/msat/default.nix
new file mode 100644
index 000000000000..7cb512a942d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/msat/default.nix
@@ -0,0 +1,36 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, iter
+, containers
+, mdx
+}:
+
+buildDunePackage rec {
+  pname = "msat";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "Gbury";
+    repo = "mSAT";
+    rev = "v${version}";
+    hash = "sha256-ER7ZUejW+Zy3l2HIoFDYbR8iaKMvLZWaeWrOAAYXjG4=";
+  };
+
+  propagatedBuildInputs = [
+    iter
+  ];
+
+  postPatch = ''
+    substituteInPlace dune --replace mdx ocaml-mdx
+  '';
+
+  doCheck = true;
+  checkInputs = [ containers ];
+  nativeCheckInputs = [ mdx.bin ];
+
+  meta = {
+    description = "Modular sat/smt solver with proof output";
+    homepage = "https://gbury.github.io/mSAT/";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/msgpck/default.nix b/nixpkgs/pkgs/development/ocaml-modules/msgpck/default.nix
new file mode 100644
index 000000000000..2871e774f3fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/msgpck/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, ocplib-endian
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "msgpck";
+  version = "1.7";
+
+  src = fetchFromGitHub {
+    owner = "vbmithr";
+    repo = "ocaml-msgpck";
+    rev = "${version}";
+    hash = "sha256-gBHIiicmk/5KBkKzRKyV0ymEH8dGCZG8vfE0mtpcDCM=";
+  };
+
+  propagatedBuildInputs = [ ocplib-endian ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Fast MessagePack (http://msgpack.org) library ";
+    license = lib.licenses.isc;
+    homepage = "https://github.com/vbmithr/ocaml-msgpck";
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix
new file mode 100644
index 000000000000..ff53efb9d9a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "mtime is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-mtime";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/mtime/releases/mtime-${version}.tbz";
+    sha256 = "Pz2g6gBts0RlsDCE3npYqxWg8W9HgoxQC+U63fHgROs=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "Monotonic wall-clock time for OCaml";
+    homepage = "https://erratique.ch/software/mtime";
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.vbgl ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/multipart-form-data/default.nix b/nixpkgs/pkgs/development/ocaml-modules/multipart-form-data/default.nix
new file mode 100644
index 000000000000..4d44f3b97763
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/multipart-form-data/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, lwt, lwt_ppx, stringext
+, alcotest }:
+
+buildDunePackage rec {
+  pname = "multipart-form-data";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "cryptosense";
+    repo = pname;
+    rev = version;
+    hash = "sha256-3MYJDvVbPIv/JDiB9nKcLRFC5Qa0afyEfz7hk8MWRII=";
+  };
+
+  buildInputs = [ lwt_ppx ];
+  propagatedBuildInputs = [ lwt stringext ];
+
+  duneVersion = "3";
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Parser for multipart/form-data (RFC2388)";
+    homepage = "https://github.com/cryptosense/multipart-form-data";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix
new file mode 100644
index 000000000000..ce2201c37873
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub, ezjsonm, menhir, menhirLib, ounit }:
+
+buildDunePackage rec {
+  pname = "mustache";
+  version = "3.1.0";
+  duneVersion = "3";
+  src = fetchFromGitHub {
+    owner = "rgrinberg";
+    repo = "ocaml-mustache";
+    rev = "v${version}";
+    sha256 = "19v8rk8d8lkfm2rmhdawfgadji6wa267ir5dprh4w9l1sfj8a1py";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  buildInputs = [ ezjsonm ];
+  propagatedBuildInputs = [ menhirLib ];
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "Mustache logic-less templates in OCaml";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix
new file mode 100644
index 000000000000..c980984a26c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, libmysqlclient }:
+
+# TODO: la versione stabile da' un errore di compilazione dovuto a
+# qualche cambiamento negli header .h
+# TODO: compilazione di moduli dipendenti da zip, ssl, tcl, gtk, gtk2
+
+let
+  pname = "ocaml-mysql";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "1.2.1";
+
+  src = fetchurl {
+    url = "http://ygrek.org.ua/p/release/ocaml-mysql/${name}.tar.gz";
+    sha256 = "06mb2bq7v37wn0lza61917zqgb4bsg1xxb73myjyn88p6khl6yl2";
+  };
+
+  configureFlags = [
+     "--prefix=$out"
+     "--libdir=$out/lib/ocaml/${ocaml.version}/site-lib/mysql"
+  ];
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  propagatedBuildInputs = [ libmysqlclient ];
+
+  strictDeps = true;
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/ygrek/ocaml-mysql/compare/v1.2.1...d6d1b3b262ae2cf493ef56f1dd7afcf663a70a26.patch";
+      sha256 = "0018s2wcrvbsw9yaqmwq500qmikwffrgdp5xg9b8v7ixhd4gi6hn";
+    })
+  ];
+
+  meta = {
+    homepage = "http://ocaml-mysql.forge.ocamlcore.org";
+    description = "Bindings for interacting with MySQL databases from ocaml";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.roconnor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix b/nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix
new file mode 100644
index 000000000000..8b0dbec39276
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppx_sexp_conv
+, ppx_cstruct
+, lwt
+, mirage-net
+, io-page
+, mirage-xen
+, ipaddr
+, mirage-profile
+, shared-memory-ring
+, sexplib
+, logs
+, macaddr
+, lwt-dllist
+, result
+}:
+
+buildDunePackage rec {
+  pname = "netchannel";
+  version = "2.1.2";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-net-xen/releases/download/v${version}/mirage-net-xen-${version}.tbz";
+    hash = "sha256-lTmwcNKiaq5EdJdM4UaaAVdZ+hTCX5U9MPKY/r3i7fw=";
+  };
+
+  buildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    ppx_sexp_conv
+    lwt
+    mirage-net
+    io-page
+    mirage-xen
+    ipaddr
+    mirage-profile
+    shared-memory-ring
+    sexplib
+    logs
+    macaddr
+    lwt-dllist
+    result
+  ];
+
+  meta = with lib; {
+    description = "Network device for reading and writing Ethernet frames via then Xen netfront/netback protocol";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/mirage-net-xen";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ninja_utils/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ninja_utils/default.nix
new file mode 100644
index 000000000000..2510cc93abbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ninja_utils/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchzip, buildDunePackage, re }:
+
+buildDunePackage rec {
+  pname = "ninja_utils";
+  version = "0.9.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchzip {
+    url = "https://github.com/CatalaLang/ninja_utils/archive/refs/tags/${version}.tar.gz";
+    hash = "sha256-VSj1IXfczoI3lSAtOqQPIqsxX+HgyxKzlssKd7By/Lo=";
+  };
+
+  propagatedBuildInputs = [ re ];
+
+  meta = {
+    description = "Small library used to generate Ninja build files";
+    homepage = "https://github.com/CatalaLang/ninja_utils";
+    license = lib.licenses.asl20;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
new file mode 100644
index 000000000000..748196bf28e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchzip, buildDunePackage, ocaml }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "nonstd is not available for OCaml ≥ 5.0"
+
+buildDunePackage rec {
+  pname = "nonstd";
+  version = "0.0.3";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchzip {
+    url = "https://bitbucket.org/smondet/${pname}/get/${pname}.${version}.tar.gz";
+    sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46";
+  };
+
+  duneVersion = if lib.versionAtLeast ocaml.version "4.12" then "2" else "1";
+  postPatch = lib.optionalString (duneVersion != "1") "dune upgrade";
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://bitbucket.org/smondet/nonstd";
+    description = "Non-standard mini-library";
+    license = licenses.isc;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/note/default.nix b/nixpkgs/pkgs/development/ocaml-modules/note/default.nix
new file mode 100644
index 000000000000..11ab46a2af0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/note/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, brr }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "note is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-note";
+  version = "0.0.3";
+  src = fetchurl {
+    url = "https://erratique.ch/software/note/releases/note-${version}.tbz";
+    hash = "sha256-ZZOvCnyz7UWzFtGFI1uC0ZApzyylgZYM/HYIXGVXY2k=";
+  };
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+  inherit (topkg) buildPhase installPhase;
+
+  propagatedBuildInputs = [ brr ];
+
+  meta = {
+    homepage = "https://erratique.ch/software/note";
+    description = "OCaml module for functional reactive programming";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/notty/default.nix b/nixpkgs/pkgs/development/ocaml-modules/notty/default.nix
new file mode 100644
index 000000000000..9bab0482668e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/notty/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, cppo
+, uutf
+, lwt
+}:
+
+buildDunePackage rec {
+  version = "0.2.3";
+  pname = "notty";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
+    sha256 = "sha256-dGWfsUBz20Q4mJiRqyTyS++Bqkl9rBbZpn+aHJwgCCQ=";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  propagatedBuildInputs = [ lwt uutf ];
+
+  meta = with lib; {
+    homepage = "https://github.com/pqwy/notty";
+    description = "Declarative terminal graphics for OCaml";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/npy/default.nix b/nixpkgs/pkgs/development/ocaml-modules/npy/default.nix
new file mode 100644
index 000000000000..f604780f4769
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/npy/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, numpy, camlzip }:
+
+buildDunePackage rec {
+  pname = "npy";
+  version = "0.0.9";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "LaurentMazare";
+    repo   = "${pname}-ocaml";
+    rev    = version;
+    hash = "sha256:1fryglkm20h6kdqjl55b7065b34bdg3g3p6j0jv33zvd1m5888m1";
+  };
+
+  propagatedBuildInputs = [ camlzip ];
+  nativeCheckInputs = [ numpy ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "OCaml implementation of the Npy format spec";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/num/default.nix b/nixpkgs/pkgs/development/ocaml-modules/num/default.nix
new file mode 100644
index 000000000000..d41d0f851fa5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/num/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, withStatic ? false }:
+
+stdenv.mkDerivation (rec {
+  version = "1.1";
+  pname = "ocaml${ocaml.version}-num";
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = "num";
+    rev = "v${version}";
+    sha256 = "0a4mhxgs5hi81d227aygjx35696314swas0vzy3ig809jb7zq4h0";
+  };
+
+  patches = [ (fetchpatch {
+      url = "https://github.com/ocaml/num/commit/6d4c6d476c061298e6385e8a0864f083194b9307.patch";
+      sha256 = "18zlvb5n327q8y3c52js5dvyy29ssld1l53jqng8m9w1k24ypi0b";
+    })
+  ] ++ lib.optional withStatic ./enable-static.patch;
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "Legacy Num library for arbitrary-precision integer and rational arithmetic";
+    license = lib.licenses.lgpl21;
+    inherit (ocaml.meta) platforms;
+    inherit (src.meta) homepage;
+  };
+} // (lib.optionalAttrs (lib.versions.majorMinor ocaml.version == "4.06") {
+    env.NIX_CFLAGS_COMPILE = "-fcommon";
+  })
+)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/num/enable-static.patch b/nixpkgs/pkgs/development/ocaml-modules/num/enable-static.patch
new file mode 100644
index 000000000000..be3ca197f4ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/num/enable-static.patch
@@ -0,0 +1,12 @@
+diff -u a/src/Makefile b/src/Makefile
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -45,7 +45,7 @@
+ endif
+ 
+ libnums.$(A): $(COBJS)
+-	$(OCAMLMKLIB) -oc nums $(COBJS)
++	$(OCAMLMKLIB) -custom -oc nums $(COBJS)
+ 
+ nums.cma: $(CMOS)
+	 $(OCAMLMKLIB) -o nums -oc nums -linkall $(CMOS)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/META.patch b/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/META.patch
new file mode 100644
index 000000000000..ba6e5927b00a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/META.patch
@@ -0,0 +1,16 @@
+diff -Naur cairo-ocaml-1.2.0.ori/META cairo-ocaml-1.2.0/META
+--- cairo-ocaml-1.2.0.ori/META	1970-01-01 01:00:00.000000000 +0100
++++ cairo-ocaml-1.2.0/META	2013-06-04 03:31:32.000000000 +0200
+@@ -0,0 +1,12 @@
++name = "cairo-ocaml"
++description = "Bindings to the cairo library."
++version = "@VERSION@"
++archive(byte) = "cairo.cma"
++archive(native) = "cairo.cmxa"
++requires = "bigarray"
++
++package "lablgtk2" (
++        requires = "cairo lablgtk2"
++        archive(byte) = "cairo_lablgtk.cma"
++        archive(native) = "cairo_lablgtk.cmxa"
++)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/default.nix
new file mode 100644
index 000000000000..2c2ffecf3dba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/default.nix
@@ -0,0 +1,50 @@
+{stdenv, lib, fetchurl, automake, ocaml, autoconf, gnum4, pkg-config, freetype, lablgtk, unzip, cairo, findlib, gdk-pixbuf, gtk2, pango }:
+
+let
+  pname = "ocaml-cairo";
+in
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "${pname} is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip";
+    sha256 = "0l4p9bp6kclr570mxma8wafibr1g5fsjj8h10yr4b507g0hmlh0l";
+  };
+
+  patches = [ ./META.patch ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config unzip ocaml automake gnum4 autoconf findlib ];
+  buildInputs = [ freetype lablgtk cairo gdk-pixbuf gtk2 pango ];
+
+  createFindlibDestdir = true;
+
+ preConfigure = ''
+   aclocal -I support
+   autoconf
+   export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`"
+   export LABLGTKDIR=${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2
+   cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/pango.ml ./src
+   cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/gaux.ml ./src
+  '';
+
+  postInstall = ''
+    cp META $out/lib/ocaml/${ocaml.version}/site-lib/cairo/
+  '';
+
+  makeFlags = [ "INSTALLDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/cairo" ];
+
+  meta = {
+    homepage = "http://cairographics.org/cairo-ocaml";
+    description = "ocaml bindings for cairo library";
+    license = lib.licenses.gpl2;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch
new file mode 100644
index 000000000000..25a7b92f01fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch
@@ -0,0 +1,49 @@
+commit b273c9f7ab10475787db4d6e09bd4b71b374d0ec
+Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
+Date:   Thu Mar 18 01:28:46 2021 +0100
+
+    Let user specify solo5-binding to use
+    
+    This is a little feature for the configure script I wanted to have for
+    the NixOS package: It allows the user to set PKG_CONFIG_DEPS before
+    running configure.sh to disable the autodetection mechanism. This is
+    useful for NixOS as we have all bindings bundled in the solo5 package,
+    so the result would also be solo5-bindings-xen. Additionally, it allows
+    us to do the binding selection declaratively and minimize the risk of
+    accidentally switching backend.
+    
+    PKG_CONFIG_DEPS seems like a bit of an unappropriate variable name for a
+    user “interface”, let me know if you want a dedicated environment
+    variable for this in case there will be more PKG_CONFIG_DEPS.
+
+diff --git a/configure.sh b/configure.sh
+index c254f7b..c675a02 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -11,13 +11,19 @@ if pkg_exists solo5-bindings-hvt solo5-bindings-spt solo5-bindings-virtio solo5-
+     echo "ERROR: Only one of solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode, solo5-bindings-xen can be installed." 1>&2
+     exit 1
+ fi
+-PKG_CONFIG_DEPS=
+-pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
+-pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
+-pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
+-pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
+-pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
+-pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
++if [ -z "${PKG_CONFIG_DEPS}" ]; then
++    PKG_CONFIG_DEPS=
++    pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt
++    pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt
++    pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen
++    pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio
++    pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode
++    pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen
++else
++    pkg_exists "${PKG_CONFIG_DEPS}" \
++        || (echo "ERROR: ${PKG_CONFIG_DEPS} is not installed" 1>&2; exit 1) \
++        || exit 1
++fi
+ if [ -z "${PKG_CONFIG_DEPS}" ]; then
+     echo "ERROR: No supported Solo5 bindings package found." 1>&2
+     echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix
new file mode 100644
index 000000000000..e3627431d959
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, ocaml
+, pkg-config
+, solo5
+, target ? "xen"
+}:
+
+# note: this is not technically an ocaml-module,
+# but can be built with different compilers, so
+# the ocamlPackages set is very useful.
+
+let
+  pname = "ocaml-freestanding";
+in
+
+if lib.versionOlder ocaml.version "4.08"
+then builtins.throw "${pname} is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  inherit pname;
+  version = "0.6.5";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256:1mbyjzwcs64n7i3xkkyaxgl3r46drbl0gkqf3fqgm2kh3q03638l";
+  };
+
+  postUnpack = ''
+    # get ocaml-src from the ocaml drv instead of via ocamlfind
+    mkdir -p "${src.name}/ocaml"
+    tar --strip-components=1 -xf ${ocaml.src} -C "${src.name}/ocaml"
+  '';
+
+  patches = [
+    ./no-opam.patch
+    ./configurable-binding.patch
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    ocaml
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [ solo5 ];
+
+  configurePhase = ''
+    runHook preConfigure
+    env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh
+    runHook postConfigure
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    ./install.sh "$out"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    broken = true; # Not compatible with solo5 ≥ 0.7
+    description = "Freestanding OCaml runtime";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/ocaml-freestanding";
+    platforms = builtins.map ({ arch, os }: "${arch}-${os}")
+      (cartesianProduct {
+          arch = [ "aarch64" "x86_64" ];
+          os = [ "linux" ];
+      } ++ [
+        { arch = "x86_64"; os = "freebsd"; }
+        { arch = "x86_64"; os = "openbsd"; }
+      ]);
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch
new file mode 100644
index 000000000000..45f271ec0f25
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch
@@ -0,0 +1,47 @@
+commit 637b7ce639d54e617170433aa9596176b167d085
+Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
+Date:   Thu Mar 18 01:07:49 2021 +0100
+
+    Allow building without ocamlfind and opam
+    
+    This change is the result of my first go at packaging ocaml-freestanding
+    for NixOS. Our build infrastructure for ocaml there is completely
+    independent of opam at the moment, so depending on opam for the build
+    time is not an option, especially in this case where the information it
+    would give us would be garbage.
+    
+    Fortunately the build environment plays nicely with pkg-config which is
+    already heavily used by ocaml-freestanding. This patch leaves pkg-config
+    to its own devices if opam is not present (it can be assisted by a
+    manually set PKG_CONFIG_PATH environment variable).
+    
+    Additionally, in configure.sh we check if the target ocaml source
+    directory already exists. This allows for building ocaml-freestanding
+    without the ocaml-src package (which would be unnecessarily cumbersome
+    to package for NixOS) and ocamlfind (one less dependency is always a
+    nice bonus). The Makefile needs no fix since the target ocaml/Makefile
+    won't be built if it's already present.
+
+diff --git a/configure.sh b/configure.sh
+index 4d154ed..c254f7b 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -1,6 +1,8 @@
+ #!/bin/sh
+ 
+-export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig
++if command -v opam &> /dev/null; then
++    export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig
++fi
+ pkg_exists() {
+     pkg-config --exists "$@"
+ }
+@@ -21,7 +23,7 @@ if [ -z "${PKG_CONFIG_DEPS}" ]; then
+     echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2
+     exit 1
+ fi
+-ocamlfind query ocaml-src >/dev/null || exit 1
++[ -e "$(dirname "$0")/ocaml" ] || ocamlfind query ocaml-src >/dev/null || exit 1
+ 
+ FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})"
+ BUILD_ARCH="$(uname -m)"
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix
new file mode 100644
index 000000000000..3fde1d463cc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, ocaml, ocaml_gettext, camomile, ounit, fileutils }:
+
+buildDunePackage {
+  pname = "gettext-camomile";
+  inherit (ocaml_gettext) src version;
+
+  propagatedBuildInputs = [
+    (camomile.override { version = "1.0.2"; })
+    ocaml_gettext
+  ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit fileutils ];
+
+  meta = (builtins.removeAttrs ocaml_gettext.meta [ "mainProgram" ]) // {
+    description = "Internationalization library using camomile (i18n)";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/default.nix
new file mode 100644
index 000000000000..c65f50646974
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchurl, buildDunePackage, cppo, gettext, fileutils, ounit }:
+
+buildDunePackage rec {
+  pname = "gettext";
+  version = "0.4.2";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ocaml-gettext/releases/download/v${version}/gettext-v${version}.tbz";
+    sha256 = "19ynsldb21r539fiwz1f43apsdnx7hj2a2d9qr9wg2hva9y2qrwb";
+  };
+
+  nativeBuildInputs = [ cppo ];
+
+  propagatedBuildInputs = [ gettext fileutils ];
+
+  # Tests for version 0.4.2 are not compatible with OUnit 2.2.6
+  doCheck = false;
+
+  checkInputs = [ ounit ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "OCaml Bindings to gettext";
+    homepage = "https://github.com/gildor478/ocaml-gettext";
+    license = licenses.lgpl21;
+    maintainers = [ ];
+    mainProgram = "ocaml-gettext";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix
new file mode 100644
index 000000000000..7c197f9e87b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, ocaml, ocaml_gettext, dune-configurator, ounit }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "gettext-stub is not available for OCaml ${ocaml.version}"
+
+buildDunePackage {
+
+  pname = "gettext-stub";
+
+  inherit (ocaml_gettext) src version;
+
+  minimalOCamlVersion = "4.06";
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ ocaml_gettext ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  checkInputs = [ ounit ];
+
+  meta = builtins.removeAttrs ocaml_gettext.meta  [ "mainProgram" ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix
new file mode 100644
index 000000000000..67741516af19
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitLab, libvirt, AppKit, Foundation, autoreconfHook, pkg-config, ocaml, findlib, perl }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
+  "libvirt is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-libvirt";
+  version = "0.6.1.5";
+
+  src = fetchFromGitLab {
+    owner = "libvirt";
+    repo = "libvirt-ocaml";
+    rev = "v${version}";
+    sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k";
+  };
+
+  propagatedBuildInputs = [ libvirt ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    Foundation
+    AppKit
+  ];
+
+  strictDeps = true;
+
+  buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
+  installTargets = "install-opt";
+  preInstall = ''
+    # Fix 'dllmllibvirt.so' install failure into non-existent directory.
+    mkdir -p $OCAMLFIND_DESTDIR/stublibs
+  '';
+
+  meta = with lib; {
+    description = "OCaml bindings for libvirt";
+    homepage = "https://libvirt.org/ocaml/";
+    license = licenses.gpl2;
+    maintainers = [ ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
new file mode 100644
index 000000000000..a8178c6ef717
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildDunePackage
+, lsp
+, xdg
+, re
+, fiber
+, makeWrapper
+, dot-merlin-reader
+, spawn
+, ocamlc-loc
+, merlin-lib
+, astring
+, camlp-streams
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-lsp-server";
+  inherit (lsp) version src preBuild;
+  duneVersion = "3";
+
+  buildInputs = lsp.buildInputs ++ [ lsp re ]
+  ++ lib.optional (lib.versionAtLeast version "1.9") spawn
+  ++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ]
+  ++ lib.optional (lib.versionAtLeast version "1.14.2") ocamlc-loc
+  ++ lib.optionals (lib.versionAtLeast version "1.17.0") [ astring camlp-streams merlin-lib ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
+  '';
+
+  meta = lsp.meta // {
+    description = "OCaml Language Server Protocol implementation";
+    mainProgram = "ocamllsp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
new file mode 100644
index 000000000000..aee22a26bd18
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
@@ -0,0 +1,78 @@
+{ buildDunePackage
+, stdlib-shims
+, ppx_yojson_conv_lib
+, ocaml-syntax-shims
+, yojson
+, result
+, fetchurl
+, lib
+, ocaml
+, version ?
+    if lib.versionAtLeast ocaml.version "4.14" then
+      "1.17.0"
+    else if lib.versionAtLeast ocaml.version "4.13" then
+      "1.10.5"
+    else if lib.versionAtLeast ocaml.version "4.12" then
+      "1.9.0"
+    else
+      "1.4.1"
+}:
+
+let params = {
+  "1.17.0" = {
+    name = "lsp";
+    minimalOCamlVersion = "4.14";
+    sha256 = "sha256-j7i71xfu/SYItNg0WBBbZg4N46ETTcj8IWrmWdTRlgA=";
+  };
+  "1.14.2" = {
+    name = "lsp";
+    minimalOCamlVersion = "4.14";
+    sha256 = "sha256-1R+HYaGbPLGDs5DMN3jmnrZFMhMmPUHgF+s+yNzIVJQ=";
+  };
+  "1.10.5" = {
+    name = "jsonrpc";
+    minimalOCamlVersion = "4.13";
+    sha256 = "sha256-TeJS6t1ruWhWPvWNatrnSUWI6T17XKiosHLYizBDDcw=";
+  };
+  "1.9.0" = {
+    name = "jsonrpc";
+    minimalOCamlVersion = "4.12";
+    sha256 = "sha256:1ac44n6g3rf84gvhcca545avgf9vpkwkkkm0s8ipshfhp4g4jikh";
+  };
+  "1.4.1" = {
+    name = "jsonrpc";
+    minimalOCamlVersion = "4.06";
+    sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f";
+  };
+}."${version}"; in
+
+buildDunePackage rec {
+  pname = "jsonrpc";
+  inherit version;
+  src = fetchurl {
+    url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/${params.name}-${version}.tbz";
+    inherit (params) sha256;
+  };
+
+  duneVersion = "3";
+  inherit (params) minimalOCamlVersion;
+
+  buildInputs =
+    if lib.versionAtLeast version "1.7.0" then
+      [ ]
+    else
+      [ yojson stdlib-shims ocaml-syntax-shims ];
+
+  propagatedBuildInputs =
+    if lib.versionAtLeast version "1.7.0" then
+      [ ]
+    else
+      [ ppx_yojson_conv_lib result ];
+
+  meta = with lib; {
+    description = "Jsonrpc protocol implementation in OCaml";
+    license = licenses.isc;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
new file mode 100644
index 000000000000..49a6db7a118e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
@@ -0,0 +1,131 @@
+{ buildDunePackage
+, lib
+, cppo
+, stdlib-shims
+, ppx_yojson_conv_lib
+, ocaml-syntax-shims
+, jsonrpc
+, omd
+, octavius
+, dune-build-info
+, dune-rpc
+, uutf
+, dyn
+, re
+, stdune
+, chrome-trace
+, dune_3
+, csexp
+, result
+, pp
+, cmdliner
+, ordering
+, ocamlformat-rpc-lib
+, ocaml
+, version ?
+    if lib.versionAtLeast ocaml.version "4.14" then
+      "1.17.0"
+    else if lib.versionAtLeast ocaml.version "4.13" then
+      "1.10.5"
+    else if lib.versionAtLeast ocaml.version "4.12" then
+      "1.9.0"
+    else
+      "1.4.1"
+}:
+
+let jsonrpc_v = jsonrpc.override {
+  inherit version;
+}; in
+buildDunePackage rec {
+  pname = "lsp";
+  inherit (jsonrpc_v) version src;
+  duneVersion = "3";
+  minimalOCamlVersion =
+    if lib.versionAtLeast version "1.7.0" then
+      "4.12"
+    else
+      "4.06";
+
+  # unvendor some (not all) dependencies.
+  # They are vendored by upstream only because it is then easier to install
+  # ocaml-lsp without messing with your opam switch, but nix should prevent
+  # this type of problems without resorting to vendoring.
+  preBuild = lib.optionalString (lib.versionOlder version "1.10.4") ''
+    rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
+  '';
+
+  buildInputs =
+    if lib.versionAtLeast version "1.12.0" then
+      [
+        pp
+        re
+        ppx_yojson_conv_lib
+        octavius
+        dune-build-info
+        dune-rpc
+        omd
+        cmdliner
+        ocamlformat-rpc-lib
+        dyn
+        stdune
+        chrome-trace
+      ]
+    else if lib.versionAtLeast version "1.10.0" then
+      [
+        pp
+        re
+        ppx_yojson_conv_lib
+        octavius
+        dune-build-info
+        dune-rpc
+        omd
+        cmdliner
+        ocamlformat-rpc-lib
+        dyn
+        stdune
+      ]
+    else if lib.versionAtLeast version "1.7.0" then
+      [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ]
+    else
+      [
+        ppx_yojson_conv_lib
+        ocaml-syntax-shims
+        octavius
+        dune-build-info
+        omd
+        cmdliner
+      ];
+
+  nativeBuildInputs = lib.optional (lib.versionOlder version "1.7.0") cppo;
+
+  propagatedBuildInputs =
+    if lib.versionAtLeast version "1.14.0" then [
+      jsonrpc
+      ppx_yojson_conv_lib
+      uutf
+    ] else if lib.versionAtLeast version "1.10.0" then [
+      dyn
+      jsonrpc
+      ordering
+      ppx_yojson_conv_lib
+      stdune
+      uutf
+    ] else if lib.versionAtLeast version "1.7.0" then [
+      csexp
+      jsonrpc
+      pp
+      ppx_yojson_conv_lib
+      result
+      uutf
+    ] else [
+      csexp
+      jsonrpc
+      ppx_yojson_conv_lib
+      stdlib-shims
+      uutf
+    ];
+
+  meta = jsonrpc.meta // {
+    description = "LSP protocol implementation in OCaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-lua/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lua/default.nix
new file mode 100644
index 000000000000..8a09b1d9387e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lua/default.nix
@@ -0,0 +1,37 @@
+{ lib, fetchFromGitHub, buildDunePackage, lua5_1, pkg-config }:
+
+buildDunePackage {
+  pname = "ocaml-lua";
+  version = "1.8";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "pdonadeo";
+    repo = "ocaml-lua";
+    # Take the latest commit, as some warnings have been fixed/suppressed
+    rev = "f44ad50c88bf999f48a13af663051493c89d7d02";
+    hash = "sha256-AXtKrty8JdI+yc+Y9EiufBbySlr49OyXW6wKwmDb0xo=";
+  };
+
+  # ocaml-lua vendors and builds Lua: replace that with the one from nixpkgs
+  postPatch = ''
+    rm -r src/lua_c
+    substituteInPlace src/dune \
+      --replace "-Ilua_c/lua515/src" "" \
+      --replace "(libraries unix threads lua_c)" \
+                "(libraries unix threads) (c_library_flags -llua)"
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ lua5_1 ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Lua bindings for OCaml";
+    homepage = "https://pdonadeo.github.io/ocaml-lua";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.kenran ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
new file mode 100644
index 000000000000..9802d07d4a4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, result, ppx_derivers }:
+
+if lib.versionOlder "4.13" ocaml.version
+then throw "ocaml-migrate-parsetree-1.8 is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage rec {
+   pname = "ocaml-migrate-parsetree";
+   version = "1.8.0";
+
+   src = fetchFromGitHub {
+     owner = "ocaml-ppx";
+     repo = pname;
+     rev = "v${version}";
+     sha256 = "16x8sxc4ygxrr1868qpzfqyrvjf3hfxvjzmxmf6ibgglq7ixa2nq";
+   };
+
+   propagatedBuildInputs = [ ppx_derivers result ];
+
+   meta = {
+     description = "Convert OCaml parsetrees between different major versions";
+     license = lib.licenses.lgpl21;
+     maintainers = [ lib.maintainers.vbgl ];
+     inherit (src.meta) homepage;
+   };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix
new file mode 100644
index 000000000000..1ba2976bcc54
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, ocaml }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.1")
+  "ocaml-migrate-parsetree is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+   pname = "ocaml-migrate-parsetree";
+   version = "2.4.0";
+
+   minimalOCamlVersion = "4.02";
+
+   src = fetchurl {
+     url = "https://github.com/ocaml-ppx/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+     sha256 = "sha256-7EnEUtwzemIFVqtoK/AZi/UBglULUC2PsjClkSYKpqQ=";
+   };
+
+   meta = {
+     description = "Convert OCaml parsetrees between different major versions";
+     license = lib.licenses.lgpl21;
+     maintainers = with lib.maintainers; [ vbgl sternenseemann ];
+     homepage = "https://github.com/ocaml-ppx/ocaml-migrate-parsetree";
+   };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-monadic/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-monadic/default.nix
new file mode 100644
index 000000000000..50a04bbefab2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-monadic/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-monadic";
+  version = "0.5.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "zepalmer";
+    repo = pname;
+    rev = version;
+    sha256 = "1ynv3yhdqmkhkgnz6c5kv6ryjcc934sdvw9rhh8rjg2dlzlffgbw";
+  };
+
+  buildInputs = [ ppxlib ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "PPX extension to provide an OCaml-friendly monadic syntax";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix
new file mode 100644
index 000000000000..5180b58601af
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, dune-build-info
+, bos
+}:
+let
+  author = "avsm";
+  pname = "ocaml-print-intf";
+  version = "1.2.0";
+in
+buildDunePackage rec {
+  inherit pname version;
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = author;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0hw4gl7irarcywibdjqxmrga8f7yj52wgy7sc7n0wyy74jzxb8np";
+  };
+
+  buildInputs = [ dune-build-info bos ];
+
+  meta = with lib; {
+    description = "Pretty print an OCaml cmi/cmt/cmti file in human-readable OCaml signature form ";
+    homepage = "https://github.com/${author}/${pname}";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.nerdypepper ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix
new file mode 100644
index 000000000000..c89d9d7219ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc-plugin/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, pkg-config
+, protobuf
+, zarith
+, ppx_deriving
+, ppx_deriving_yojson
+, re
+, dune-site
+, ppx_expect
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-protoc-plugin";
+  version = "4.5.0";
+
+  src = fetchFromGitHub {
+    owner = "issuu";
+    repo = "ocaml-protoc-plugin";
+    rev = version;
+    hash = "sha256-ZHeOi3y2X11MmkRuthmYFSjPLoGlGTO1pnRfk/XmgPU=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    protobuf
+  ];
+  buildInputs = [
+    zarith
+    ppx_deriving
+    ppx_deriving_yojson
+    re
+    dune-site
+    ppx_expect
+    protobuf
+  ];
+  doCheck = true;
+  nativeCheckInputs = [ protobuf ];
+
+  meta = {
+    description = "Maps google protobuf compiler to Ocaml types";
+    homepage = "https://github.com/issuu/ocaml-protoc-plugin";
+    license = lib.licenses.asl20;
+    longDescription = ''
+      The goal of Ocaml protoc plugin is to create an
+      up to date plugin for the google protobuf compiler
+      (protoc) to generate Ocaml types and serialization
+      and de-serialization function from a .proto file.
+    '';
+    maintainers = [ lib.maintainers.GirardR1006 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix
new file mode 100644
index 000000000000..51ca531b0140
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage
+, pbrt
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-protoc";
+
+  inherit (pbrt) version src;
+
+  buildInputs = [ stdlib-shims ];
+  propagatedBuildInputs = [ pbrt ];
+
+  doCheck = true;
+
+  meta = pbrt.meta // {
+    description = "Protobuf Compiler for OCaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix
new file mode 100644
index 000000000000..8de5abf7e481
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix
@@ -0,0 +1,41 @@
+{ lib, fetchFromGitHub, fetchpatch, buildDunePackage, pkg-config, dune-configurator, stdio, R
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-r";
+  version = "0.6.0";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "pveber";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-jPyVMxjeh9+xu0dD1gelAxcOhxouKczyvzVoKZ5oSrs=";
+  };
+
+  # Finds R and Rmathlib separatley
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/pveber/ocaml-r/commit/aa96dc5.patch";
+      sha256 = "sha256-xW33W2ciesyUkDKEH08yfOXv0wP0V6X80or2/n2Nrb4=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config R ];
+  buildInputs = [ dune-configurator stdio R ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "OCaml bindings for the R interpreter";
+    inherit (src.meta) homepage;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.bcdarwin ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix
new file mode 100644
index 000000000000..2814c6c52806
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "result";
+  version = "1.5";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/result/releases/download/${version}/result-${version}.tbz";
+    sha256 = "0cpfp35fdwnv3p30a06wd0py3805qxmq3jmcynjc3x2qhlimwfkw";
+  };
+
+  meta = {
+    homepage = "https://github.com/janestreet/result";
+    description = "Compatibility Result module";
+    longDescription = ''
+      Projects that want to use the new result type defined in OCaml >= 4.03
+      while staying compatible with older version of OCaml should use the
+      Result module defined in this library.
+    '';
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix
new file mode 100644
index 000000000000..c7779b098e73
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildOasisPackage, minisat }:
+
+buildOasisPackage rec {
+  pname = "ocaml-sat-solvers";
+  version = "0.4";
+
+  minimumOCamlVersion = "4.03.0";
+
+  src = fetchFromGitHub {
+    owner  = "tcsprojects";
+    repo   = "ocaml-sat-solvers";
+    rev    = "v${version}";
+    sha256 = "1hxr16cyl1p1k1cik848mqrysq95wxmlykpm93a99pn55mp28938";
+  };
+
+  propagatedBuildInputs = [ minisat ];
+
+  meta = {
+    homepage = "https://github.com/tcsprojects/ocaml-sat-solvers";
+    description = "SAT Solvers For OCaml";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix
new file mode 100644
index 000000000000..49f8cb63b98b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.02.3";
+
+  pname = "ocaml-syntax-shims";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "1j7848khli4p7j8i2kmnvhdnhcwhy3zgdpf5ds5ic30ax69y3cl9";
+  };
+
+  useDune2 = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/ocaml-ppx/ocaml-syntax-shims";
+    description = "Backport new syntax to older OCaml versions";
+    mainProgram = "ocaml-syntax-shims";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-vdom/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-vdom/default.nix
new file mode 100644
index 000000000000..72c1cb148c20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-vdom/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchurl, buildDunePackage, js_of_ocaml-compiler , gen_js_api, ojs }:
+
+buildDunePackage rec {
+  pname = "ocaml-vdom";
+  version = "0.2";
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/LexiFi/ocaml-vdom/archive/refs/tags/v${version}.tar.gz";
+    sha256 = "sha256-FVR0WubW9VJBGVtVaXdJ+O/ghq0w5+BuItFWXkuVYL8=";
+  };
+
+  nativeBuildInputs = [
+    gen_js_api
+  ];
+
+  buildInputs = [
+    gen_js_api
+  ];
+
+  propagatedBuildInputs = [
+    js_of_ocaml-compiler
+    ojs
+  ];
+
+  meta = {
+    homepage = "https://github.com/LexiFi/ocaml-vdom";
+    description = "Elm architecture and (V)DOM for OCaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ jayesh-bhoot ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix
new file mode 100644
index 000000000000..a60b02e4f3c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, alcotest }:
+
+buildDunePackage rec {
+  pname = "ocaml-version";
+  version = "3.6.7";
+
+  src = fetchurl {
+    url = "https://github.com/ocurrent/ocaml-version/releases/download/v${version}/ocaml-version-${version}.tbz";
+    hash = "sha256-1Q/9W2adM+2w2InEdqcd5IiNkACNWDNgONIQztKPgQw=";
+  };
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  minimalOCamlVersion = "4.07";
+  duneVersion = "3";
+
+  meta = with lib; {
+    description = "Manipulate, parse and generate OCaml compiler version strings";
+    homepage = "https://github.com/ocurrent/ocaml-version";
+    license = licenses.isc;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlc-loc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlc-loc/default.nix
new file mode 100644
index 000000000000..3f2d9c013c45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlc-loc/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, dune_3, dyn }:
+
+buildDunePackage {
+  pname = "ocamlc-loc";
+  inherit (dune_3) src version;
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  preBuild = ''
+    rm -rf vendor/csexp
+    rm -rf vendor/pp
+  '';
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ dyn ];
+
+  meta = with lib; {
+    description = "Parse ocaml compiler output into structured form";
+    maintainers = [ maintainers.ulrikstrid ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/generic.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/generic.nix
new file mode 100644
index 000000000000..f8f8c9d99195
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/generic.nix
@@ -0,0 +1,68 @@
+{ lib, fetchurl, version ? "0.26.2", astring, base, camlp-streams, cmdliner_1_0
+, cmdliner_1_1, csexp, dune-build-info, either, fix, fpath, menhirLib, menhirSdk
+, ocaml-version, ocp-indent, odoc-parser, result, stdio, uuseg, uutf, ... }:
+
+# The ocamlformat package have been split into two in version 0.25.1:
+# one for the library and one for the executable.
+# Both have the same sources and very similar dependencies.
+
+rec {
+  tarballName = "ocamlformat-${version}.tbz";
+
+  src = fetchurl {
+    url =
+      "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/${tarballName}";
+    sha256 = {
+      "0.19.0" = "0ihgwl7d489g938m1jvgx8azdgq9f5np5mzqwwya797hx2m4dz32";
+      "0.20.0" = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
+      "0.20.1" = "sha256-fTpRZFQW+ngoc0T6A69reEUAZ6GmHkeQvxspd5zRAjU=";
+      "0.21.0" = "sha256-KhgX9rxYH/DM6fCqloe4l7AnJuKrdXSe6Y1XY3BXMy0=";
+      "0.22.4" = "sha256-61TeK4GsfMLmjYGn3ICzkagbc3/Po++Wnqkb2tbJwGA=";
+      "0.23.0" = "sha256-m9Pjz7DaGy917M1GjyfqG5Lm5ne7YSlJF2SVcDHe3+0=";
+      "0.24.0" = "sha256-Zil0wceeXmq2xy0OVLxa/Ujl4Dtsmc4COyv6Jo7rVaM=";
+      "0.24.1" = "sha256-AjQl6YGPgOpQU3sjcaSnZsFJqZV9BYB+iKAE0tX0Qc4=";
+      "0.25.1" = "sha256-3I8qMwyjkws2yssmI7s2Dti99uSorNKT29niJBpv0z0=";
+      "0.26.0" = "sha256-AxSUq3cM7xCo9qocvrVmDkbDqmwM1FexEP7IWadeh30=";
+      "0.26.1" = "sha256-2gBuQn8VuexhL7gI1EZZm9m3w+4lq+s9VVdHpw10xtc=";
+      "0.26.2" = "sha256-Lk9Za/eqNnqET+g7oPawvxSyplF53cCCNj/peT0DdcU=";
+    }."${version}";
+  };
+
+  inherit version;
+
+  odoc-parser_v = odoc-parser.override {
+    version = if lib.versionAtLeast version "0.24.0" then
+      "2.0.0"
+    else if lib.versionAtLeast version "0.20.1" then
+      "1.0.1"
+    else
+      "0.9.0";
+  };
+
+  cmdliner_v =
+    if lib.versionAtLeast version "0.21.0" then cmdliner_1_1 else cmdliner_1_0;
+
+  library_deps = [
+    base
+    cmdliner_v
+    dune-build-info
+    fix
+    fpath
+    menhirLib
+    menhirSdk
+    ocp-indent
+    stdio
+    uuseg
+    uutf
+  ] ++ lib.optionals (lib.versionAtLeast version "0.20.0") [
+    either
+    ocaml-version
+  ] ++ lib.optionals (lib.versionAtLeast version "0.22.4") [ csexp ]
+    ++ (if lib.versionOlder version "0.25.1" then
+      [ odoc-parser_v ]
+    else [
+      camlp-streams
+      result
+      astring
+    ]);
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix
new file mode 100644
index 000000000000..a6607ba83ccd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-lib.nix
@@ -0,0 +1,25 @@
+# Version can be selected with the 'version' argument, see generic.nix.
+{ lib, callPackage, buildDunePackage, menhir, ... }@args:
+
+let inherit (callPackage ./generic.nix args) src version library_deps;
+
+in assert (lib.versionAtLeast version "0.25.1");
+
+buildDunePackage {
+  pname = "ocamlformat-lib";
+  inherit src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  nativeBuildInputs = [ menhir ];
+
+  propagatedBuildInputs = library_deps;
+
+  meta = {
+    homepage = "https://github.com/ocaml-ppx/ocamlformat";
+    description = "Auto-formatter for OCaml code (library)";
+    maintainers = with lib.maintainers; [ Zimmi48 Julow ];
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
new file mode 100644
index 000000000000..d8dc1d54ffc0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
@@ -0,0 +1,26 @@
+# Version can be selected with the 'version' argument, see generic.nix.
+{ lib, buildDunePackage, ocaml, csexp, sexplib0, callPackage, ... }@args:
+
+let
+  # for compat with ocaml-lsp
+  version_arg =
+    if lib.versionAtLeast ocaml.version "4.13" then {} else { version = "0.20.0"; };
+
+  inherit (callPackage ./generic.nix (args // version_arg)) src version;
+
+in buildDunePackage rec {
+  pname = "ocamlformat-rpc-lib";
+  inherit src version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ csexp sexplib0 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ocaml-ppx/ocamlformat";
+    description = "Auto-formatter for OCaml code (RPC mode)";
+    license = licenses.mit;
+    maintainers = with maintainers; [ Zimmi48 Julow ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix
new file mode 100644
index 000000000000..e56b86409685
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat.nix
@@ -0,0 +1,39 @@
+# Version can be selected with the 'version' argument, see generic.nix.
+{ lib
+, callPackage
+, buildDunePackage
+, ocaml
+, re
+, ocamlformat-lib
+, menhir
+, ...
+}@args:
+
+let inherit (callPackage ./generic.nix args) src version library_deps;
+in
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0" && !lib.versionAtLeast version "0.23"
+          || lib.versionAtLeast ocaml.version "5.2" && !lib.versionAtLeast version "0.26.2")
+  "ocamlformat ${version} is not available for OCaml ${ocaml.version}"
+
+buildDunePackage {
+  pname = "ocamlformat";
+  inherit src version;
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs =
+    if lib.versionAtLeast version "0.25.1" then [ ] else [ menhir ];
+
+  buildInputs = [ re ] ++ library_deps
+    ++ lib.optionals (lib.versionAtLeast version "0.25.1")
+    [ (ocamlformat-lib.override { inherit version; }) ];
+
+  meta = {
+    homepage = "https://github.com/ocaml-ppx/ocamlformat";
+    description = "Auto-formatter for OCaml code";
+    maintainers = with lib.maintainers; [ Zimmi48 Julow ];
+    license = lib.licenses.mit;
+    mainProgram = "ocamlformat";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix
new file mode 100644
index 000000000000..8607a2a50344
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchFromGitHub, camlidl, fuse, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "ocamlfuse";
+  version = "2.7.1_cvs9";
+
+  src = fetchFromGitHub {
+    owner = "astrada";
+    repo = "ocamlfuse";
+    rev = "v${version}";
+    hash = "sha256-cOObHUAYiI2mN1qjsxcK6kHAmawuaGQOUNHqWioIvjM=";
+  };
+
+  postPatch = ''
+    substituteInPlace lib/Fuse_main.c \
+      --replace-warn "<fuse_lowlevel.h>" "<fuse/fuse_lowlevel.h>"
+  '';
+
+  nativeBuildInputs = [ camlidl ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ camlidl fuse ];
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/ocamlfuse";
+    description = "OCaml bindings for FUSE";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ bennofs ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix
new file mode 100644
index 000000000000..c075fc59be1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage, stdlib-shims }:
+
+buildDunePackage rec {
+  pname = "ocamlgraph";
+  version = "2.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/ocamlgraph/releases/download/${version}/ocamlgraph-${version}.tbz";
+    hash = "sha256-D5YsNvklPfI5OVWvQbB0tqQmsvkqne95WyAFtX0wLWU=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  meta = with lib; {
+      homepage = "https://github.com/backtracking/ocamlgraph";
+      description = "Graph library for OCaml";
+      license = licenses.gpl2Oss;
+      maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix
new file mode 100644
index 000000000000..e8167356f939
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix
@@ -0,0 +1,12 @@
+{ buildDunePackage, lablgtk, ocamlgraph, stdlib-shims, ... }:
+
+buildDunePackage rec {
+  pname = "ocamlgraph_gtk";
+  inherit (ocamlgraph) version src meta;
+
+  propagatedBuildInputs = [
+    lablgtk
+    ocamlgraph
+    stdlib-shims
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamline/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamline/default.nix
new file mode 100644
index 000000000000..694988df7dc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamline/default.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, linenoise, fetchFromGitHub, lib }:
+
+buildDunePackage rec {
+  pname = "ocamline";
+  version = "1.2";
+  src = fetchFromGitHub {
+    owner = "chrisnevers";
+    repo = pname;
+    rev = version;
+    sha256 = "Sljm/Bfr2Eo0d75tmJRuWUkkfHUYQ0g27+FzXBePnVg=";
+  };
+
+  propagatedBuildInputs = [ linenoise ];
+
+  meta = with lib; {
+    homepage = "https://chrisnevers.github.io/ocamline/";
+    description = "Command line interface for user input";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ mgttlinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/default.nix
new file mode 100644
index 000000000000..a2071a9dfaad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/default.nix
@@ -0,0 +1,30 @@
+{stdenv, lib, fetchurl}:
+
+let
+
+  version = "6.37.0";
+  sha256 = "99ff58080ed154cc4bd70f915fe4760dffb026a1c0447caa0b3bdb982b24b0a8";
+
+in stdenv.mkDerivation {
+  pname = "ocaml-make";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://bitbucket.org/mmottl/ocaml-makefile/downloads/ocaml-makefile-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  installPhase = ''
+    mkdir -p "$out/include/"
+    cp OCamlMakefile "$out/include/"
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    homepage = "http://www.ocaml.info/home/ocaml_sources.html";
+    description = "Generic OCaml Makefile for GNU Make";
+    license = "LGPL";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh b/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh
new file mode 100644
index 000000000000..6d9504370165
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh
@@ -0,0 +1,5 @@
+addOcamlMakefile () {
+    export OCAMLMAKEFILE="@out@/include/OCamlMakefile"
+}
+
+addEnvHooks "$targetOffset" addOcamlMakefile
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlnat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlnat/default.nix
new file mode 100644
index 000000000000..850c29c4dc02
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlnat/default.nix
@@ -0,0 +1,47 @@
+{stdenv, lib, fetchurl, ocaml, findlib, ounit}:
+
+# https://github.com/bmeurer/ocamlnat/issues/3
+assert lib.versionOlder ocaml.version "4";
+
+stdenv.mkDerivation rec {
+  pname = "ocamlnat";
+  version = "0.1.1";
+
+  src = fetchurl {
+    url = "http://benediktmeurer.de/files/source/${pname}-${version}.tar.bz2";
+    sha256 = "0dyvy0j6f47laxhnadvm71z1py9hz9zd49hamf6bij99cggb2ij1";
+  };
+
+  nativeBuildInputs = [ocaml findlib ];
+  checkInputs = [ ounit ];
+
+  strictDeps = true;
+
+  prefixKey = "--prefix ";
+
+  doCheck = true;
+
+  checkTarget = "test";
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "OCaml native toplevel";
+    homepage = "http://benediktmeurer.de/ocamlnat/";
+    license = lib.licenses.qpl;
+    longDescription = ''
+      The ocamlnat project provides a new native code OCaml toplevel
+      ocamlnat, which is mostly compatible to the byte code toplevel ocaml,
+      but up to 100 times faster. It is based on the optimizing native code
+      compiler, the native runtime and an earlier prototype by Alain
+      Frisch. It is build upon Just-In-Time techniques and currently
+      supports Unix-like systems (i.e. Linux, BSD or macOS) running on
+      x86 or x86-64 processors. Support for additional architectures and
+      operating systems is planned, but not yet available.
+    '';
+    inherit (ocaml.meta) platforms;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix
new file mode 100644
index 000000000000..7fb262a91ac4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip
+, gnutls, nettle
+}:
+
+lib.throwIf (lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "5.0")
+  "ocamlnet is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-ocamlnet";
+  version = "4.1.9";
+
+  src = fetchurl {
+    url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
+    sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr";
+  };
+
+  nativeBuildInputs = [ pkg-config which ocaml findlib ];
+  buildInputs = [ ncurses ocaml_pcre camlzip gnutls nettle ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  preConfigure = ''
+    configureFlagsArray=(
+      -bindir $out/bin
+      -enable-gnutls
+      -enable-zip
+      -enable-pcre
+      -disable-gtk2
+      -with-nethttpd
+      -datadir $out/lib/ocaml/${ocaml.version}/ocamlnet
+    )
+  '';
+
+  buildPhase = ''
+    make all
+    make opt
+  '';
+
+  meta = {
+    homepage = "http://projects.camlcity.org/projects/ocamlnet.html";
+    description = "Library implementing Internet protocols (http, cgi, email, etc.) for OCaml";
+    license = "Most Ocamlnet modules are released under the zlib/png license. The HTTP server module Nethttpd is, however, under the GPL.";
+    inherit (ocaml.meta) platforms;
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix
new file mode 100644
index 000000000000..fcd63ced7a80
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, topkg, astring }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-ocb-stubblr";
+  version = "0.1.0";
+
+  src = fetchzip {
+    url = "https://github.com/pqwy/ocb-stubblr/releases/download/v${version}/ocb-stubblr-${version}.tbz";
+    name = "src.tar.bz";
+    sha256 = "0hpds1lkq4j8wgslv7hnirgfrjmqi36h5rarpw9mwf24gfp5ays2";
+  };
+
+  patches = [ ./pkg-config.patch ];
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ocamlbuild ];
+
+  propagatedBuildInputs = [ astring ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "OCamlbuild plugin for C stubs";
+    homepage = "https://github.com/pqwy/ocb-stubblr";
+    license = lib.licenses.isc;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch b/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch
new file mode 100644
index 000000000000..d86b3f8da9f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch
@@ -0,0 +1,25 @@
+--- a/src/ocb_stubblr.ml	1970-01-01 00:00:01.000000000 +0000
++++ b/src/ocb_stubblr.ml	2016-12-04 11:10:10.000000000 +0000
+@@ -31,20 +31,9 @@
+ 
+   (* XXX Would be nice to move pkg-config results to a build artefact. *)
+ 
+-  let opam_prefix =
+-    let cmd = "opam config var prefix" in
+-    lazy ( try run_and_read cmd with Failure _ ->
+-            error_msgf "error running opam")
+-
+-  let var = "PKG_CONFIG_PATH"
+-
+-  let path () =
+-    Lazy.force opam_prefix / "lib" / "pkgconfig" ::
+-      (try [Sys.getenv var] with Not_found -> []) |> String.concat ~sep:":"
+-
+   let run ~flags package =
+-    let cmd = strf "%s=%s pkg-config %s %s 2>/dev/null"
+-              var (path ()) package (String.concat ~sep:" " flags) in
++    let cmd = strf "pkg-config %s %s 2>/dev/null"
++              package (String.concat ~sep:" " flags) in
+     try `Res (run_and_read cmd) with Failure _ -> `Nonexistent
+ end
+ 
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix
new file mode 100644
index 000000000000..5e3c76be1a33
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitLab, yojson }:
+
+buildDunePackage rec {
+  pname = "ocf";
+  version = "0.8.0";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.03";
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "ocf";
+    rev = version;
+    sha256 = "sha256:00ap3q5yjqmpk87lxqv1j2wkc7583ynhjr1jjrfn9r0j2h9pfd60";
+  };
+
+  propagatedBuildInputs = [ yojson ];
+
+  meta = with lib; {
+    description = "OCaml library to read and write configuration options in JSON syntax";
+    homepage = "https://zoggy.frama.io/ocf/";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ regnat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocf/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/ocf/ppx.nix
new file mode 100644
index 000000000000..7538bdeca167
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocf/ppx.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, ocf, ppxlib }:
+
+buildDunePackage {
+  pname = "ocf_ppx";
+  minimalOCamlVersion = "4.11";
+
+  inherit (ocf) src version;
+
+  duneVersion = "3";
+
+  buildInputs = [ ppxlib ocf ];
+
+  meta = ocf.meta // {
+    description = "Preprocessor for Ocf library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocolor/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocolor/default.nix
new file mode 100644
index 000000000000..16663a8db64c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocolor/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, cppo
+}:
+
+buildDunePackage rec {
+  pname = "ocolor";
+  version = "1.3.1";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "marc-chevalier";
+    repo = pname;
+    rev = "refs/tags/${version}";
+    sha256 = "osQTZGJp9yDoKNa6WoyhViNbRg1ukcD0Jxiu4VxqeUc=";
+  };
+
+  nativeBuildInputs = [
+    cppo
+  ];
+
+  meta = {
+    description = "Print with style in your terminal using Format’s semantic tags";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ toastal ];
+    homepage = "https://github.com/marc-chevalier/ocolor";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix
new file mode 100644
index 000000000000..e8b705ebdd4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }:
+
+if lib.versionOlder ocaml.version "4.02"
+then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-ocp-ocamlres";
+  version = "0.4";
+  src = fetchFromGitHub {
+    owner = "OCamlPro";
+    repo = "ocp-ocamlres";
+    rev = "v${version}";
+    sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ astring pprint ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  installFlags = [ "BINDIR=$(out)/bin" ];
+  preInstall = "mkdir -p $out/bin";
+
+  meta = {
+    description = "Simple tool and library to embed files and directories inside OCaml executables";
+    homepage = "https://www.typerex.org/ocp-ocamlres.html";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "ocp-ocamlres";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix
new file mode 100644
index 000000000000..c7fa14a291d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, cppo }:
+
+buildDunePackage rec {
+  version = "1.2";
+  pname = "ocplib-endian";
+
+  src = fetchFromGitHub {
+    owner = "OCamlPro";
+    repo = "ocplib-endian";
+    rev = version;
+    sha256 = "sha256-THTlhOfXAPaqTt1qBkht+D67bw6M175QLvXoUMgjks4=";
+  };
+
+  postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
+    substituteInPlace src/dune \
+      --replace "(libraries bytes)" "" \
+      --replace "libraries ocplib_endian bigarray bytes" "libraries ocplib_endian"
+  '';
+
+  minimalOCamlVersion = "4.03";
+
+  nativeBuildInputs = [ cppo ];
+
+  meta = with lib; {
+    description = "Optimised functions to read and write int16/32/64";
+    homepage = "https://github.com/OCamlPro/ocplib-endian";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix
new file mode 100644
index 000000000000..930c78fb163d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, logs, num }:
+
+buildDunePackage rec {
+  pname = "ocplib-simplex";
+  version = "0.5";
+
+  src = fetchFromGitHub {
+    owner = "OCamlPro-Iguernlala";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-sy5QUmghG28tXlwbKWx3PpBGTtzXarTSzd1WLSYyvbc=";
+  };
+
+  propagatedBuildInputs = [ logs num ];
+
+  doCheck = true;
+
+  meta = {
+    description = "OCaml library implementing a simplex algorithm, in a functional style, for solving systems of linear inequalities";
+    homepage = "https://github.com/OCamlPro-Iguernlala/ocplib-simplex";
+    license = lib.licenses.lgpl21Only;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-ppx-rpc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-ppx-rpc/default.nix
new file mode 100644
index 000000000000..fdd6b91f19f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-ppx-rpc/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, ppxlib }:
+
+buildDunePackage rec {
+  pname = "ocsigen-ppx-rpc";
+  version = "1.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256:0qgasd89ayamgl2rfyxsipznmwa3pjllkyq9qg0g1f41h8ixpsfh";
+  };
+
+  propagatedBuildInputs = [ ppxlib ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Syntax for RPCs for Eliom and Ocsigen Start";
+    license = lib.licenses.lgpl21Only;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix
new file mode 100644
index 000000000000..b770c0d7d5d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix
@@ -0,0 +1,73 @@
+{ lib, buildDunePackage, fetchFromGitHub, which, ocaml, lwt_react, ssl, lwt_ssl, findlib
+, bigstringaf, lwt, cstruct, mirage-crypto, zarith, mirage-crypto-ec, ptime, mirage-crypto-rng, mtime, ca-certs
+, cohttp, cohttp-lwt-unix, hmap
+, lwt_log, re, cryptokit, xml-light, ipaddr
+, camlzip
+, makeWrapper
+}:
+
+let mkpath = p:
+  "${p}/lib/ocaml/${ocaml.version}/site-lib/stublibs";
+in
+
+let caml_ld_library_path =
+  lib.concatMapStringsSep ":" mkpath [
+    bigstringaf lwt ssl cstruct mirage-crypto zarith mirage-crypto-ec ptime mirage-crypto-rng mtime ca-certs cryptokit re
+  ]
+; in
+
+buildDunePackage rec {
+  version = "5.1.0";
+  pname = "ocsigenserver";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "ocsigenserver";
+    rev = "refs/tags/${version}";
+    hash = "sha256-6xO+4eYSp6rlgPT09L7cvlaz6kYYuUPRa3K/TgZmaqE=";
+  };
+
+  nativeBuildInputs = [ makeWrapper which ];
+  buildInputs = [ lwt_react camlzip findlib ];
+
+  propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl
+    re xml-light
+  ];
+
+  configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ];
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  postConfigure = ''
+    make -C src confs
+  '';
+
+  postInstall = ''
+    make install.files
+  '';
+
+  postFixup =
+  ''
+  rm -rf $out/var/run
+  wrapProgram $out/bin/ocsigenserver \
+    --suffix CAML_LD_LIBRARY_PATH : "${caml_ld_library_path}"
+  '';
+
+  dontPatchShebangs = true;
+
+  meta = {
+    homepage = "http://ocsigen.org/ocsigenserver/";
+    description = "Full featured Web server";
+    longDescription =''
+      A full featured Web server. It implements most features of the HTTP protocol, and has a very powerful extension mechanism that make very easy to plug your own OCaml modules for generating pages.
+      '';
+    license = lib.licenses.lgpl21Only;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.gal_bolle ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix
new file mode 100644
index 000000000000..e9af3a27a756
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, ocsigen-toolkit, pgocaml_ppx, safepass, yojson
+, cohttp-lwt-unix, eliom
+, resource-pooling
+, ocsigen-ppx-rpc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-ocsigen-start";
+  version = "6.2.0";
+
+  nativeBuildInputs = [ ocaml findlib eliom ];
+  buildInputs = [ ocsigen-ppx-rpc ];
+  propagatedBuildInputs = [ pgocaml_ppx safepass ocsigen-toolkit yojson resource-pooling cohttp-lwt-unix ];
+
+  strictDeps = true;
+
+  patches = [ ./templates-dir.patch
+    # Compatibility with tyxml 4.6.x
+    (fetchpatch {
+       url = "https://github.com/ocsigen/ocsigen-start/commit/0b70506f94fcb2e06cb65ce0d6a28b9b84c695f3.patch";
+       hash = "sha256-p/VvIu9reI8lc9lxWiTrjZvn46vuF00QInYuWPtRVyk=";
+    })
+  ];
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "ocsigen-start";
+    rev = version;
+    hash = "sha256-i2nj/m1Ihb/bprtHvZh47/oK0v+aFNVH+A2CB4rrrPk=";
+  };
+
+  preInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR
+  '';
+
+  meta = {
+    homepage = "http://ocsigen.org/ocsigen-start";
+    description = "Eliom application skeleton";
+    longDescription =''
+     An Eliom application skeleton, ready to use to build your own application with users, (pre)registration, notifications, etc.
+      '';
+    license = lib.licenses.lgpl21Only;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.gal_bolle ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch
new file mode 100644
index 000000000000..38365a26b99a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch
@@ -0,0 +1,13 @@
+diff --git a/scripts/install.sh b/scripts/install.sh
+index f88ae11..d6aae70 100755
+--- a/scripts/install.sh
++++ b/scripts/install.sh
+@@ -11,9 +11,9 @@ fi
+ 
+ TPL_DIR=$1
+ TPL_NAME=$2
+-DEST0=$DESTDIR/$(eliom-distillery -dir)
++DEST0=$out/eliom-distillery-templates
+ DEST=$DEST0/$TPL_NAME
+ 
+ mkdir -p $DEST0
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
new file mode 100644
index 000000000000..b5638229e0c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, opaline
+, calendar, eliom, js_of_ocaml-ppx_deriving_json
+}:
+
+stdenv.mkDerivation rec {
+ pname = "ocsigen-toolkit";
+ name = "ocaml${ocaml.version}-${pname}-${version}";
+ version = "3.3.4";
+
+ propagatedBuildInputs = [ calendar js_of_ocaml-ppx_deriving_json eliom ];
+ nativeBuildInputs = [ ocaml findlib opaline eliom ];
+
+ strictDeps = true;
+
+ installPhase = ''
+    runHook preInstall
+    mkdir -p $OCAMLFIND_DESTDIR
+    export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH
+    make install
+    opaline -prefix $out
+    runHook postInstall
+  '';
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = version;
+    hash = "sha256-6ccu8WJxUwpR5YyB4j1jQPWba8GhQDxuw+IDHswQpSA=";
+  };
+
+  meta = {
+    homepage = "http://ocsigen.org/ocsigen-toolkit/";
+    description = " User interface widgets for Ocsigen applications";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.gal_bolle ];
+    inherit (ocaml.meta) platforms;
+  };
+
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/default.nix
new file mode 100644
index 000000000000..447c4f11d7f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/default.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, ocsipersist-lib
+, ocsipersist-pgsql
+, ocsipersist-sqlite
+}:
+
+buildDunePackage {
+  pname = "ocsipersist";
+  inherit (ocsipersist-lib) src version;
+  duneVersion = "3";
+
+  buildInputs = [
+    ocsipersist-pgsql
+    ocsipersist-sqlite
+  ];
+
+  propagatedBuildInputs = [ ocsipersist-lib ];
+
+  meta = ocsipersist-lib.meta // {
+    description = "Persistent key/value storage (for Ocsigen) using multiple backends";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/lib.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/lib.nix
new file mode 100644
index 000000000000..33b086880241
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/lib.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, lwt_ppx, lwt
+}:
+
+buildDunePackage rec {
+  pname = "ocsipersist-lib";
+  version = "1.1.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "ocsipersist";
+    rev = version;
+    sha256 = "sha256:1d6kdcfjvrz0dl764mnyxc477aa57rvmzkg154qc915w2y1nbz9a";
+  };
+
+  buildInputs = [ lwt_ppx ];
+  propagatedBuildInputs = [ lwt ];
+
+  meta = {
+    description = "Persistent key/value storage (for Ocsigen) - support library";
+    license = lib.licenses.lgpl21Only;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/pgsql.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/pgsql.nix
new file mode 100644
index 000000000000..e2d95e7434ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/pgsql.nix
@@ -0,0 +1,25 @@
+{ buildDunePackage, ocsipersist-lib
+, lwt_log
+, ocsigen_server
+, pgocaml
+, xml-light
+}:
+
+buildDunePackage {
+  pname = "ocsipersist-pgsql";
+  inherit (ocsipersist-lib) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    lwt_log
+    ocsigen_server
+    ocsipersist-lib
+    pgocaml
+    xml-light
+  ];
+
+  meta = ocsipersist-lib.meta // {
+    description = "Persistent key/value storage (for Ocsigen) using PostgreSQL";
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/sqlite.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/sqlite.nix
new file mode 100644
index 000000000000..696863e9fd66
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsipersist/sqlite.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage, ocsipersist-lib
+, lwt_log
+, ocaml_sqlite3
+, ocsigen_server
+, xml-light
+}:
+
+buildDunePackage {
+  pname = "ocsipersist-sqlite";
+  inherit (ocsipersist-lib) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    lwt_log
+    ocaml_sqlite3
+    ocsigen_server
+    ocsipersist-lib
+    xml-light
+  ];
+
+  meta = ocsipersist-lib.meta // {
+    description = "Persistent key/value storage (for Ocsigen) using SQLite";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix b/nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix
new file mode 100644
index 000000000000..1a973da5e84d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "octavius";
+  version = "1.2.2";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-doc";
+    repo = "octavius";
+    rev = "v${version}";
+    sha256 = "sha256-/S6WpIo1c5J9uM3xgtAM/elhnsl0XimnIFsKy3ootbA=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Ocamldoc comment syntax parser";
+    homepage = "https://github.com/ocaml-doc/octavius";
+    license = licenses.isc;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix
new file mode 100644
index 000000000000..cb3c70198dc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, ocaml, findlib, curl, lwt, lwt_ppx }:
+if lib.versionOlder ocaml.version "4.04"
+then throw "ocurl is not available for OCaml ${ocaml.version}"
+else
+stdenv.mkDerivation rec {
+  pname = "ocurl";
+  version = "0.9.2";
+
+  src = fetchurl {
+    url = "https://github.com/ygrek/ocurl/releases/download/${version}/ocurl-${version}.tar.gz";
+    sha256 = "sha256-4DWXGMh02s1VwLWW5d7h0jtMOUubWmBPGm1hghfWd2M=";
+  };
+
+  nativeBuildInputs = [ pkg-config ocaml findlib ];
+  propagatedBuildInputs = [ curl lwt lwt_ppx ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+  meta = {
+    description = "OCaml bindings to libcurl";
+    license = lib.licenses.mit;
+    homepage = "http://ygrek.org.ua/p/ocurl/";
+    maintainers = with lib.maintainers; [ dandellion bennofs ];
+    platforms = ocaml.meta.platforms or [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/odate/default.nix b/nixpkgs/pkgs/development/ocaml-modules/odate/default.nix
new file mode 100644
index 000000000000..89c47781a8fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odate/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, menhir
+}:
+
+buildDunePackage rec {
+  pname = "odate";
+  version = "0.7";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "hhugo";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-C11HpftrYOCVyWT31wrqo8FVZuP7mRUkRv5IDeAZ+To=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+
+  meta = {
+    description = "Date and duration in OCaml";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/odig/default.nix b/nixpkgs/pkgs/development/ocaml-modules/odig/default.nix
new file mode 100644
index 000000000000..5ea3730c7ff4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odig/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, buildTopkgPackage, cmdliner, odoc, b0 }:
+
+buildTopkgPackage rec {
+  pname = "odig";
+  version = "0.0.9";
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/odig-${version}.tbz";
+    sha256 = "sha256-sYKvGYkxeF5FmrNQdOyMAtlsJqhlmUESi9SkPn/cjM4=";
+  };
+
+  buildInputs = [ cmdliner odoc b0 ];
+
+  meta = with lib; {
+    description = "Lookup documentation of installed OCaml packages";
+    longDescription = ''
+      odig is a command line tool to lookup documentation of installed OCaml
+      packages. It shows package metadata, readmes, change logs, licenses,
+      cross-referenced `odoc` API documentation and manuals.
+    '';
+    homepage = "https://erratique.ch/software/odig";
+    license = licenses.isc;
+    maintainers = [ maintainers.Julow ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix b/nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix
new file mode 100644
index 000000000000..5d22d2d71238
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix
@@ -0,0 +1,49 @@
+{ lib, fetchurl, buildDunePackage, ocaml, astring, result, camlp-streams, version ? "2.4.2" }:
+
+let param = {
+  "2.4.2" = {
+    sha256 = "sha256-Vjz9uybsijDnN6nPKFoG4LuulT9I4lu7D2n3qZwrpAs=";
+  };
+  "2.0.0" = {
+    sha256 = "sha256-QHkZ+7DrlXYdb8bsZ3dijZSqGQc0O9ymeLGIC6+zOSI=";
+  };
+  "1.0.1" = {
+    sha256 = "sha256-orvo5CAbYOmAurAeluQfK6CwW6P1C0T3WDfoovuQfSw=";
+  };
+  "1.0.0" = {
+    sha256 = "sha256-tqoI6nGp662bK+vE2h7aDXE882dObVfRBFnZNChueqE=";
+    max_version = "5.0";
+  };
+  "0.9.0" = {
+    sha256 = "sha256-3w2tG605v03mvmZsS2O5c71y66O3W+n3JjFxIbXwvXk=";
+    max_version = "5.0";
+  };
+}."${version}"; in
+
+lib.throwIf (param ? max_version && lib.versionAtLeast ocaml.version param.max_version)
+  "odoc-parser ${version} is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "odoc-parser";
+  inherit version;
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = if lib.versionAtLeast version "2.4"
+      then "https://github.com/ocaml/odoc/releases/download/${version}/odoc-${version}.tbz"
+      else "https://github.com/ocaml-doc/odoc-parser/releases/download/${version}/odoc-parser-${version}.tbz";
+    inherit (param) sha256;
+  };
+
+  propagatedBuildInputs = [ astring result ] ++
+    lib.optional (lib.versionAtLeast version "1.0.1") camlp-streams;
+
+  meta = {
+    description = "Parser for Ocaml documentation comments";
+    license = lib.licenses.isc;
+    maintainers = [ ];
+    homepage = "https://github.com/ocaml-doc/odoc-parser";
+    changelog = "https://github.com/ocaml-doc/odoc-parser/raw/${version}/CHANGES.md";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix
new file mode 100644
index 000000000000..58a52a04c196
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, ocaml
+, ocaml-crunch
+, astring, cmdliner, cppo, fpath, result, tyxml
+, markup, yojson, sexplib0, jq
+, odoc-parser, ppx_expect, bash, fmt
+}:
+
+buildDunePackage rec {
+  pname = "odoc";
+  inherit (odoc-parser) version src;
+
+  nativeBuildInputs = [ cppo ocaml-crunch ];
+  buildInputs = [ astring cmdliner fpath result tyxml odoc-parser fmt ];
+
+  nativeCheckInputs = [ bash jq ];
+  checkInputs = [ markup yojson sexplib0 jq ppx_expect ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08"
+    && lib.versionOlder yojson.version "2.0";
+
+  preCheck = ''
+    # some run.t files check the content of patchShebangs-ed scripts, so patch
+    # them as well
+    find test \( -name '*.sh' -o -name 'run.t' \)  -execdir sed 's@#!/bin/sh@#!${bash}/bin/sh@' -i '{}' \;
+    patchShebangs test
+  '';
+
+  meta = {
+    description = "Documentation generator for OCaml";
+    mainProgram = "odoc";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/ocaml/odoc";
+    changelog = "https://github.com/ocaml/odoc/blob/${version}/CHANGES.md";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ogg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ogg/default.nix
new file mode 100644
index 000000000000..6c125130e81c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ogg/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libogg }:
+
+buildDunePackage rec {
+  pname = "ogg";
+  version = "0.7.4";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ogg";
+    rev = "v${version}";
+    sha256 = "sha256-S6rJw90c//a9d63weCLuOBoQwNqbpTb+lRytvHUOZuc=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libogg ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-ogg";
+    description = "Bindings to libogg";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/omd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/omd/default.nix
new file mode 100644
index 000000000000..2ccf939ea614
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/omd/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "omd";
+  version = "1.3.2";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/omd/releases/download/${version}/omd-${version}.tbz";
+    sha256 = "sha256-YCPhZCYx8I9njrVyWCCHnte7Wj/+53fN7evCjB+F+ts=";
+  };
+
+  preBuild = ''
+    substituteInPlace src/dune --replace "bytes)" ")"
+  '';
+
+  meta = {
+    description = "Extensible Markdown library and tool in OCaml";
+    homepage = "https://github.com/ocaml/omd";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "omd";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-core/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-core/default.nix
new file mode 100644
index 000000000000..3106fe83fd70
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-core/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, unzip
+, opam, ocamlgraph, re, cppo }:
+
+buildDunePackage rec {
+  pname = "opam-core";
+
+  inherit (opam) src version;
+
+  useDune2 = true;
+
+  nativeBuildInputs = [ unzip cppo ];
+  propagatedBuildInputs = [ ocamlgraph re ];
+
+  # get rid of check for curl at configure time
+  # opam-core does not call curl at run time
+  configureFlags = [ "--disable-checks" ];
+
+  meta = opam.meta // {
+    description = "Small standard library extensions, and generic system interaction modules used by opam";
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
new file mode 100644
index 000000000000..f91609aa27cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "opam-file-format";
+  version = "2.1.6";
+
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Ka9pMYB99kM+5X7wf9F13gUrjouZucGevvkSY0TaXGg=";
+  };
+
+  useDune2 = true;
+
+  meta = with lib; {
+    description = "Parser and printer for the opam file syntax";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ vbgl ];
+    homepage = "https://github.com/ocaml/opam-file-format/";
+    changelog = "https://github.com/ocaml/opam-file-format/raw/${version}/CHANGES";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-format/default.nix
new file mode 100644
index 000000000000..fdb8ba33d5eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-format/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, unzip, opam-core, opam-file-format }:
+
+buildDunePackage rec {
+  pname = "opam-format";
+
+  useDune2 = true;
+
+  inherit (opam-core) src version;
+
+  minimumOCamlVersion = "4.02.3";
+
+  # get rid of check for curl at configure time
+  # opam-format does not call curl at run time
+  configureFlags = [ "--disable-checks" ];
+
+  nativeBuildInputs = [ unzip ];
+  propagatedBuildInputs = [ opam-core opam-file-format ];
+
+  meta = opam-core.meta // {
+    description = "Definition of opam datastructures and its file interface";
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix
new file mode 100644
index 000000000000..ff9ad75fad86
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, unzip, opam-format, curl }:
+
+buildDunePackage rec {
+  pname = "opam-repository";
+
+  minimumOCamlVersion = "4.02";
+
+  useDune2 = true;
+
+  inherit (opam-format) src version;
+
+  patches = [ ./download-tool.patch ];
+  postPatch = ''
+    substituteInPlace src/repository/opamRepositoryConfig.ml \
+      --replace "SUBSTITUTE_NIXOS_CURL_PATH" "\"${curl}/bin/curl\""
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ unzip curl ];
+  propagatedBuildInputs = [ opam-format ];
+
+  meta = opam-format.meta // {
+    description = "OPAM repository and remote sources handling, including curl/wget, rsync, git, mercurial, darcs backends";
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-repository/download-tool.patch b/nixpkgs/pkgs/development/ocaml-modules/opam-repository/download-tool.patch
new file mode 100644
index 000000000000..9cc5f43f34f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-repository/download-tool.patch
@@ -0,0 +1,37 @@
+diff --git a/src/repository/opamRepositoryConfig.ml b/src/repository/opamRepositoryConfig.ml
+index c2954c1d..528fc621 100644
+--- a/src/repository/opamRepositoryConfig.ml
++++ b/src/repository/opamRepositoryConfig.ml
+@@ -27,31 +27,7 @@ type 'a options_fun =
+   'a
+ 
+ let default = {
+-  download_tool = lazy (
+-    let os = OpamStd.Sys.os () in
+-    try
+-      let curl = "curl", `Curl in
+-      let tools =
+-        match os with
+-        | Darwin  -> ["wget", `Default; curl]
+-        | FreeBSD -> ["fetch", `Default ; curl]
+-        | OpenBSD -> ["ftp", `Default; curl]
+-        | _ -> [curl; "wget", `Default]
+-      in
+-      let cmd, kind =
+-        List.find (fun (c,_) -> OpamSystem.resolve_command c <> None) tools
+-      in
+-      [ CIdent cmd, None ], kind
+-    with Not_found ->
+-      OpamConsole.error_and_exit `Configuration_error
+-        "Could not find a suitable download command. Please make sure you \
+-         have %s installed, or specify a custom command through variable \
+-         OPAMFETCH."
+-        (match os with
+-         | FreeBSD -> "fetch"
+-         | OpenBSD -> "ftp"
+-         | _ -> "either \"curl\" or \"wget\"")
+-  );
++  download_tool = lazy ([ CIdent SUBSTITUTE_NIXOS_CURL_PATH, None ], `Curl);
+   validation_hook = None;
+   retries = 3;
+   force_checksums = None;
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-state/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-state/default.nix
new file mode 100644
index 000000000000..d841631dfd07
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-state/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, unzip, opam, opam-repository }:
+
+buildDunePackage rec {
+  pname = "opam-state";
+
+  inherit (opam) src version;
+
+  useDune2 = true;
+
+  # get rid of check for curl at configure time
+  # opam-state does not call curl at run time
+  configureFlags = [ "--disable-checks" ];
+
+  nativeBuildInputs = [ unzip ];
+  propagatedBuildInputs = [ opam-repository ];
+
+  meta = opam.meta // {
+    description = "OPAM development library handling the ~/.opam hierarchy, repository and switch states";
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opium/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opium/default.nix
new file mode 100644
index 000000000000..b11ab3a8ec95
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opium/default.nix
@@ -0,0 +1,61 @@
+{ buildDunePackage
+, lib
+, astring
+, base64
+, cmdliner
+, fmt
+, httpaf
+, httpaf-lwt-unix
+, logs
+, magic-mime
+, mirage-crypto
+, mtime
+, multipart-form-data
+, ptime
+, re
+, rock
+, tyxml
+, uri
+, yojson
+, alcotest-lwt
+}:
+
+buildDunePackage rec {
+  pname = "opium";
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  inherit (rock) src version;
+
+  propagatedBuildInputs = [
+    astring
+    base64
+    cmdliner
+    fmt
+    httpaf
+    httpaf-lwt-unix
+    logs
+    magic-mime
+    mirage-crypto
+    mtime
+    multipart-form-data
+    ptime
+    re
+    rock
+    tyxml
+    uri
+    yojson
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest-lwt
+  ];
+
+  meta = {
+    description = "OCaml web framework";
+    homepage = "https://github.com/rgrinberg/opium";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.pmahoney ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opti/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opti/default.nix
new file mode 100644
index 000000000000..4ce5087912d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opti/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "opti";
+  version = "1.0.3";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/magnusjonsson/opti/releases/download/${version}/opti-${version}.tbz";
+    sha256 = "ed9ba56dc06e9d2b1bf097964cc65ea37db787d4f239c13d0dd74693f5b50a1e";
+  };
+
+  meta = with lib; {
+    description = "DSL to generate fast incremental C code from declarative specifications";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jmagnusj ];
+    homepage = "https://github.com/magnusjonsson/opti";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/optint/default.nix b/nixpkgs/pkgs/development/ocaml-modules/optint/default.nix
new file mode 100644
index 000000000000..d98f6cf5ee2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/optint/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.07";
+  version = "0.3.0";
+  pname = "optint";
+  src = fetchurl {
+    url = "https://github.com/mirage/optint/releases/download/v${version}/optint-${version}.tbz";
+    sha256 = "sha256-KVz/LBNLA4WxO6gdUAXZ+EG6QNSlAq7RDJl/I57xFHs=";
+  };
+
+  meta = {
+    homepage = "https://github.com/mirage/optint";
+    description = "Abstract type of integer between x64 and x86 architecture";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opus/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opus/default.nix
new file mode 100644
index 000000000000..104846b87f6e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opus/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, ogg, libopus }:
+
+buildDunePackage rec {
+  pname = "opus";
+  version = "0.2.2";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-opus";
+    rev = "v${version}";
+    hash = "sha256-Ghfqw/J1oLbTJpYJaiB5M79jaA6DACvyxBVE+NjnPkg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ogg libopus.dev ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-opus";
+    description = "Bindings to libopus";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ordering/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ordering/default.nix
new file mode 100644
index 000000000000..8613ccf9ae08
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ordering/default.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, dune_3 }:
+
+buildDunePackage {
+  pname = "ordering";
+  inherit (dune_3) version src;
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  dontAddPrefix = true;
+
+  meta = dune_3.meta // {
+    description = "Element ordering";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/oseq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/oseq/default.nix
new file mode 100644
index 000000000000..02b340275732
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/oseq/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, containers, qcheck
+}:
+
+buildDunePackage rec {
+  version = "0.5.1";
+  pname = "oseq";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-fyr/OKlvvHBfovtdubSW4rd4OwQbMLKWXghyU3uBy/k=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  doCheck = true;
+  checkInputs = [
+    containers
+    qcheck
+  ];
+
+  meta = {
+    homepage = "https://c-cube.github.io/oseq/";
+    description = "Purely functional iterators compatible with standard `seq`";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/otfed/default.nix b/nixpkgs/pkgs/development/ocaml-modules/otfed/default.nix
new file mode 100644
index 000000000000..d9d3c5bcb54f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otfed/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, base
+, ppx_deriving
+, ppx_inline_test
+, uutf
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "otfed";
+  version = "0.3.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "gfngfn";
+    repo = pname;
+    rev = version;
+    hash = "sha256-6QCom9nrz0B5vCmuBzqsM0zCs8tBLJC6peig+vCgMVA=";
+  };
+
+  buildInputs = [
+    uutf
+  ];
+
+  propagatedBuildInputs = [
+    base
+    ppx_deriving
+    ppx_inline_test
+  ];
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/gfngfn/otfed";
+    description = "OpenType Font Format Encoder & Decoder";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix
new file mode 100644
index 000000000000..c7b9d930bd6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf }:
+
+let
+  pname = "otfm";
+  version = "0.4.0";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation {
+
+  pname = "ocaml${ocaml.version}-${pname}";
+  inherit version;
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    hash = "sha256-02U23mYTy0ZJgSObDoyygPTGEMC4/Zge5bux4wshaEE=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  propagatedBuildInputs = [ uutf ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "OpenType font decoder for OCaml";
+    longDescription = ''
+      Otfm is an in-memory decoder for the OpenType font data format. It
+      provides low-level access to font tables and functions to decode some
+      of them.
+    '';
+    homepage = webpage;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+    mainProgram = "otftrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix
new file mode 100644
index 000000000000..10b8a03a1b18
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, menhir
+, menhirLib
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "otoml";
+  version = "1.0.5";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "dmbaturin";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-e9Bqd6KHorglLMzvsjakyYt/CLZR3yI/yZPl/rnbkDE=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+
+  propagatedBuildInputs = [ menhirLib uutf ];
+
+  meta = {
+    description = "TOML parsing and manipulation library for OCaml";
+    changelog = "https://github.com/dmbaturin/otoml/raw/${version}/CHANGELOG.md";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/otr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/otr/default.nix
new file mode 100644
index 000000000000..108f4b79d782
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otr/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, sexplib0, mirage-crypto, mirage-crypto-pk, astring, base64
+}:
+
+buildDunePackage rec {
+  pname = "otr";
+  version = "0.3.10";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/ocaml-otr/releases/download/v${version}/otr-v${version}.tbz";
+    hash = "sha256:0dssc7p6s7z53n0mddyipjghzr8ld8bb7alaxqrx9gdpspwab1gq";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ cstruct sexplib0 mirage-crypto mirage-crypto-pk
+                            astring base64 ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/hannesm/ocaml-otr";
+    description = "Off-the-record messaging protocol, purely in OCaml";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix
new file mode 100644
index 000000000000..a40111cd3b37
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, ocaml, findlib, ounit2 }:
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-ounit";
+  inherit (ounit2) version src meta;
+
+  nativeBuildInputs = [ findlib ];
+  propagatedBuildInputs = [ ounit2 ];
+
+  strictDeps = true;
+
+  dontBuild = true;
+
+  createFindlibDestdir = true;
+
+  installTargets = "install-ounit version='${ounit2.version}'";
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix
new file mode 100644
index 000000000000..61c1615b5857
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix
@@ -0,0 +1,24 @@
+{ lib, ocaml, buildDunePackage, fetchurl, seq, stdlib-shims, ncurses }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+
+  pname = "ounit2";
+  version = "2.2.7";
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ounit/releases/download/v${version}/ounit-${version}.tbz";
+    hash = "sha256-kPbmO9EkClHYubL3IgWb15zgC1J2vdYji49cYTwOc4g=";
+  };
+
+  propagatedBuildInputs = [ seq stdlib-shims ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/gildor478/ounit";
+    description = "Unit test framework for OCaml";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/owee/default.nix b/nixpkgs/pkgs/development/ocaml-modules/owee/default.nix
new file mode 100644
index 000000000000..67cdb3828f81
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/owee/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.06";
+  pname = "owee";
+  version = "0.7";
+
+  src = fetchurl {
+    url =
+      "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz";
+    hash = "sha256-9FXcmddHg5mk5UWgYd4kTPOLOY/p6A/OBuvfas4elUA=";
+  };
+
+  meta = with lib; {
+    description = "Experimental OCaml library to work with DWARF format";
+    homepage = "https://github.com/let-def/owee/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ vbgl alizter ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/owl-base/default.nix b/nixpkgs/pkgs/development/ocaml-modules/owl-base/default.nix
new file mode 100644
index 000000000000..2f27d5d3e17b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/owl-base/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "owl-base";
+  version = "1.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/owlbarn/owl/releases/download/${version}/owl-${version}.tbz";
+    hash = "sha256-mDYCZ2z33VTEvc6gV4JTecIXA/vHIWuU37BADGl/yog=";
+  };
+
+  minimalOCamlVersion = "4.10";
+
+  meta = with lib; {
+    description = "Numerical computing library for Ocaml";
+    homepage = "https://ocaml.xyz";
+    changelog = "https://github.com/owlbarn/owl/releases";
+    platforms = platforms.x86_64;
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/owl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/owl/default.nix
new file mode 100644
index 000000000000..178a4f6349b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/owl/default.nix
@@ -0,0 +1,29 @@
+{ buildDunePackage
+, dune-configurator
+, alcotest
+, ctypes
+, stdio
+, openblasCompat
+, owl-base
+, npy
+}:
+
+
+buildDunePackage rec {
+  pname = "owl";
+
+  inherit (owl-base) version src meta;
+
+  checkInputs = [ alcotest ];
+  buildInputs = [ dune-configurator stdio ];
+  propagatedBuildInputs = [
+    ctypes
+    openblasCompat
+    owl-base
+    npy
+  ];
+
+  doCheck = false;
+  # Tests fail with Clang: https://github.com/owlbarn/owl/issues/462
+  # and with GCC 13: https://github.com/owlbarn/owl/issues/653
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/paf/cohttp.nix b/nixpkgs/pkgs/development/ocaml-modules/paf/cohttp.nix
new file mode 100644
index 000000000000..0300076b5215
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/paf/cohttp.nix
@@ -0,0 +1,55 @@
+{ lib
+, buildDunePackage
+, paf
+, cohttp-lwt
+, domain-name
+, httpaf
+, ipaddr
+, alcotest-lwt
+, fmt
+, logs
+, mirage-crypto-rng
+, mirage-time-unix
+, tcpip
+, uri
+, lwt
+, astring
+}:
+
+buildDunePackage {
+  pname = "paf-cohttp";
+
+  inherit (paf)
+    version
+    src
+    ;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    paf
+    cohttp-lwt
+    domain-name
+    httpaf
+    ipaddr
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest-lwt
+    fmt
+    logs
+    mirage-crypto-rng
+    mirage-time-unix
+    tcpip
+    uri
+    lwt
+    astring
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  meta = paf.meta // {
+    description = "CoHTTP client with its HTTP/AF implementation";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/paf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/paf/default.nix
new file mode 100644
index 000000000000..e95d3b182a52
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/paf/default.nix
@@ -0,0 +1,68 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, mirage-time
+, h2
+, tls-mirage
+, mimic
+, ke
+, bigstringaf
+, faraday
+, tls
+, lwt
+, logs
+, fmt
+, mirage-crypto-rng
+, tcpip
+, mirage-time-unix
+, ptime
+, uri
+, alcotest-lwt
+, cstruct
+}:
+
+buildDunePackage rec {
+  pname = "paf";
+  version = "0.5.0";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/paf-le-chien/releases/download/${version}/paf-${version}.tbz";
+    hash = "sha256-oWRvwb8DhtF3ltWaZ6moKmgadFUngruo1UOIaGNV/oM=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    mirage-time
+    h2
+    tls-mirage
+    mimic
+    ke
+    bigstringaf
+    faraday
+    tls
+    cstruct
+    tcpip
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt
+    logs
+    fmt
+    mirage-crypto-rng
+    mirage-time-unix
+    ptime
+    uri
+    alcotest-lwt
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  meta = {
+    description = "HTTP/AF and MirageOS";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.sternenseemann ];
+    homepage = "https://github.com/dinosaure/paf-le-chien";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/parany/default.nix b/nixpkgs/pkgs/development/ocaml-modules/parany/default.nix
new file mode 100644
index 000000000000..382473076582
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parany/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, cpu }:
+
+buildDunePackage rec {
+  pname = "parany";
+  version = "14.0.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "UnixJunkie";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-QR3Rq30iKhft+9tVCgJLOq9bwJe7bcay/kMTXjjCLjE=";
+  };
+
+  propagatedBuildInputs = [ cpu ];
+
+  meta = with lib; {
+    homepage = "https://github.com/UnixJunkie/parany";
+    description = "Generalized map/reduce for multicore computing";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix
new file mode 100644
index 000000000000..a8885aa27f27
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, buildDunePackage, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "parmap";
+  version = "1.2.5";
+
+  src = fetchFromGitHub {
+    owner = "rdicosmo";
+    repo = pname;
+    rev = version;
+    hash = "sha256-tBu7TGtDOe5FbxLZuz6nl+65aN9FHIngq/O4dJWzr3Q=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  doCheck = false; # prevent running slow benchmarks
+
+  meta = with lib; {
+    description = "Library for multicore parallel programming";
+    downloadPage = "https://github.com/rdicosmo/parmap";
+    homepage = "https://rdicosmo.github.io/parmap";
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix
new file mode 100644
index 000000000000..88df0bc281d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, astring
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "parse-argv";
+  version = "0.2.0";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/parse-argv/releases/download/v${version}/parse-argv-v${version}.tbz";
+    sha256 = "06dl04fcmwpkydzni2fzwrhk0bqypd55mgxfax9v82x65xrgj5gw";
+  };
+
+  propagatedBuildInputs = [ astring ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "Process strings into sets of command-line arguments";
+    homepage = "https://github.com/mirage/parse-argv";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/path_glob/default.nix b/nixpkgs/pkgs/development/ocaml-modules/path_glob/default.nix
new file mode 100644
index 000000000000..ed6363bad261
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/path_glob/default.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "path_glob";
+  version = "0.2";
+  useDune2 = true;
+  src = fetchurl {
+    url = "https://gasche.gitlab.io/path_glob/releases/path_glob-${version}.tbz";
+    sha256 = "01ra20bzjiihbgma74axsp70gqmid6x7jmiizg48mdkni0aa42ay";
+  };
+
+  meta = {
+    homepage = "https://gitlab.com/gasche/path_glob";
+    description = "Checking glob patterns on paths";
+    license = lib.licenses.lgpl2Only;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix
new file mode 100644
index 000000000000..d6b9bdb7e758
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildDunePackage
+, fetchzip
+, cstruct
+, mirage-crypto
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "pbkdf";
+  version = "1.2.0";
+
+  duneVersion = "3";
+
+  src = fetchzip {
+    url = "https://github.com/abeaumont/ocaml-pbkdf/archive/${version}.tar.gz";
+    sha256 = "sha256-dGi4Vw+7VBpK/NpJ6zdpogm+E6G/oJovXCksJBSmqjI=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  propagatedBuildInputs = [ cstruct mirage-crypto ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = {
+    description = "Password based key derivation functions (PBKDF) from PKCS#5";
+    maintainers = [ lib.maintainers.sternenseemann ];
+    license = lib.licenses.bsd2;
+    homepage = "https://github.com/abeaumont/ocaml-pbkdf";
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pbrt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pbrt/default.nix
new file mode 100644
index 000000000000..ec5e5df7ab49
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pbrt/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "pbrt";
+  version = "2.4";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "mransan";
+    repo = "ocaml-protoc";
+    rev = "${version}.0";
+    hash = "sha256-EXugdcjALukSjB31zAVG9WiN6GMGXi2jlhHWaZ+p+uM=";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/mransan/ocaml-protoc";
+    description = "Runtime library for Protobuf tooling";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix
new file mode 100644
index 000000000000..e73492830893
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix
@@ -0,0 +1,38 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_cstruct
+, cstruct
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "pcap-format";
+  version = "0.6.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-pcap/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-LUjy8Xm6VsnMq1FHKzmJg7uorkTv7cOTsoLwmtNHkaY=";
+  };
+
+  buildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    ounit
+  ];
+
+  meta = with lib; {
+    description = "Decode and encode PCAP (packet capture) files";
+    homepage = "https://mirage.github.io/ocaml-pcap";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pcre/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pcre/default.nix
new file mode 100644
index 000000000000..9184b4dfd375
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pcre/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, pcre, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "pcre";
+  version = "7.5.0";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/pcre-ocaml/releases/download/${version}/pcre-${version}.tbz";
+    sha256 = "sha256-ZxFC9AtthhccvAZyU/qt+QMBkWHVdIi9D7bFRWwsvRo=";
+  };
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ pcre ];
+
+  meta = with lib; {
+    homepage = "https://mmottl.github.io/pcre-ocaml";
+    description = "Efficient C-library for pattern matching with Perl-style regular expressions in OCaml";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ maggesi vbmithr ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix
new file mode 100644
index 000000000000..66d9e56c6dc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, ocaml, fetchurl, fmt, alcotest, crowbar, astring }:
+
+buildDunePackage rec {
+  pname = "pecu";
+  version = "0.7";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/pecu/releases/download/v${version}/pecu-${version}.tbz";
+    hash = "sha256-rXR3tbFkKNM8MkQAZ2hJU9lO+qQ/qvYghXkYus6f13g=";
+  };
+
+  # crowbar availability
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ fmt alcotest crowbar astring ];
+
+  meta = with lib; {
+    description = "Encoder/Decoder of Quoted-Printable (RFC2045 & RFC2047)";
+    license = licenses.mit;
+    homepage = "https://github.com/mirage/pecu";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix
new file mode 100644
index 000000000000..ba9a97fcaa0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, calendar, camlp-streams, csv, hex, ppx_deriving, ppx_sexp_conv, re, rresult, sexplib
+}:
+
+buildDunePackage rec {
+  pname = "pgocaml";
+  version = "4.4.0";
+  src = fetchFromGitHub {
+    owner = "darioteixeira";
+    repo = "pgocaml";
+    rev = "v${version}";
+    hash = "sha256-Mz3zVgXas1UivH/BVARx5kWClgr9v9YcGarwaD961tU=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ calendar csv hex ppx_deriving ppx_sexp_conv re
+    rresult sexplib camlp-streams
+  ];
+
+  meta = with lib; {
+    description = "Interface to PostgreSQL databases for OCaml applications";
+    homepage = "https://github.com/darioteixeira/pgocaml";
+    license = licenses.lgpl2Only;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix
new file mode 100644
index 000000000000..1b76f9a577e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix
@@ -0,0 +1,9 @@
+{ buildDunePackage, pgocaml, ppx_optcomp }:
+
+buildDunePackage {
+  pname = "pgocaml_ppx";
+  inherit (pgocaml) src version meta;
+
+  buildInputs = [ ppx_optcomp ];
+  propagatedBuildInputs = [ pgocaml ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix
new file mode 100644
index 000000000000..4bf765bc9cfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildOasisPackage, ounit, tcslib, ocaml-sat-solvers }:
+
+buildOasisPackage rec {
+  pname = "pgsolver";
+  version = "4.1";
+
+  src = fetchFromGitHub {
+    owner  = "tcsprojects";
+    repo   = "pgsolver";
+    rev    = "v${version}";
+    sha256 = "16skrn8qql9djpray25xv66rjgfl20js5wqnxyq1763nmyizyj8a";
+  };
+
+  buildInputs = [ ounit ];
+  propagatedBuildInputs = [ tcslib ocaml-sat-solvers ];
+
+  meta = {
+    description = "Collection of tools for generating, manipulating and - most of all - solving parity games";
+    homepage = "https://github.com/tcsprojects/pgsolver";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+    mainProgram = "pgsolver-bin";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix b/nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix
new file mode 100644
index 000000000000..76856024c09a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppx_deriving
+, bppsuite
+, alcotest
+, angstrom-unix
+, biotk
+, core
+, gsl
+, lacaml
+, menhir
+, menhirLib
+, printbox-text
+, yojson
+}:
+
+buildDunePackage rec {
+  pname = "phylogenetics";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/biocaml/phylogenetics/releases/download/v${version}/phylogenetics-${version}.tbz";
+    hash = "sha256-JFpYp3pyW7PrBjqCwwDZxkJPA84dp6Qs8rOPvHPY92o=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  nativeCheckInputs = [ bppsuite ];
+  checkInputs = [ alcotest ];
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [
+    angstrom-unix
+    biotk
+    core
+    gsl
+    lacaml
+    menhirLib
+    ppx_deriving
+    printbox-text
+    yojson
+  ];
+
+  checkPhase = ''
+    runHook preCheck
+    dune build @app/fulltest
+    runHook postCheck
+  '';
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Algorithms and datastructures for phylogenetics";
+    homepage = "https://github.com/biocaml/phylogenetics";
+    license = licenses.cecill-b;
+    maintainers = [ maintainers.bcdarwin ];
+    mainProgram = "phylosim";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/piaf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/piaf/default.nix
new file mode 100644
index 000000000000..46bb62a24669
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piaf/default.nix
@@ -0,0 +1,58 @@
+{ alcotest-lwt
+, buildDunePackage
+, ocaml
+, dune-site
+, fetchurl
+, gluten-lwt-unix
+, lib
+, logs
+, lwt_ssl
+, magic-mime
+, mrmime
+, pecu
+, psq
+, ssl
+, uri
+}:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "piaf is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "piaf";
+  version = "0.1.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/anmonteiro/piaf/releases/download/${version}/piaf-${version}.tbz";
+    hash = "sha256-AMO+ptGox33Bi7u/H0SaeCU88XORrRU3UbLof3EwcmU=";
+  };
+
+  postPatch = ''
+    substituteInPlace ./vendor/dune --replace "mrmime.prettym" "prettym"
+  '';
+
+  propagatedBuildInputs = [
+    logs
+    magic-mime
+    mrmime
+    psq
+    uri
+    gluten-lwt-unix
+  ];
+
+  nativeCheckInputs = [
+    alcotest-lwt
+    dune-site
+  ];
+  # Check fails with OpenSSL 3
+  doCheck = false;
+
+  meta = {
+    description = "HTTP library with HTTP/2 support written entirely in OCaml";
+    homepage = "https://github.com/anmonteiro/piaf";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ anmonteiro ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix
new file mode 100644
index 000000000000..ae1efafb2251
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, piqi, stdlib-shims, num }:
+
+stdenv.mkDerivation rec {
+  version = "0.7.8";
+  pname = "piqi-ocaml";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "alavrik";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6Luq49sbo+AqLSq57mc6fLhrRx0K6G5LCUIzkGPfqYo=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ piqi stdlib-shims ];
+
+  checkInputs = [ num ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  installPhase = ''
+    runHook preInstall
+    DESTDIR=$out make install
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Universal schema language and a collection of tools built around it. These are the ocaml bindings";
+    homepage = "https://piqi.org";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+    mainProgram = "piqic-ocaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix b/nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix
new file mode 100644
index 000000000000..fb5f0192c459
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex, easy-format, xmlm, base64 }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "piqi is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  version = "0.6.16";
+  pname = "piqi";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "alavrik";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-qE+yybTn+kzbY0h8udhZYO+GwQPI/J/6p3LMmF12cFU=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib which ];
+  propagatedBuildInputs = [ sedlex xmlm easy-format base64 ];
+
+  strictDeps = true;
+
+  patches = [ ./no-stream.patch ./no-ocamlpath-override.patch ];
+
+  createFindlibDestdir = true;
+
+  postBuild = "make -C piqilib piqilib.cma";
+
+  installTargets = [ "install" "ocaml-install" ];
+
+  meta = with lib; {
+    homepage = "https://piqi.org";
+    description = "Universal schema language and a collection of tools built around it";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch b/nixpkgs/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch
new file mode 100644
index 000000000000..bf85a42551c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch
@@ -0,0 +1,17 @@
+diff -rupN piqi-0.6.12.orig/make/Makefile.ocaml piqi-0.6.12/make/Makefile.ocaml
+--- piqi-0.6.12.orig/make/Makefile.ocaml	2015-03-13 13:35:19.000000000 +0100
++++ piqi-0.6.12/make/Makefile.ocaml	2015-06-10 21:19:57.231000000 +0200
+@@ -1,13 +1,5 @@
+ OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile
+ 
+-
+-OCAMLPATH := $(PIQI_BUILD)/lib/ocaml
+-ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
+-OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
+-endif
+-export OCAMLPATH
+-
+-
+ # make sure camlp4o produces pretty-printed text instead of AST
+ export CAMLP4_O = $(CAMLP4)o -printer o
+ 
diff --git a/nixpkgs/pkgs/development/ocaml-modules/piqi/no-stream.patch b/nixpkgs/pkgs/development/ocaml-modules/piqi/no-stream.patch
new file mode 100644
index 000000000000..fde1c46cce42
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi/no-stream.patch
@@ -0,0 +1,14 @@
+--- ./piqilib/piq_lexer.ml
++++ ./piqilib/piq_lexer.ml
+@@ -476,11 +476,6 @@ let init_from_string s =
+   make_buf lexbuf
+ 
+ 
+-let init_from_stream s =
+-  let lexbuf = Sedlexing.Utf8.from_stream s in
+-  make_buf lexbuf
+-
+-
+ let init_from_channel ch =
+   let lexbuf = Sedlexing.Utf8.from_channel ch in
+   make_buf lexbuf
diff --git a/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/default.nix b/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/default.nix
new file mode 100644
index 000000000000..09593f835aef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildDunePackage
+, substituteAll
+, base64
+, cmdliner
+, digestif
+, git-unix
+, kicadsch
+, lwt
+, lwt_ppx
+, sha
+, tyxml
+, coreutils
+, imagemagick
+}:
+
+buildDunePackage rec {
+  pname = "plotkicadsch";
+  duneVersion = "3";
+
+  inherit (kicadsch) src version;
+
+  minimalOCamlVersion = "4.09";
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit coreutils imagemagick;
+    })
+  ];
+
+  buildInputs = [
+    base64
+    cmdliner
+    digestif
+    git-unix
+    kicadsch
+    lwt
+    lwt_ppx
+    sha
+    tyxml
+  ];
+
+  meta = with lib; {
+    description = "Tool to export Kicad Sch files to SVG pictures";
+    homepage = "https://github.com/jnavila/plotkicadsch";
+    license = licenses.isc;
+    maintainers = with maintainers; [ leungbk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/fix-paths.patch b/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/fix-paths.patch
new file mode 100644
index 000000000000..d9e8d5109f53
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/plotkicadsch/fix-paths.patch
@@ -0,0 +1,26 @@
+diff --git a/plotkicadsch/src/git-imgdiff b/plotkicadsch/src/git-imgdiff
+index cbddecb..8d21a8a 100755
+--- a/plotkicadsch/src/git-imgdiff
++++ b/plotkicadsch/src/git-imgdiff
+@@ -1,4 +1,4 @@
+ #!/bin/bash
+ PIPE=$(mktemp -u)
+-(! compare -metric RMSE $2 $1 png:${PIPE} 2> /dev/null) &&  (montage -geometry +4+4 $2 $PIPE $1 png:- | display -title "$1" -)
++(! @imagemagick@/bin/compare -metric RMSE $2 $1 png:${PIPE} 2> /dev/null) &&  (@imagemagick@/bin/montage -geometry +4+4 $2 $PIPE $1 png:- | @imagemagick@/bin/display -title "$1" -)
+ rm $PIPE
+diff --git a/plotkicadsch/src/sysAbst.ml b/plotkicadsch/src/sysAbst.ml
+index c3c7b52..15db6d4 100644
+--- a/plotkicadsch/src/sysAbst.ml
++++ b/plotkicadsch/src/sysAbst.ml
+@@ -30,7 +30,7 @@ let detect_os () : os =
+   if Sys.win32 then Windows
+   else if Sys.cygwin then Cygwin
+   else
+-    let ((in_ch, _, _) as uname) = UnixLabels.open_process_full "uname" ~env:[| |] in
++    let ((in_ch, _, _) as uname) = UnixLabels.open_process_full "@coreutils@/bin/uname" ~env:[| |] in
+     let os = input_line in_ch in
+     ignore (UnixLabels.close_process_full uname) ;
+     match os with
+-- 
+2.37.1
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/poll/default.nix b/nixpkgs/pkgs/development/ocaml-modules/poll/default.nix
new file mode 100644
index 000000000000..ea1e2e1c13d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/poll/default.nix
@@ -0,0 +1,43 @@
+{ buildDunePackage
+, dune-configurator
+, fetchurl
+, kqueue
+, lib
+, ppx_expect
+, ppx_optcomp
+}:
+
+buildDunePackage rec {
+  pname = "poll";
+  version = "0.3.1";
+
+  minimalOCamlVersion = "4.13";
+
+  src = fetchurl {
+    url = "https://github.com/anuragsoni/poll/releases/download/${version}/poll-${version}.tbz";
+    hash = "sha256-IX6SivK/IMQaGgMgWiIsNgUSMHP6z1E/TSB0miaQ8pw=";
+  };
+
+  buildInputs = [
+    dune-configurator
+    ppx_optcomp
+  ];
+
+  propagatedBuildInputs = [
+    kqueue
+  ];
+
+  checkInputs = [
+    ppx_expect
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Portable OCaml interface to macOS/Linux/Windows native IO event notification mechanisms";
+    homepage = "https://github.com/anuragsoni/poll";
+    changelog = "https://github.com/anuragsoni/poll/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/polynomial/default.nix b/nixpkgs/pkgs/development/ocaml-modules/polynomial/default.nix
new file mode 100644
index 000000000000..cd56175d72d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/polynomial/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, zarith
+, ff-sig
+}:
+
+buildDunePackage rec {
+  pname = "polynomial";
+  version = "0.4.0";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "cryptography/ocaml-polynomial";
+    rev = version;
+    sha256 = "sha256-is/PrYLCwStHiQsNq5OVRCwHdXjO2K2Z7FrXgytRfAU=";
+  };
+
+  propagatedBuildInputs = [ zarith ff-sig ];
+
+  doCheck = false; # circular dependencies
+
+  meta = {
+    description = "Polynomials over finite field";
+    license = lib.licenses.mit;
+    homepage = "https://gitlab.com/nomadic-labs/ocaml-polynomial";
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/portaudio/default.nix b/nixpkgs/pkgs/development/ocaml-modules/portaudio/default.nix
new file mode 100644
index 000000000000..9a6b450b5c4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/portaudio/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, portaudio }:
+
+buildDunePackage rec {
+  pname = "portaudio";
+  version = "0.2.3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-portaudio";
+    rev = "v${version}";
+    sha256 = "sha256-rMSE+ta7ughjjCnz4oho1D3VGaAsUlLtxizvxZT0/cQ=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ portaudio ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-portaudio";
+    description = "Bindings for the portaudio library which provides high-level functions for using soundcards";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/posix/base.nix b/nixpkgs/pkgs/development/ocaml-modules/posix/base.nix
new file mode 100644
index 000000000000..ab78d3737f9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/base.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, ctypes, integers
+}:
+
+buildDunePackage rec {
+  pname = "posix-base";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-posix";
+    rev = "v${version}";
+    hash = "sha256-xxNaPJZdcW+KnT7rYUuC7ZgmHtXTppZG2BOmpKweC/U=";
+  };
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ ctypes integers ];
+
+  meta = {
+    homepage = "https://www.liquidsoap.info/ocaml-posix/";
+    description = "Base module for the posix bindings";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix b/nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix
new file mode 100644
index 000000000000..c998965a6189
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, posix-base }:
+
+buildDunePackage {
+  pname = "posix-socket";
+
+  inherit (posix-base) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ posix-base ];
+
+  doCheck = true;
+
+  meta = posix-base.meta // {
+    description = "Bindings for posix sockets";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/posix/time2.nix b/nixpkgs/pkgs/development/ocaml-modules/posix/time2.nix
new file mode 100644
index 000000000000..c82da776b8fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/time2.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, posix-base, posix-types, unix-errno }:
+
+buildDunePackage {
+  pname = "posix-time2";
+
+  inherit (posix-base) version src;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ posix-base posix-types unix-errno ];
+
+  doCheck = true;
+
+  meta = posix-base.meta // {
+    description = "posix-time2 provides the types and bindings for posix time APIs";
+    maintainers = with lib.maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/posix/types.nix b/nixpkgs/pkgs/development/ocaml-modules/posix/types.nix
new file mode 100644
index 000000000000..c346ea86ac76
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/types.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, posix-base }:
+
+buildDunePackage {
+  pname = "posix-types";
+
+  inherit (posix-base) version src;
+
+  minimalOCamlVersion = "4.03";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ posix-base ];
+
+  meta = posix-base.meta // {
+    description = "Bindings for the types defined in <sys/types.h>";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix b/nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix
new file mode 100644
index 000000000000..4140baa675cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, dune-configurator, postgresql }:
+
+buildDunePackage rec {
+  pname = "postgresql";
+  version = "5.0.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "mmottl";
+    repo = "postgresql-ocaml";
+    rev = version;
+    sha256 = "1i4pnh2v00i0s7s9pcwz1x6s4xcd77d08gjjkvy0fmda6mqq6ghn";
+  };
+
+  nativeBuildInputs = [ postgresql ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ postgresql ];
+
+  meta = {
+    description = "Bindings to the PostgreSQL library";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = with lib.maintainers; [ bcc32 ];
+    homepage = "https://mmottl.github.io/postgresql-ocaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pp/default.nix
new file mode 100644
index 000000000000..5412f8955d76
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pp/default.nix
@@ -0,0 +1,26 @@
+{ buildDunePackage, fetchurl, ppx_expect, lib }:
+
+buildDunePackage rec {
+  pname = "pp";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url =
+      "https://github.com/ocaml-dune/pp/releases/download/${version}/pp-${version}.tbz";
+    hash = "sha256-pegiVzxVr7Qtsp7FbqzR8qzY9lzy3yh44pHeN0zmkJw=";
+  };
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  checkInputs = [ ppx_expect ];
+  doCheck = true;
+
+  meta = with lib; {
+    description =
+      "A an alternative pretty printing library to the Format module of the OCaml standard library";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pp_loc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pp_loc/default.nix
new file mode 100644
index 000000000000..147dd49f5d84
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pp_loc/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "pp_loc";
+  version = "2.1.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/Armael/pp_loc/releases/download/v${version}/pp_loc-${version}.tbz";
+    hash = "sha256-L3NlBdQx6BpP6FGtMQ/ynsTNIMj9N+8FDZ5vEFC6p8s=";
+  };
+
+  doCheck = true;
+
+  meta = {
+    description = "Quote and highlight input fragments at a given source location";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://armael.github.io/pp_loc/pp_loc/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix
new file mode 100644
index 000000000000..2fcb4dbf1fe7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "pprint";
+  version = "20230830";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "fpottier";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-avf71vAgCL1MU8O7Q3FNN3wEdCDtbNZP0ipETnn8AqA=";
+  };
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "OCaml library for pretty-printing textual documents";
+    license = licenses.lgpl2Only;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix
new file mode 100644
index 000000000000..13f9d3471fef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix
@@ -0,0 +1,52 @@
+{ lib, buildDunePackage
+, fetchFromGitHub
+, ppx_assert
+, ppx_bench
+, ppx_bin_prot
+, ppx_compare
+, ppx_enumerate
+, ppx_hash
+, ppx_here
+, ppx_optcomp
+, ppx_sexp_conv
+, ppx_sexp_value
+}:
+
+buildDunePackage rec {
+  pname = "ppx_bap";
+  version = "0.14";
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1c6rcdp8bicdiwqc2mb59cl9l2vxlp3y8hmnr9x924fq7acly248";
+  };
+
+  buildInputs = [
+    ppx_optcomp
+    ppx_sexp_value
+  ];
+
+  propagatedBuildInputs = [
+    ppx_assert
+    ppx_bench
+    ppx_bin_prot
+    ppx_compare
+    ppx_enumerate
+    ppx_hash
+    ppx_here
+    ppx_sexp_conv
+  ];
+
+  meta = {
+    description = "Set of ppx rewriters for BAP";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "ppx-bap";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_blob/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_blob/default.nix
new file mode 100644
index 000000000000..3de101383891
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_blob/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, ocaml, alcotest, ppxlib }:
+
+buildDunePackage rec {
+  pname = "ppx_blob";
+  version = "0.8.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/johnwhitington/${pname}/releases/download/${version}/ppx_blob-${version}.tbz";
+    sha256 = "sha256-drobFwMTKd/a3aP5CX/08WhvgS1CkARH6zo+nSiwl08=";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ ppxlib ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    homepage = "https://github.com/johnwhitington/ppx_blob";
+    description = "OCaml ppx to include binary data from a file as a string";
+    license = licenses.unlicense;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix
new file mode 100644
index 000000000000..189efc3a675d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, ocaml
+, fetchFromGitHub
+, buildDunePackage
+, bigarray-compat
+, containers
+, cppo
+, ctypes
+, integers
+, num
+, ppxlib
+, re
+, findlib
+}:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.2")
+  "ppx_cstubs is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "ppx_cstubs";
+  version = "0.7.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "fdopen";
+    repo = "ppx_cstubs";
+    rev = version;
+    hash = "sha256-qMmwRWCIfNyhCQYPKLiufnb57sTR3P+WInOqtPDywFs=";
+  };
+
+  patches = [ ./ppxlib.patch ];
+
+  nativeBuildInputs = [ cppo ];
+
+  buildInputs = [
+    bigarray-compat
+    containers
+    findlib
+    integers
+    num
+    ppxlib
+    re
+  ];
+
+  propagatedBuildInputs = [
+    ctypes
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/fdopen/ppx_cstubs";
+    changelog = "https://github.com/fdopen/ppx_cstubs/raw/${version}/CHANGES.md";
+    description = "Preprocessor for easier stub generation with ocaml-ctypes";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.osener ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/ppxlib.patch b/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/ppxlib.patch
new file mode 100644
index 000000000000..14cc08991e70
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/ppxlib.patch
@@ -0,0 +1,22 @@
+diff --git a/src/internal/ppxc__script_real.ml b/src/internal/ppxc__script_real.ml
+index 392f2a5..d950fc9 100644
+--- a/src/internal/ppxc__script_real.ml
++++ b/src/internal/ppxc__script_real.ml
+@@ -168,7 +168,7 @@ module C_content_make (E : Empty) = struct
+     if cnt = 0 then None else Some (String.concat "\n\n" l)
+ end
+ 
+-module C_content_phase0 = C_content_make ()
++module C_content_phase0 = C_content_make (struct end)
+ 
+ module type Const_common_s = sig
+   include module type of C_content_phase0
+@@ -300,7 +300,7 @@ module Const_phase0 = struct
+     else C_content_phase0.add_extract_source s2 loc exn f
+ end
+ 
+-module C_content = C_content_make ()
++module C_content = C_content_make (struct end)
+ 
+ module Const = struct
+   include Const_common (C_content)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix
new file mode 100644
index 000000000000..ebf19c70ff30
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "ppx_derivers";
+  version = "1.2.1";
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "diml";
+    repo = pname;
+    rev = version;
+    sha256 = "0yqvqw58hbx1a61wcpbnl9j30n495k23qmyy2xwczqs63mn2nkpn";
+  };
+
+  meta = {
+    description = "Shared [@@deriving] plugin registry";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix
new file mode 100644
index 000000000000..1e79e8a1ffa8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, ocaml
+, findlib
+, cppo
+, ppxlib
+, ppx_derivers
+, result
+, ounit
+, ounit2
+, ocaml-migrate-parsetree
+}:
+
+let params =
+  if lib.versionAtLeast ppxlib.version "0.20" then {
+    version = "5.2.1";
+    sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9";
+  } else if lib.versionAtLeast ppxlib.version "0.15" then {
+    version = "5.1";
+    sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh";
+  } else {
+    version = "5.0";
+    sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3";
+  }
+; in
+
+buildDunePackage rec {
+  pname = "ppx_deriving";
+  inherit (params) version;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz";
+    inherit (params) sha256;
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ cppo ];
+  buildInputs = [ findlib ppxlib ];
+  propagatedBuildInputs =
+    lib.optional (lib.versionOlder version "5.2") ocaml-migrate-parsetree ++ [
+    ppx_derivers
+    result
+  ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08"
+    && lib.versionOlder ocaml.version "5.0";
+  checkInputs = [
+    (if lib.versionAtLeast version "5.2" then ounit2 else ounit)
+  ];
+
+  meta = with lib; {
+    description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix
new file mode 100644
index 000000000000..f5d769efcfd6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, fetchpatch
+, alcotest
+, cmdliner
+, ppx_deriving
+, ppxlib
+, gitUpdater
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_cmdliner";
+  version = "0.6.1";
+
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-/22KLQnxu3e2ZSca6ZLxTJDfv/rsmgCUkJnZC0RwRi8";
+  };
+
+  patches = [
+    # Ppxlib.0.26.0 compatibility
+    # remove when a new version is released
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/hammerlab/ppx_deriving_cmdliner/pull/50.patch";
+      sha256 = "sha256-FfUfEAsyobwZ99+s5sFAaCE6Xgx7jLr/q79OxDbGcvQ=";
+    })
+  ];
+
+  propagatedBuildInputs = [
+    cmdliner
+    ppx_deriving
+    ppxlib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+  ];
+
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
+
+  meta = with lib; {
+    description = "Ppx_deriving plugin for generating command line interfaces from types for OCaml";
+    homepage = "https://github.com/hammerlab/ppx_deriving_cmdliner";
+    license = licenses.asl20;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
new file mode 100644
index 000000000000..00f2ee0f8317
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, cppo, ppx_deriving
+, ppxlib, dune-configurator
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_protobuf";
+  version = "3.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_deriving_protobuf/releases/download/v${version}/ppx_deriving_protobuf-v${version}.tbz";
+    sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj";
+  };
+
+  nativeBuildInputs = [ cppo ];
+  buildInputs = [ ppxlib dune-configurator ];
+  propagatedBuildInputs = [ ppx_deriving ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf";
+    description = "Protocol Buffers codec generator for OCaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix
new file mode 100644
index 000000000000..acc36f2b01ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, rpclib, alcotest, ppxlib, ppx_deriving, yojson }:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_rpc";
+
+  inherit (rpclib) version src;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ ppxlib rpclib ppx_deriving ];
+
+  checkInputs = [ alcotest yojson ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-rpc";
+    description = "Ppx deriver for ocaml-rpc";
+    license = licenses.isc;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix
new file mode 100644
index 000000000000..5fd645b52113
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl, ppxlib, alcotest, mdx
+, ppx_deriving, yaml
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_yaml";
+  version = "0.2.2";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v${version}/ppx_deriving_yaml-${version}.tbz";
+    hash = "sha256-9xy43jaCpKo/On5sTTt8f0Mytyjj1JN2QuFMcoWYTBY=";
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving yaml ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+  nativeCheckInputs = [ mdx.bin ];
+
+  meta = {
+    description = "YAML codec generator for OCaml";
+    homepage = "https://github.com/patricoferris/ppx_deriving_yaml";
+    license = lib.licenses.isc;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix
new file mode 100644
index 000000000000..6e0fa39a0acf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix
@@ -0,0 +1,39 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocaml, ppxlib, ounit
+, ppx_deriving, yojson
+}:
+
+let param =
+  if lib.versionAtLeast ppxlib.version "0.26" then {
+    version = "3.7.0";
+    sha256 = "sha256-niKxn1fX0mL1MhlZvbN1wgRed9AHh+z9s6l++k1VX9k=";
+  }  else {
+    version = "3.6.1";
+    sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk";
+  }
+; in
+
+buildDunePackage rec {
+  pname = "ppx_deriving_yojson";
+  inherit (param) version;
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-ppx";
+    repo = "ppx_deriving_yojson";
+    rev = "v${version}";
+    inherit (param) sha256;
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving yojson ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "Yojson codec generator for OCaml >= 4.04";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix
new file mode 100644
index 000000000000..ea2ea5be9db5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, ppxlib }:
+
+buildDunePackage rec {
+  pname = "ppx_gen_rec";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "sha256-/mMj5UT22KQGVy1sjgEoOgPzyCYyeDPtWJYNDvQ9nlk=";
+  };
+
+  minimalOCamlVersion = "4.07";
+  duneVersion = "3";
+
+  buildInputs = [ ppxlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/flowtype/ocaml-ppx_gen_rec";
+    description = "Ppx rewriter that transforms a recursive module expression into a struct";
+    license = licenses.mit;
+    maintainers = with maintainers; [ frontsideair ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix
new file mode 100644
index 000000000000..7b74fb8a49a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, ocaml
+, ounit
+, ppx_deriving
+, ppx_sexp_conv
+, ppxlib
+, version ? if lib.versionAtLeast ocaml.version "4.11" then "1.11.0" else "1.9.1"
+}:
+
+lib.throwIfNot (lib.versionAtLeast ppxlib.version "0.24.0")
+  "ppx_import is not available with ppxlib-${ppxlib.version}"
+
+buildDunePackage rec {
+  pname = "ppx_import";
+  inherit version;
+
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = let dir = if lib.versionAtLeast version "1.11" then "v${version}" else "${version}"; in
+      "https://github.com/ocaml-ppx/ppx_import/releases/download/${dir}/ppx_import-${version}.tbz";
+
+    hash = {
+      "1.9.1" = "sha256-0bSY4u44Ds84XPIbcT5Vt4AG/4PkzFKMl9CDGFZyIdI=";
+      "1.11.0" = "sha256-Jmfv1IkQoaTkyxoxp9FI0ChNESqCaoDsA7D4ZUbOrBo=";
+    }."${version}";
+  };
+
+  propagatedBuildInputs = [
+    ppxlib
+  ];
+
+  checkInputs = [
+    ounit
+    ppx_deriving
+    ppx_sexp_conv
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Syntax extension for importing declarations from interface files";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/ocaml-ppx/ppx_import";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_monad/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_monad/default.nix
new file mode 100644
index 000000000000..d17de7a1033c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_monad/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ppx_monad";
+  version = "0.2.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "niols";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-cbguAddSlUxBK7pmT7vNmtJW9TrVZZjdSJRMT3lqxOA=";
+  };
+
+  propagatedBuildInputs = [
+    ppxlib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+  ];
+
+  meta = {
+    description = "OCaml Syntax Extension for all Monadic Syntaxes";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/niols/${pname}";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_show/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_show/default.nix
new file mode 100644
index 000000000000..6d33e0f0c163
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_show/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, stdcompat, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ppx_show";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "thierry-martinez";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-YwWAdOtb0zg2hqNkGRiigz/Pci8Jy/QD+WyUEohEsns=";
+  };
+
+  buildInputs = [
+    stdcompat
+    ppxlib
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/thierry-martinez/${pname}";
+    description = "OCaml PPX deriver for deriving show based on ppxlib";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix
new file mode 100644
index 000000000000..41db9313fe7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv, fetchFromGitHub, buildDunePackage, ocaml, findlib, cppo }:
+
+if lib.versionAtLeast ocaml.version "5.2"
+then throw "ppx_tools is not available for OCaml ${ocaml.version}"
+else
+
+let param =
+  let v6_6 = {
+    version = "6.6";
+    sha256 = "sha256-QhuaQ9346a3neoRM4GrOVzjR8fg9ysMZR1VzNgyIQtc=";
+    nativeBuildInputs = [cppo];
+    buildInputs = [cppo];
+  }; in
+{
+  "4.02" = {
+    version = "5.0+4.02.0";
+    sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; };
+  "4.03" = {
+    version = "5.0+4.03.0";
+    sha256 = "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"; };
+  "4.04" = {
+    version = "unstable-20161114";
+    rev = "49c08e2e4ea8fef88692cd1dcc1b38a9133f17ac";
+    sha256 = "0ywzfkf5brj33nwh49k9if8x8v433ral25f3nbklfc9vqr06zrfl"; };
+  "4.05" = {
+    version = "5.0+4.05.0";
+    sha256 = "1jvvhk6wnkvm7b9zph309ihsc0hyxfpahmxxrq19vx8c674jsdm4"; };
+  "4.06" = {
+    version = "5.1+4.06.0";
+    sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; };
+  "4.07" = {
+    version = "5.1+4.06.0";
+    sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; };
+  "4.08" = v6_6;
+  "4.09" = v6_6;
+  "4.10" = v6_6;
+  "4.11" = v6_6;
+  "4.12" = v6_6;
+  "4.13" = v6_6;
+  "4.14" = v6_6;
+  "5.0" = v6_6;
+  "5.1" = v6_6;
+}.${ocaml.meta.branch};
+in
+
+let src = fetchFromGitHub {
+      owner = "alainfrisch";
+      repo = pname;
+      rev = param.rev or param.version;
+      inherit (param) sha256;
+    };
+    pname = "ppx_tools";
+    meta = with lib; {
+      description = "Tools for authors of ppx rewriters";
+      homepage = "https://www.lexifi.com/ppx_tools";
+      license = licenses.mit;
+      maintainers = with maintainers; [ vbgl ];
+    };
+in
+if lib.versionAtLeast param.version "6.0"
+then
+  buildDunePackage {
+    inherit pname src meta;
+    inherit (param) version buildInputs nativeBuildInputs;
+  }
+else
+  stdenv.mkDerivation {
+    name = "ocaml${ocaml.version}-${pname}-${param.version}";
+
+    inherit src;
+
+    nativeBuildInputs = [ ocaml findlib ];
+
+    strictDeps = true;
+
+    createFindlibDestdir = true;
+
+    dontStrip = true;
+
+    meta = meta // { inherit (ocaml.meta) platforms; };
+  }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix
new file mode 100644
index 000000000000..78915135a0c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml-migrate-parsetree }:
+
+buildDunePackage rec {
+  pname = "ppx_tools_versioned";
+  version = "5.4.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-ppx";
+    repo = pname;
+    rev = version;
+    sha256 = "07lnj4yzwvwyh5fhpp1dxrys4ddih15jhgqjn59pmgxinbnddi66";
+  };
+
+  propagatedBuildInputs = [ ocaml-migrate-parsetree ];
+
+  meta = with lib; {
+    homepage = "https://github.com/let-def/ppx_tools_versioned";
+    description = "Tools for authors of syntactic tools (such as ppx rewriters)";
+    license = licenses.gpl2;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv/default.nix
new file mode 100644
index 000000000000..27d07649d408
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv/default.nix
@@ -0,0 +1,34 @@
+{
+  lib,
+  buildDunePackage,
+  fetchFromGitHub,
+  ppx_js_style,
+  ppx_yojson_conv_lib,
+  ppxlib,
+}:
+buildDunePackage rec {
+  pname = "ppx_yojson_conv";
+  version = "0.15.1";
+  duneVersion = "3";
+  minimumOCamlVersion = "4.08.0";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-lSOUSMVgsRiArEhFTKpAj2yFBPbtaIc/SxdPA+24xXs=";
+  };
+
+  propagatedBuildInputs = [
+    ppx_js_style
+    ppx_yojson_conv_lib
+    ppxlib
+  ];
+
+  meta = with lib; {
+    description = "PPX syntax extension that generates code for converting OCaml types to and from Yojson";
+    homepage = "https://github.com/janestreet/ppx_yojson_conv";
+    maintainers = with maintainers; [djacu];
+    license = with licenses; [mit];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix
new file mode 100644
index 000000000000..7ddbc1f5d514
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, yojson }:
+
+buildDunePackage rec {
+  pname = "ppx_yojson_conv_lib";
+  version = "0.16.0";
+
+  minimalOCamlVersion = "4.02.3";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-TOf6DKyvc+RsSWsLi//LXW+J0sd5uJtF/HFQllcL7No=";
+  };
+
+  propagatedBuildInputs = [ yojson ];
+
+  meta = with lib; {
+    description = "Runtime lib for ppx_yojson_conv";
+    homepage = "https://github.com/janestreet/ppx_yojson_conv_lib";
+    maintainers = [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix
new file mode 100644
index 000000000000..bc849fa1ece3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix
@@ -0,0 +1,100 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, version ?
+  if lib.versionAtLeast ocaml.version "4.07"
+  then if lib.versionAtLeast ocaml.version "4.08"
+  then if lib.versionAtLeast ocaml.version "4.11"
+  then "0.32.1" else "0.24.0" else "0.15.0" else "0.13.0"
+, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
+, stdlib-shims, ocaml-migrate-parsetree-2
+}:
+
+let param = {
+  "0.8.1" = {
+    sha256 = "sha256-pct57oO7qAMEtlvEfymFOCvviWaLG0b5/7NzTC8vdSE=";
+    max_version = "4.10";
+    OMP = [ ocaml-migrate-parsetree ];
+  };
+  "0.13.0" = {
+    sha256 = "sha256-geHz0whQDg5/YQjVsN2iuHlkClwh7z3Eqb2QOBzuOdk=";
+    min_version = "4.07";
+    max_version = "4.11";
+    OMP = [ ocaml-migrate-parsetree ];
+  };
+  "0.15.0" = {
+    sha256 = "sha256-C2MNf410qJmlXMJxiLXOA+c1qT8H6gwt5WUy2P2TszA=";
+    min_version = "4.07";
+    max_version = "4.12";
+    OMP = [ ocaml-migrate-parsetree ];
+  };
+  "0.18.0" = {
+    sha256 = "sha256-nUg8NkZ64GHHDfcWbtFGXq3MNEKu+nYPtcVDm/gEfcM=";
+    min_version = "4.07";
+    max_version = "4.12";
+    OMP = [ ocaml-migrate-parsetree-2 ];
+  };
+  "0.22.0" = {
+    sha256 = "sha256-PuuR4DlmZiKEoyIuYS3uf0+it2N8U9lXLSp0E0u5bXo=";
+    min_version = "4.07";
+    max_version = "4.13";
+    OMP = [ ocaml-migrate-parsetree-2 ];
+  };
+  "0.22.2" = {
+    sha256 = "sha256-0Oih69xiILFXTXqSbwCEYMURjM73m/mgzgJC80z/Ilo=";
+    min_version = "4.07";
+    max_version = "4.14";
+    OMP = [ ocaml-migrate-parsetree-2 ];
+  };
+  "0.23.0" = {
+    sha256 = "sha256-G1g2wYa51aFqz0falPOWj08ItRm3cpzYao/TmXH+EuU=";
+    min_version = "4.07";
+    max_version = "4.14";
+  };
+  "0.24.0" = {
+    sha256 = "sha256-d2YCfC7ND1s7Rg6SEqcHCcZ0QngRPrkfMXxWxB56kMg=";
+    min_version = "4.07";
+    max_version = "5.1";
+  };
+  "0.28.0" = {
+    sha256 = "sha256-2Hrl+aCBIGMIypZICbUKZq646D0lSAHouWdUSLYM83c=";
+    min_version = "4.07";
+    max_version = "5.1";
+  };
+  "0.30.0" = {
+    sha256 = "sha256-3UpjvenSm0mBDgTXZTk3yTLxd6lByg4ZgratU6xEIRA=";
+    min_version = "4.07";
+  };
+  "0.32.1" = {
+    sha256 = "sha256-nbrYvLHItPPfP1i8pgpe0j2GUx8No0tBlshr1YXAnX8=";
+    min_version = "4.07";
+  };
+}."${version}"; in
+
+if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
+|| param ? min_version && lib.versionOlder ocaml.version param.min_version
+then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage rec {
+  pname = "ppxlib";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz";
+    inherit (param) sha256;
+  };
+
+  propagatedBuildInputs = [
+    ocaml-compiler-libs
+  ] ++ (param.OMP or []) ++ [
+    ppx_derivers
+    stdio
+    stdlib-shims
+  ];
+
+  meta = {
+    description = "Comprehensive ppx tool set";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/ocaml-ppx/ppxlib";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pratter/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pratter/default.nix
new file mode 100644
index 000000000000..efd2fc6639c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pratter/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, camlp-streams
+, alcotest
+, qcheck
+, qcheck-alcotest
+}:
+
+buildDunePackage rec {
+  version = "2.0.0";
+  pname = "pratter";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "gabrielhdt";
+    repo = "pratter";
+    rev = version;
+    hash = "sha256-QEq8Zt2pfsRT04Zd+ugGKcHdzkqYcDDUg/iAFMMDdEE=";
+  };
+
+  propagatedBuildInputs = [ camlp-streams ];
+
+  checkInputs = [ alcotest qcheck qcheck-alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Extended Pratt parser";
+    homepage = "https://github.com/gabrielhdt/pratter";
+    license = licenses.bsd3;
+    changelog = "https://github.com/gabrielhdt/pratter/raw/${version}/CHANGELOG.md";
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/prettym/default.nix b/nixpkgs/pkgs/development/ocaml-modules/prettym/default.nix
new file mode 100644
index 000000000000..a229eb9f35f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/prettym/default.nix
@@ -0,0 +1,47 @@
+{ alcotest
+, base64
+, bigarray-overlap
+, bigstringaf
+, buildDunePackage
+, fetchurl
+, fmt
+, jsonm
+, ke
+, lib
+, ptime
+}:
+
+buildDunePackage rec {
+  pname = "prettym";
+  version = "0.0.3";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/prettym/releases/download/${version}/prettym-${version}.tbz";
+    hash = "sha256-kXDxoRref02YpYSlvlK7a5FBX5ccbnWJQzG0axi5jwk=";
+  };
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    bigarray-overlap
+    bigstringaf
+    fmt
+    ke
+  ];
+
+  checkInputs = [
+    ptime
+    alcotest
+    jsonm
+    base64
+  ];
+  doCheck = true;
+
+  meta = {
+    description = "Simple bounded encoder to serialize human readable values and respect the 80-column constraint";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/dinosaure/prettym";
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix b/nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix
new file mode 100644
index 000000000000..13fad457e2ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, mdx, gitUpdater }:
+
+buildDunePackage rec {
+  pname = "printbox";
+  version = "0.6.1";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-7u2ThRhM3vW4ItcFsK4ycgcaW0JcQOFoZZRq2kqbl+k=";
+  };
+
+  nativeCheckInputs = [ mdx.bin ];
+
+  # mdx is not available for OCaml < 4.08
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  passthru.updateScript = gitUpdater { rev-prefix = "v"; };
+
+  meta = {
+    homepage = "https://github.com/c-cube/printbox/";
+    description = "Allows to print nested boxes, lists, arrays, tables in several formats";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/printbox/text.nix b/nixpkgs/pkgs/development/ocaml-modules/printbox/text.nix
new file mode 100644
index 000000000000..dd823b2264c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/printbox/text.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, lib, ocaml, printbox, uucp, uutf, mdx }:
+
+buildDunePackage {
+  pname = "printbox-text";
+  inherit (printbox) src version;
+
+  propagatedBuildInputs = [ printbox uucp uutf ];
+
+  doCheck = printbox.doCheck && lib.versionOlder ocaml.version "5.0";
+  nativeCheckInputs = [ mdx.bin ];
+
+  meta = printbox.meta // {
+    description = "Text renderer for printbox, using unicode edges";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/process/default.nix b/nixpkgs/pkgs/development/ocaml-modules/process/default.nix
new file mode 100644
index 000000000000..89faf40c3be5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/process/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-process";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "dsheets";
+    repo = "ocaml-process";
+    rev = version;
+    sha256 = "0m1ldah5r9gcq09d9jh8lhvr77910dygx5m309k1jm60ah9mdcab";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "Easy process control in OCaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/progress/default.nix b/nixpkgs/pkgs/development/ocaml-modules/progress/default.nix
new file mode 100644
index 000000000000..7ca95a088243
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/progress/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage
+, fmt, logs, mtime, optint, terminal, vector
+, alcotest, astring
+}:
+
+buildDunePackage rec {
+  pname = "progress";
+
+  minimalOCamlVersion = "4.08";
+
+  inherit (terminal) version src;
+
+  propagatedBuildInputs = [ fmt logs mtime optint terminal vector ];
+
+  doCheck = true;
+  checkInputs = [ alcotest astring ];
+
+  meta = with lib; {
+    description = "Progress bar library for OCaml";
+    homepage = "https://github.com/CraigFe/progress";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/prometheus/default.nix b/nixpkgs/pkgs/development/ocaml-modules/prometheus/default.nix
new file mode 100644
index 000000000000..2715c50b3edd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/prometheus/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage, astring, asetmap, fmt, re, lwt, alcotest }:
+
+buildDunePackage rec {
+  pname = "prometheus";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/prometheus/releases/download/v${version}/prometheus-${version}.tbz";
+    sha256 = "sha256-g2Q6ApprbecdFANO7i6U/v8dCHVcSkHVg9wVMKtVW8s=";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    astring
+    asetmap
+    fmt
+    re
+    lwt
+    alcotest
+  ];
+
+  meta = {
+    description = "Client library for Prometheus monitoring";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/promise_jsoo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/promise_jsoo/default.nix
new file mode 100644
index 000000000000..061f965e0e52
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/promise_jsoo/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage, js_of_ocaml, ppxlib, js_of_ocaml-ppx, gen_js_api, ojs }:
+
+buildDunePackage rec {
+  pname = "promise_jsoo";
+  version = "0.3.1";
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mnxn/promise_jsoo/releases/download/v${version}/promise_jsoo-v${version}.tbz";
+    sha256 = "00pjnsbv0yv3hhxbbl8dsljgr95kjgi9w8j1x46gjyxg9zayrxzl";
+  };
+
+  buildInputs = [
+    ppxlib
+    js_of_ocaml-ppx
+    gen_js_api
+  ];
+
+  propagatedBuildInputs = [
+    js_of_ocaml
+    ojs
+  ];
+
+  meta = {
+    homepage = "https://github.com/mnxn/promise_jsoo";
+    description = "Js_of_ocaml bindings to JS Promises with supplemental functions";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ jayesh-bhoot ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix b/nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix
new file mode 100644
index 000000000000..6981726f6df7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, buildDunePackage, menhir }:
+
+buildDunePackage rec {
+  version = "0.4.0";
+  pname = "psmt2-frontend";
+
+  src = fetchFromGitHub {
+    owner = "ACoquereau";
+    repo = pname;
+    rev = version;
+    hash = "sha256-cYY9x7QZjH7pdJyHMqfMXgHZ3/zJLp/6ntY6OSIo6Vs=";
+  };
+
+  minimalOCamlVersion = "4.03";
+
+  nativeBuildInputs = [ menhir ];
+
+  meta = {
+    description = "Simple parser and type-checker for polomorphic extension of the SMT-LIB 2 language";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/psq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/psq/default.nix
new file mode 100644
index 000000000000..f1c8ab92af44
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/psq/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, ocaml, fetchurl, seq, qcheck-alcotest }:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.03";
+  pname = "psq";
+  version = "0.2.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/psq/releases/download/v${version}/psq-${version}.tbz";
+    hash = "sha256-QgBfUz6r50sXme4yuJBWVM1moivtSvK9Jmso2EYs00Q=";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ qcheck-alcotest ];
+
+  meta = {
+    description = "Functional Priority Search Queues for OCaml";
+    homepage = "https://github.com/pqwy/psq";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix
new file mode 100644
index 000000000000..1f23194582a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix
@@ -0,0 +1,55 @@
+{ stdenv
+, lib
+, fetchurl
+, ocaml
+, findlib
+, ocamlbuild
+, topkg
+}:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "ptime is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation (finalAttrs: {
+  version = "1.1.0";
+  pname = "ocaml${ocaml.version}-ptime";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/ptime/releases/ptime-${finalAttrs.version}.tbz";
+    hash = "sha256-y/WxVFT7JxBeLDNAI+HhHY+TnXF4hw9cvo7SbfcBPrE=";
+  };
+
+  nativeBuildInputs = [
+    findlib
+    ocaml
+    ocamlbuild
+    topkg
+  ];
+
+  buildInputs = [
+    topkg
+  ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "POSIX time for OCaml";
+    homepage = "https://erratique.ch/software/ptime";
+    license = lib.licenses.isc;
+    longDescription = ''
+      Ptime has platform independent POSIX time support in pure OCaml.
+      It provides a type to represent a well-defined range of POSIX timestamps
+      with picosecond precision, conversion with date-time values, conversion
+      with RFC 3339 timestamps and pretty printing to a human-readable,
+      locale-independent representation.
+
+      The additional Ptime_clock library provides access to a system POSIX clock
+      and to the system's current time zone offset.
+
+      Ptime is not a calendar library.
+    '';
+    maintainers = with lib.maintainers; [ sternenseemann ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix
new file mode 100644
index 000000000000..edc9e1c6dcbd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl
+, seq
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "ptmap";
+  version = "2.0.5";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/ptmap/releases/download/${version}/ptmap-${version}.tbz";
+    sha256 = "1apk61fc1y1g7x3m3c91fnskvxp6i0vk5nxwvipj56k7x2pzilgb";
+  };
+
+  buildInputs = [ stdlib-shims ];
+  propagatedBuildInputs = [ seq ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://www.lri.fr/~filliatr/software.en.html";
+    description = "Maps over integers implemented as Patricia trees";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ptset/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ptset/default.nix
new file mode 100644
index 000000000000..b9c534e763d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ptset/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "ptset";
+  version = "1.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/ptset/releases/download/${version}/ptset-${version}.tbz";
+    sha256 = "1pr80mgk12l93mdq1wfsv2b6ccraxs334d5h92qzjh7bw2g13424";
+  };
+
+  doCheck = true;
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  meta = {
+    description = "Integer set implementation using Patricia trees";
+    homepage = "https://github.com/backtracking/ptset";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pulseaudio/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pulseaudio/default.nix
new file mode 100644
index 000000000000..75f5e0f414fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pulseaudio/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, pulseaudio }:
+
+buildDunePackage rec {
+  pname = "pulseaudio";
+  version = "0.1.5";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-pulseaudio";
+    rev = "v${version}";
+    sha256 = "sha256-eG2HS5g3ycDftRDyXGBwPJE7VRnLXNUgcEgNfVm//ds=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ pulseaudio ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-pulseaudio";
+    description = "Bindings to Pulseaudio client library";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pure-splitmix/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pure-splitmix/default.nix
new file mode 100644
index 000000000000..228f8ad8c488
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pure-splitmix/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "pure-splitmix";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "Lysxia";
+    repo = pname;
+    rev = version;
+    sha256 = "RUnsAB4hMV87ItCyGhc47bHGY1iOwVv9kco2HxnzqbU=";
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/Lysxia/pure-splitmix";
+    description = "Purely functional splittable PRNG";
+    license = licenses.mit;
+    maintainers = [ maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pyml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pyml/default.nix
new file mode 100644
index 000000000000..d5840c8af53d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pyml/default.nix
@@ -0,0 +1,43 @@
+{ buildDunePackage
+, lib
+, fetchFromGitHub
+, utop
+, python3
+, stdcompat
+}:
+
+buildDunePackage rec {
+  pname = "pyml";
+  version = "20231101";
+
+  src = fetchFromGitHub {
+    owner = "thierry-martinez";
+    repo = "pyml";
+    rev = version;
+    sha256 = "sha256-0Yy5T/S3Npwt0XJmEsdXGg5AXYi9vV9UG9nMSzz/CEc=";
+  };
+
+  buildInputs = [
+    utop
+  ];
+
+  propagatedBuildInputs = [
+    python3
+    stdcompat
+  ];
+
+  nativeCheckInputs = [
+    python3.pkgs.numpy
+    python3.pkgs.ipython
+  ];
+
+  strictDeps = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "OCaml bindings for Python";
+    homepage = "https://github.com/thierry-martinez/pyml";
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix
new file mode 100644
index 000000000000..113b61eea180
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, qcheck-core, alcotest }:
+
+buildDunePackage {
+  pname = "qcheck-alcotest";
+
+  inherit (qcheck-core) version src patches;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ qcheck-core alcotest ];
+
+  meta = qcheck-core.meta // {
+    description = "Alcotest backend for qcheck";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/bytes.patch b/nixpkgs/pkgs/development/ocaml-modules/qcheck/bytes.patch
new file mode 100644
index 000000000000..7e5e5f2efedc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/bytes.patch
@@ -0,0 +1,36 @@
+diff --git a/src/alcotest/dune b/src/alcotest/dune
+index 220a8b3..df1ffe0 100644
+--- a/src/alcotest/dune
++++ b/src/alcotest/dune
+@@ -3,6 +3,6 @@
+   (name qcheck_alcotest)
+   (public_name qcheck-alcotest)
+   (wrapped false)
+-  (libraries unix bytes qcheck-core qcheck-core.runner alcotest)
++  (libraries unix qcheck-core qcheck-core.runner alcotest)
+   (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
+   )
+diff --git a/src/core/dune b/src/core/dune
+index ad0939f..42dc8ac 100644
+--- a/src/core/dune
++++ b/src/core/dune
+@@ -3,6 +3,6 @@
+   (name qcheck_core)
+   (public_name qcheck-core)
+   (wrapped false)
+-  (libraries unix bytes)
++  (libraries unix)
+   (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
+   )
+diff --git a/src/ounit/dune b/src/ounit/dune
+index 2fadb7a..41f8d4b 100644
+--- a/src/ounit/dune
++++ b/src/ounit/dune
+@@ -3,6 +3,6 @@
+   (name qcheck_ounit)
+   (public_name qcheck-ounit)
+   (wrapped false)
+-  (libraries unix bytes qcheck-core qcheck-core.runner ounit2)
++  (libraries unix qcheck-core qcheck-core.runner ounit2)
+   (flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
+   )
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix
new file mode 100644
index 000000000000..a688e9e595ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "qcheck-core";
+  version = "0.21.2";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "qcheck";
+    rev = "v${version}";
+    hash = "sha256-a+sjpvpQZbXjQgyx69hhVAmRCfDMMhFlg965dK5UN6Q=";
+  };
+
+  patches = [ ./bytes.patch ];
+
+  meta = {
+    description = "Core qcheck library";
+    homepage = "https://c-cube.github.io/qcheck/";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
new file mode 100644
index 000000000000..7189c2fb3461
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, qcheck-ounit }:
+
+buildDunePackage {
+  pname = "qcheck";
+
+  inherit (qcheck-ounit) version src patches;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ qcheck-ounit ];
+
+  meta = qcheck-ounit.meta // {
+    description = "Compatibility package for qcheck";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/lin.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/lin.nix
new file mode 100644
index 000000000000..460d15b288da
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/lin.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage
+, qcheck-multicoretests-util
+}:
+
+buildDunePackage {
+  pname = "qcheck-lin";
+
+  inherit (qcheck-multicoretests-util) version src;
+
+  propagatedBuildInputs = [ qcheck-multicoretests-util ];
+
+  doCheck = true;
+
+  meta = qcheck-multicoretests-util.meta // {
+    description = "Multicore testing library for OCaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/multicoretests-util.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/multicoretests-util.nix
new file mode 100644
index 000000000000..84355d916085
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/multicoretests-util.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, qcheck-core
+}:
+
+buildDunePackage rec {
+  pname = "qcheck-multicoretests-util";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-multicore";
+    repo = "multicoretests";
+    rev = version;
+    hash = "sha256-0fbMDksC23jojJV+aegBoSwKf1hNzDUvDEbo31HUDoM=";
+  };
+
+  propagatedBuildInputs = [ qcheck-core ];
+
+  doCheck = true;
+
+  minimalOCamlVersion = "4.12";
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/multicoretests";
+    description = "Utility functions for property-based testing of multicore programs";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix
new file mode 100644
index 000000000000..aef47005a27a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, qcheck-core, ounit }:
+
+buildDunePackage {
+  pname = "qcheck-ounit";
+
+  inherit (qcheck-core) version src patches;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ qcheck-core ounit ];
+
+  meta = qcheck-core.meta // {
+    description = "OUnit backend for qcheck";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/ppx_deriving_qcheck.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ppx_deriving_qcheck.nix
new file mode 100644
index 000000000000..82dc5399f282
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ppx_deriving_qcheck.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, qcheck-core
+, qcheck, ppxlib, ppx_deriving }:
+
+buildDunePackage {
+  pname = "ppx_deriving_qcheck";
+
+  inherit (qcheck-core) version src patches;
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    qcheck
+    ppxlib
+    ppx_deriving
+  ];
+
+  meta = qcheck-core.meta // {
+    description = "PPX Deriver for QCheck";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/stm.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/stm.nix
new file mode 100644
index 000000000000..a4cd762ea5e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/stm.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage
+, qcheck-multicoretests-util
+}:
+
+buildDunePackage {
+  pname = "qcheck-stm";
+
+  inherit (qcheck-multicoretests-util) src version;
+
+  propagatedBuildInputs = [ qcheck-multicoretests-util ];
+
+  doCheck = true;
+
+  meta = qcheck-multicoretests-util.meta // {
+    description = "State-machine testing library for sequential and parallel model-based tests";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix b/nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix
new file mode 100644
index 000000000000..640ecf45b7cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, qcheck }:
+
+buildDunePackage rec {
+  pname = "qtest";
+  version = "2.11.2";
+
+  src = fetchFromGitHub {
+    owner = "vincent-hugot";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-VLY8+Nu6md0szW4RVxTFwlSQ9kyrgUqf7wQEA6GW8BE=";
+  };
+
+  preBuild = ''
+    substituteInPlace src/dune \
+      --replace "(libraries bytes)" "" \
+      --replace "libraries qcheck ounit2 bytes" "libraries qcheck ounit2"
+  '';
+
+  propagatedBuildInputs = [ qcheck ];
+
+  meta = {
+    description = "Inline (Unit) Tests for OCaml";
+    mainProgram = "qtest";
+    inherit (src.meta) homepage;
+    maintainers = with lib.maintainers; [ vbgl ];
+    license = lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/randomconv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/randomconv/default.nix
new file mode 100644
index 000000000000..45f52ba5bded
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/randomconv/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, cstruct }:
+
+buildDunePackage rec {
+  pname = "randomconv";
+  version = "0.1.3";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/randomconv/releases/download/v${version}/randomconv-v${version}.tbz";
+    sha256 = "1iv3r0s5kqxs893b0d55f0r62k777haiahfkkvvfbqwgqsm6la4v";
+  };
+
+  propagatedBuildInputs = [ cstruct ];
+
+  meta = {
+    homepage = "https://github.com/hannesm/randomconv";
+    description = "Convert from random bytes to random native numbers";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rdbg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rdbg/default.nix
new file mode 100644
index 000000000000..47504e4aa888
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rdbg/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl, num, lutils, ounit}:
+
+buildDunePackage rec {
+  pname = "rdbg";
+  version = "1.199.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/rdbg.v${version}.tgz";
+    hash = "sha512:6076eaa3608a313f8ac71a4f5aa4fcc64aeb0c646d581e5035110d4c80f94de34f2ba26f90a9a1e92a7f788c9e799f1f7b0e3728c853a21983ad732f0ee60352";
+  };
+
+  buildInputs = [
+    num
+    ounit
+  ];
+
+  propagatedBuildInputs = [
+    lutils
+  ];
+
+  meta = with lib; {
+    homepage = "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/rdbg";
+    description = "Programmable debugger that targets reactive programs for which a rdbg-plugin exists. Currently two plugins exist : one for Lustre, and one for Lutin (nb: both are synchronous programming languages)";
+    license = lib.licenses.cecill21;
+    maintainers = [ lib.maintainers.delta ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/re/default.nix b/nixpkgs/pkgs/development/ocaml-modules/re/default.nix
new file mode 100644
index 000000000000..eaab20f7f2e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/re/default.nix
@@ -0,0 +1,37 @@
+{ lib, fetchurl, buildDunePackage, ocaml, ounit, seq }:
+
+let version_sha = if lib.versionAtLeast ocaml.version "4.08"
+  then
+    {
+      version = "1.11.0";
+      sha256 = "sha256-AfwkR4DA9r5yrnlrH7dQ82feGGJP110H7nl4LtbfjU8=";
+    }
+  else
+    {
+      version = "1.9.0";
+      sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
+    };
+in
+
+buildDunePackage rec {
+  pname = "re";
+  version = version_sha.version;
+
+  minimalOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz";
+    sha256 = version_sha.sha256;
+  };
+
+  buildInputs = lib.optional doCheck ounit;
+  propagatedBuildInputs = [ seq ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    homepage = "https://github.com/ocaml/ocaml-re";
+    description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
+    license = lib.licenses.lgpl2;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/react/default.nix b/nixpkgs/pkgs/development/ocaml-modules/react/default.nix
new file mode 100644
index 000000000000..753a3e82c0de
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/react/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-react";
+  version = "1.2.2";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/react/releases/react-${version}.tbz";
+    sha256 = "sha256-xK3TFdbx8VPRFe58qN1gwSZf9NQIwmYSX8tRJP0ij5k=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/react";
+    description = "Applicative events and signals for OCaml";
+    license = licenses.bsd3;
+    inherit (ocaml.meta) platforms;
+    maintainers = with maintainers; [ maggesi vbmithr gal_bolle ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix b/nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix
new file mode 100644
index 000000000000..243e0daf1631
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, react }:
+
+buildDunePackage rec {
+  pname = "reactiveData";
+  version = "0.3";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "reactiveData";
+    rev = version;
+    sha256 = "sha256-imUphE1vMe3bYqHhgTuGT+B7uLn75acX6fAwBLh1tz4=";
+  };
+
+  propagatedBuildInputs = [ react ];
+
+  meta = with lib; {
+    description = "OCaml module for functional reactive programming (FRP) based on React";
+    homepage = "https://github.com/ocsigen/reactiveData";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/readline/default.nix b/nixpkgs/pkgs/development/ocaml-modules/readline/default.nix
new file mode 100644
index 000000000000..43763a3116c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/readline/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildDunePackage, fetchFromGitLab
+, readline
+}:
+
+buildDunePackage {
+  pname = "readline";
+  version = "0.1";
+
+  minimalOCamlVersion = "4.14";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "vtourneu";
+    repo = "readline-ocaml";
+    rev = "b3f84c8a006439142884d3e0df51b395d963f9fe";
+    hash = "sha256-h4kGbzwM88rPGj/KkHKgGyfyvkAYHP83ZY1INZzTaIE=";
+  };
+
+  patches = [ ./dune.patch ];
+
+  preConfigure = ''
+    echo "(${lib.getOutput "dev" readline}/include)" > src/iflags.sexp
+    echo "(-L${lib.getOutput "lib" readline}/lib -lreadline)" > src/lflags.sexp
+  '';
+
+  propagatedBuildInputs = [ readline ];
+
+  meta = {
+    description = "OCaml bindings for GNU Readline";
+    homepage = "https://vtourneu.gitlabpages.inria.fr/readline-ocaml/readline/index.html";
+    license = lib.licenses.cecill20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/readline/dune.patch b/nixpkgs/pkgs/development/ocaml-modules/readline/dune.patch
new file mode 100644
index 000000000000..9b62fb6f9b51
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/readline/dune.patch
@@ -0,0 +1,16 @@
+--- a/src/dune	2023-11-23 16:07:10.195742159 +0100
++++ b/src/dune	2023-11-23 16:07:22.055805922 +0100
+@@ -1,13 +1,3 @@
+-(rule
+-  (target iflags.sexp)
+-  (action (run ./discover.sh include))
+-)
+-
+-(rule
+-  (target lflags.sexp)
+-  (action (run ./discover.sh lib))
+-)
+-
+ (library
+   (name readline)
+   (public_name readline)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix
new file mode 100644
index 000000000000..ee5e7d2774d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix
@@ -0,0 +1,14 @@
+{ re, reason, pastel, ... }:
+
+{
+  pname = "cli";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  buildInputs = [
+    re
+    pastel
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/console.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/console.nix
new file mode 100644
index 000000000000..a39ba9a7e3ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/console.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, callPackage, reason, console, ... }:
+
+{
+  pname = "console";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  passthru.tests = {
+    console = callPackage ./tests/console {
+      inherit buildDunePackage reason console;
+    };
+  };
+
+  meta = {
+    description = "Library providing a web-influenced polymorphic console API for native Console.log(anything) with runtime printing";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/console";
+    homepage = "https://reason-native.com/docs/console/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/default.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/default.nix
new file mode 100644
index 000000000000..024783cf6184
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/default.nix
@@ -0,0 +1,43 @@
+{ newScope, lib, fetchFromGitHub, callPackage, buildDunePackage, atdgen, junit, qcheck-core, re, reason, reason-native, fetchpatch }:
+
+let
+  generic = (somePath:
+    let
+      prepkg = import somePath {
+        inherit callPackage cli buildDunePackage atdgen junit qcheck-core re reason fetchpatch;
+        inherit (reason-native) console file-context-printer fp pastel rely;
+      };
+    in
+      buildDunePackage
+        ({
+          version = "2022-08-31-a0ddab6";
+          src = fetchFromGitHub {
+            owner = "reasonml";
+            repo = "reason-native";
+            rev = "a0ddab6ab25237961e32d8732b0a222ec2372d4a";
+            hash = "sha256-s2N5OFTwIbKXcv05gQRaBMCHO1Mj563yhryPeo8jMh8=";
+          };
+          duneVersion = "3";
+          meta = with lib; {
+            description = "Libraries for building and testing native Reason programs";
+            downloadPage = "https://github.com/reasonml/reason-native";
+            homepage = "https://reason-native.com/";
+            license = licenses.mit;
+            maintainers = with maintainers; [ ];
+          } // (prepkg.meta or {});
+        } // prepkg)
+  );
+  cli = generic ./cli.nix; # Used only by Rely.
+in
+  lib.makeScope newScope (self: with self; {
+    console = generic ./console.nix;
+    dir = generic ./dir.nix;
+    file-context-printer = generic ./file-context-printer.nix;
+    fp = generic ./fp.nix;
+    pastel = generic ./pastel.nix;
+    pastel-console = generic ./pastel-console.nix;
+    qcheck-rely = generic ./qcheck-rely.nix;
+    refmterr = generic ./refmterr.nix;
+    rely = generic ./rely.nix;
+    rely-junit-reporter = generic ./rely-junit-reporter.nix;
+  })
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/dir.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/dir.nix
new file mode 100644
index 000000000000..8b09eafc3696
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/dir.nix
@@ -0,0 +1,18 @@
+{ reason, fp, ... }:
+
+{
+  pname = "dir";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    fp
+  ];
+
+  meta = {
+    description = "Library that provides a consistent API for common system, user and application directories consistently on all platforms";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/dir";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix
new file mode 100644
index 000000000000..a7c663493ef5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix
@@ -0,0 +1,20 @@
+{ reason, re, pastel, ... }:
+
+{
+  pname = "file-context-printer";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    re
+    pastel
+  ];
+
+  meta = {
+    description = "Utility for displaying snippets of files on the command line";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/file-context-printer";
+    homepage = "https://reason-native.com/docs/file-context-printer/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/fp.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/fp.nix
new file mode 100644
index 000000000000..7df1c84e55cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/fp.nix
@@ -0,0 +1,14 @@
+{ reason, ... }:
+
+{
+  pname = "fp";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  meta = {
+    description = "Library for creating and operating on file paths consistently on multiple platforms";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/fp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel-console.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel-console.nix
new file mode 100644
index 000000000000..968b9f88af91
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel-console.nix
@@ -0,0 +1,20 @@
+{ reason, console, pastel, ... }:
+
+{
+  pname = "pastel-console";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    console
+    pastel
+  ];
+
+  meta = {
+    description = "Small library for pretty coloring to Console output";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/pastel-console";
+    homepage = "https://reason-native.com/docs/pastel/console";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel.nix
new file mode 100644
index 000000000000..6d08243638ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel.nix
@@ -0,0 +1,20 @@
+{ reason, re, ... }:
+
+{
+  pname = "pastel";
+
+  minimalOCamlVersion = "4.05";
+
+  nativeBuildInputs = [
+    reason
+  ];
+  propagatedBuildInputs = [
+    re
+  ];
+
+  meta = {
+    description = "Text formatting library that harnesses Reason JSX to provide intuitive terminal output. Like React but for CLI";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/pastel";
+    homepage = "https://reason-native.com/docs/pastel/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix
new file mode 100644
index 000000000000..ac645791f46c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix
@@ -0,0 +1,31 @@
+{ qcheck-core, reason, console, rely, fetchpatch, ... }:
+
+{
+  pname = "qcheck-rely";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/reasonml/reason-native/pull/269/commits/b42d66f5929a11739c13f849939007bf8610888b.patch";
+      hash = "sha256-MMLl3eqF8xQZ2T+sIEuv2WpnGF6FZtatgH5fiF5hpP4=";
+      includes = [
+        "src/qcheck-rely/QCheckRely.re"
+        "src/qcheck-rely/QCheckRely.rei"
+      ];
+    })
+  ];
+
+  propagatedBuildInputs = [
+    qcheck-core
+    console
+    rely
+  ];
+
+  meta = {
+    description = "Library containing custom Rely matchers allowing for easily using QCheck with Rely. QCheck is a 'QuickCheck inspired property-based testing for OCaml, and combinators to generate random values to run tests on'";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/qcheck-rely";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix
new file mode 100644
index 000000000000..17c595d9e107
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix
@@ -0,0 +1,22 @@
+{ atdgen, re, reason, pastel, ... }:
+
+{
+  pname = "refmterr";
+
+  nativeBuildInputs = [
+    atdgen
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    atdgen
+    re
+    pastel
+  ];
+
+  meta = {
+    description = "Error formatter tool for Reason and OCaml. Takes raw error output from compiler and converts to pretty output";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/refmterr";
+    homepage = "https://reason-native.com/docs/refmterr/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix
new file mode 100644
index 000000000000..25d9cc2c5f70
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix
@@ -0,0 +1,26 @@
+{ atdgen, junit, re, reason, pastel, rely, ... }:
+
+{
+  pname = "rely-junit-reporter";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  buildInputs = [
+    atdgen
+  ];
+
+  propagatedBuildInputs = [
+    junit
+    re
+    pastel
+    rely
+  ];
+
+  meta = {
+    description = "Tool providing JUnit Reporter for Rely Testing Framework";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/rely-junit-reporter";
+    homepage = "https://reason-native.com/docs/rely/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely.nix
new file mode 100644
index 000000000000..40315a668ba9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely.nix
@@ -0,0 +1,22 @@
+{ re, reason, cli, file-context-printer, pastel, ... }:
+
+{
+  pname = "rely";
+
+  nativeBuildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    re
+    cli
+    file-context-printer
+    pastel
+  ];
+
+  meta = {
+    description = "Jest-inspired testing framework for native OCaml/Reason";
+    downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/rely";
+    homepage = "https://reason-native.com/docs/rely/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re
new file mode 100644
index 000000000000..15685205e1bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re
@@ -0,0 +1 @@
+Console.log(Some("Hello fellow Nixer!")); /* {"Hello fellow Nixer!"} */
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix
new file mode 100644
index 000000000000..fc7f1891339b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, reason, console }:
+
+buildDunePackage rec {
+  pname = "console-test";
+  version = "1";
+
+  src = ./.;
+
+  duneVersion = "3";
+
+  buildInputs = [
+    reason
+    console
+  ];
+
+  doInstallCheck = true;
+  postInstallCheck = ''
+    $out/bin/console-test | grep -q "{\"Hello fellow Nixer!\"}" > /dev/null
+  '';
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/dune b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/dune
new file mode 100644
index 000000000000..49f2121385e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/tests/console/dune
@@ -0,0 +1,4 @@
+(executable
+ (name console-test)
+ (public_name console-test)
+ (libraries reason console.lib))
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rebez/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rebez/default.nix
new file mode 100644
index 000000000000..6a871069eb6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rebez/default.nix
@@ -0,0 +1,23 @@
+{ buildDunePackage, fetchFromGitHub, lib, reason }:
+
+buildDunePackage rec {
+  pname = "rebez";
+  version = "unstable-2019-06-20";
+
+  src = fetchFromGitHub {
+    owner = "jchavarri";
+    repo = "rebez";
+    rev = "03fa3b707abb28fdd710eb9e57ba40d9cd6ae163";
+    sha256 = "sha256-khZSwtwW+mP/EvAvIZMQyOb6FgNR+gmzpBZoD9ZPkpY=";
+  };
+
+  nativeBuildInputs = [ reason ];
+
+  meta = with lib; {
+    description = "Cubic bezier implementation in Reason / OCaml";
+    homepage = "https://github.com/jchavarri/rebez/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+    mainProgram = "RebezApp.exe";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/reperf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/reperf/default.nix
new file mode 100644
index 000000000000..10c6ee65626c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reperf/default.nix
@@ -0,0 +1,41 @@
+{ buildDunePackage, fetchFromGitHub, lib, printbox-text, reason }:
+
+buildDunePackage rec {
+  pname = "reperf";
+  version = "1.5.1";
+
+  src = fetchFromGitHub {
+    owner = "bryphe";
+    repo = "reperf";
+    rev = "68ef2f96899c09e6ac7d929b0375f7a806aee067";
+    sha256 = "sha256-ASujTsH4eDAYLNalB9Xt1p3C8x+FI0kMldZBYaXMCWc=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace "printbox" "printbox-text"
+  '';
+
+  nativeBuildInputs = [ reason ];
+
+  propagatedBuildInputs = [
+    printbox-text
+  ];
+
+  meta = with lib; {
+    description = "Native Reason + JSOO cross-platform performance benchmarking tools";
+    longDescription = ''
+      Inspired by the core_bench tools from Janestreet.
+
+      reperf helps with:
+      * Timing: time spent in a code block
+      * Call count: frequency of code-path calls
+      * Allocations: code-block impact to garbage collector
+
+      Supports benchmarks, which are test cases that exercise performance scenarios.
+      Outputs a JSON performance report, and compare it with previous iterations - and fail if a regression is detected.
+    '';
+    homepage = "https://github.com/bryphe/reperf";
+    maintainers = with maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/repr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/repr/default.nix
new file mode 100644
index 000000000000..d3d23a5d9fc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/repr/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchFromGitHub, base64, either, fmt, jsonm, uutf, optint }:
+
+buildDunePackage rec {
+  pname = "repr";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = "repr";
+    rev = version;
+    hash = "sha256-SM55m5NIaQ2UKAtznNFSt3LN4QA7As0DyTxVeQjOTjI=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    base64
+    either
+    fmt
+    jsonm
+    uutf
+    optint
+  ];
+
+  meta = with lib; {
+    description = "Dynamic type representations. Provides no stability guarantee";
+    homepage = "https://github.com/mirage/repr";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/repr/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/repr/ppx.nix
new file mode 100644
index 000000000000..cd3bf78eadda
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/repr/ppx.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, ppx_deriving, ppxlib, repr, alcotest, hex }:
+
+buildDunePackage {
+  pname = "ppx_repr";
+
+  inherit (repr) src version;
+
+  propagatedBuildInputs = [
+    ppx_deriving
+    ppxlib
+    repr
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    hex
+  ];
+
+  meta = repr.meta // {
+    description = "PPX deriver for type representations";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/res/default.nix b/nixpkgs/pkgs/development/ocaml-modules/res/default.nix
new file mode 100644
index 000000000000..779a3c3d8a5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/res/default.nix
@@ -0,0 +1,24 @@
+{ lib , fetchurl , buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "res";
+  version = "5.0.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/res/releases/download/${version}/res-${version}.tbz";
+    hash = "sha256-rSrDMQBfnbWAr2LuajP3fveOtOwLyRbKPkaTKsnocQ4=";
+  };
+
+  doCheck = true;
+
+  meta = {
+    description = "Library for resizable, contiguous datastructures";
+    homepage = "https://github.com/mmottl/res";
+    changelog = "https://github.com/mmottl/res/blob/${version}/CHANGES.md";
+    license = lib.licenses.lgpl2Plus;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix b/nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix
new file mode 100644
index 000000000000..79d5c6175a7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, lwt_log }:
+
+buildDunePackage rec {
+  version = "1.2";
+  pname = "resource-pooling";
+
+  minimalOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-GNYPxjMTo7y40y7aQdseuFyeVF/hSCZKXfEaH/WIO9w=";
+  };
+
+  propagatedBuildInputs = [ lwt_log ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Library for pooling resources like connections, threads, or similar";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix
new file mode 100644
index 000000000000..92a1b751ed5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, resto, uri }:
+
+buildDunePackage {
+  pname = "resto-acl";
+  inherit (resto) src version meta doCheck;
+
+  minimalOCamlVersion = "4.10";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    uri
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix
new file mode 100644
index 000000000000..fe6dd6b506e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage
+, resto
+, resto-directory
+, resto-cohttp
+, uri
+, lwt
+}:
+
+buildDunePackage {
+  pname = "resto-cohttp-client";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    resto-directory
+    resto-cohttp
+    uri
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix
new file mode 100644
index 000000000000..fac4ce7422ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildDunePackage
+, resto
+, resto-directory
+, resto-acl
+, resto-cohttp
+, resto-cohttp-client
+, resto-cohttp-server
+, uri
+, lwt
+}:
+
+buildDunePackage {
+  pname = "resto-cohttp-self-serving-client";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    resto-directory
+    resto-acl
+    resto-cohttp
+    resto-cohttp-client
+    resto-cohttp-server
+    uri
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix
new file mode 100644
index 000000000000..6347b8628b39
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildDunePackage
+, resto
+, resto-directory
+, resto-acl
+, resto-cohttp
+, cohttp-lwt-unix
+, conduit-lwt-unix
+, lwt
+}:
+
+buildDunePackage {
+  pname = "resto-cohttp-server";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    resto-directory
+    resto-acl
+    resto-cohttp
+    cohttp-lwt-unix
+    conduit-lwt-unix
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix
new file mode 100644
index 000000000000..f495cadbf48f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, resto, resto-directory, cohttp-lwt }:
+
+buildDunePackage {
+  pname = "resto-cohttp";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    resto-directory
+    cohttp-lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/default.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/default.nix
new file mode 100644
index 000000000000..43735de3e506
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitLab, buildDunePackage, uri }:
+
+buildDunePackage rec {
+  pname = "resto";
+  version = "1.0";
+  duneVersion = "3";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "resto";
+    rev = "v${version}";
+    sha256 = "sha256-DIm7fmISsCgRDi4p3NsUk7Cvs/dHpIKMdAOVdYLX2mc=";
+  };
+
+  propagatedBuildInputs = [
+    uri
+  ];
+
+  # resto has infinite recursion in their tests
+  doCheck = false;
+
+  meta = {
+    description = "Minimal OCaml library for type-safe HTTP/JSON RPCs";
+    homepage = "https://gitlab.com/nomadic-labs/resto";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix
new file mode 100644
index 000000000000..efbb7cb608e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, resto, resto-json, lwt }:
+
+buildDunePackage {
+  pname = "resto-directory";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/json.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/json.nix
new file mode 100644
index 000000000000..c0f9b00d6ad7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/json.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, resto, json-data-encoding, json-data-encoding-bson }:
+
+buildDunePackage {
+  pname = "resto-json";
+  inherit (resto) src version meta doCheck;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    resto
+    json-data-encoding
+    json-data-encoding-bson
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix
new file mode 100644
index 000000000000..0cc59fa3e7c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, fetchpatch
+, ocaml
+
+, ounit
+, zarith
+}:
+
+buildDunePackage rec {
+  pname = "rfc7748";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "burgerdev";
+    repo = "ocaml-rfc7748";
+    rev = "v${version}";
+    sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4=";
+  };
+
+  # Compatibility with OCaml 5.0
+  patches = fetchpatch {
+    url = "https://github.com/burgerdev/ocaml-rfc7748/commit/f66257bae0317c7b24c4b208ee27ab6eb68460e4.patch";
+    hash = "sha256-780yy8gLOwwf7xIKIIIaoGpDPcY7+dZ0jPS4nrkH2s8=";
+  };
+
+  minimalOCamlVersion = "4.05";
+
+  propagatedBuildInputs = [ zarith ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ ounit ];
+
+  meta = {
+    homepage = "https://github.com/burgerdev/ocaml-rfc7748";
+    description = "Elliptic Curve Diffie-Hellman on Edwards Curves (X25519, X448)";
+    longDescription = ''
+      This library implements the ECDH functions 'X25519' and 'X448' as specified
+      in RFC 7748, 'Elliptic curves for security'. In the spirit of the original
+      publications, the public API is kept as simple as possible to make it easy
+      to use and hard to misuse.
+    '';
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ fufexan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix
new file mode 100644
index 000000000000..4920a2910b8f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "ringo";
+  version = "1.0.0";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ringo";
+    rev = "v${version}";
+    sha256 = "sha256-9HW3M27BxrEPbF8cMHwzP8FmJduUInpQQAE2672LOuU=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  doCheck = true;
+
+  meta = {
+    description = "Caches (bounded-size key-value stores) and other bounded-size stores";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rio/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rio/default.nix
new file mode 100644
index 000000000000..853670be3528
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rio/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, cstruct
+}:
+
+buildDunePackage rec {
+  pname = "rio";
+  version = "0.0.8";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/riot-ml/riot/releases/download/${version}/riot-${version}.tbz";
+    hash = "sha256-SsiDz53b9bMIT9Q3IwDdB3WKy98WSd9fiieU41qZpeE=";
+  };
+
+  propagatedBuildInputs = [
+    cstruct
+  ];
+
+  meta = {
+    description = "Ergonomic, composable, efficient read/write streams";
+    homepage = "https://github.com/riot-ml/riot";
+    changelog = "https://github.com/riot-ml/riot/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = [ ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/riot/default.nix b/nixpkgs/pkgs/development/ocaml-modules/riot/default.nix
new file mode 100644
index 000000000000..f7ead9e0a194
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/riot/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, mirage-crypto-rng
+, mtime
+, gluon
+, randomconv
+, rio
+, telemetry
+, tls
+}:
+
+buildDunePackage rec {
+  pname = "riot";
+  version = "0.0.8";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/riot/releases/download/${version}/riot-${version}.tbz";
+    hash = "sha256-SsiDz53b9bMIT9Q3IwDdB3WKy98WSd9fiieU41qZpeE=";
+  };
+
+  propagatedBuildInputs = [
+    gluon
+    mirage-crypto-rng
+    mtime
+    randomconv
+    rio
+    telemetry
+    tls
+  ];
+
+  doCheck = false; # fails on sandbox
+
+  meta = {
+    description = "Actor-model multi-core scheduler for OCaml 5";
+    homepage = "https://github.com/leostera/riot";
+    changelog = "https://github.com/leostera/riot/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rock/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rock/default.nix
new file mode 100644
index 000000000000..ae484e937b83
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rock/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchurl, buildDunePackage
+, bigstringaf
+, hmap
+, httpaf
+, lwt
+, sexplib0
+}:
+
+buildDunePackage rec {
+  pname = "rock";
+  version = "0.20.0";
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/opium/releases/download/${version}/opium-${version}.tbz";
+    hash = "sha256-MmuRhm3pC69TX4t9Sy/yPjnZUuVzwEs8E/EFS1n/L7Y=";
+  };
+
+  propagatedBuildInputs = [
+    bigstringaf
+    hmap
+    httpaf
+    lwt
+    sexplib0
+  ];
+
+  meta = {
+    description = "Minimalist framework to build extensible HTTP servers and clients";
+    homepage = "https://github.com/rgrinberg/opium";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rope/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rope/default.nix
new file mode 100644
index 000000000000..c6260d713bc1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rope/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchurl, fetchpatch, ocaml, buildDunePackage
+, version ? if lib.versionAtLeast ocaml.version "5.0" then "0.6.3" else "0.6.2"
+, benchmark
+}:
+
+
+buildDunePackage {
+  pname = "rope";
+  inherit version;
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
+    hash = {
+      "0.6.2" = "sha256:15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
+      "0.6.3" = "sha256-M14fiP9BDiz3WEoMqAJqZaXk4PoZ8Z1YjOk+F97z05Y=";
+    }."${version}";
+  };
+
+  buildInputs = [ benchmark ] ;
+
+  patches = lib.optional (version == "0.6.3") (fetchpatch {
+    url = "https://github.com/Chris00/ocaml-rope/commit/be53daa18dd3d1450a92881b33c997eafb1dc958.patch";
+    hash = "sha256-fHJNfD1ph3+QLmVJ8C4hhJ8hvrWIh7D0EL0XhOW2yqQ=";
+  });
+
+  meta = {
+    homepage = "https://github.com/Chris00/ocaml-rope";
+    description = "Ropes (“heavyweight strings”) in OCaml";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rosetta/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rosetta/default.nix
new file mode 100644
index 000000000000..492e01ce5d59
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rosetta/default.nix
@@ -0,0 +1,34 @@
+{ buildDunePackage
+, coin
+, fetchzip
+, lib
+, yuscii
+, uuuu
+}:
+
+buildDunePackage rec {
+  pname = "rosetta";
+  version = "0.3.0";
+
+  src = fetchzip {
+    url = "https://github.com/mirage/rosetta/releases/download/v${version}/rosetta-v${version}.tbz";
+    sha256 = "1gzp3fbk8qd207cm25dgj9kj7b44ldqpjs63pl6xqvi9hx60m3ij";
+  };
+
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    coin
+    uuuu
+    yuscii
+  ];
+
+  doCheck = false; # No tests.
+
+  meta = {
+    description = "Universal decoder of an encoded flow (UTF-7, ISO-8859 and KOI8) to Unicode";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/mirage/rosetta";
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/routes/default.nix b/nixpkgs/pkgs/development/ocaml-modules/routes/default.nix
new file mode 100644
index 000000000000..584e287bbabf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/routes/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "routes";
+  version = "2.0.0";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/anuragsoni/routes/releases/download/${version}/routes-${version}.tbz";
+    hash = "sha256-O2KdaYwrAOUEwTtM14NUgGNxnc8BWAycP1EEuB6w1og=";
+  };
+
+  meta = with lib; {
+    description = "Typed routing for OCaml applications";
+    license = licenses.bsd3;
+    homepage = "https://anuragsoni.github.io/routes";
+    maintainers = with maintainers; [ ulrikstrid anmonteiro ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix
new file mode 100644
index 000000000000..9dd895ea4b0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage
+, alcotest
+, base64, cmdliner, rresult, xmlm, yojson
+}:
+
+buildDunePackage rec {
+  pname = "rpclib";
+  version = "9.0.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-rpc/releases/download/${version}/rpclib-${version}.tbz";
+    hash = "sha256-ziPrdWwCjZN0vRmCMpa923wjfT8FVFLTDRz30VIW6WM=";
+  };
+
+  buildInputs = [ cmdliner yojson ];
+  propagatedBuildInputs = [ base64 rresult xmlm ];
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-rpc";
+    description = "Light library to deal with RPCs in OCaml";
+    license = licenses.isc;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix
new file mode 100644
index 000000000000..a4a3e06bf100
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildDunePackage
+, rpclib
+, lwt
+, alcotest-lwt
+, ppx_deriving_rpc
+, yojson
+}:
+
+buildDunePackage {
+  pname = "rpclib-lwt";
+  inherit (rpclib) version src;
+  duneVersion = "3";
+
+  propagatedBuildInputs = [ lwt rpclib ];
+
+  checkInputs = [ alcotest-lwt ppx_deriving_rpc yojson ];
+  doCheck = true;
+
+  meta = rpclib.meta // {
+    description = "Library to deal with RPCs in OCaml - Lwt interface";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix
new file mode 100644
index 000000000000..0c1081159ede
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
+  "rresult is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-rresult";
+  version = "0.7.0";
+  src = fetchurl {
+    url = "https://erratique.ch/software/rresult/releases/rresult-${version}.tbz";
+    sha256 = "sha256-Eap/W4NGDmBDHjFU4+MsBx1G4VHqV2DPJDd4Bb+XVUA=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  propagatedBuildInputs = [ result ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    license = lib.licenses.isc;
+    homepage = "https://erratique.ch/software/rresult";
+    description = "Result value combinators for OCaml";
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/rusage/default.nix b/nixpkgs/pkgs/development/ocaml-modules/rusage/default.nix
new file mode 100644
index 000000000000..891784ba6def
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rusage/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "rusage";
+  version = "1.0.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/CraigFe/ocaml-rusage/releases/download/${version}/rusage-${version}.tbz";
+    hash = "sha256-OgYA2Fe1goqoaOS45Z6FBJNNYN/uq+KQoUwG8KSo6Fk=";
+  };
+
+  meta = {
+    description = "Bindings to the GETRUSAGE(2) syscall";
+    homepage = "https://github.com/CraigFe/ocaml-rusage";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix b/nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix
new file mode 100644
index 000000000000..d60cfcdb1276
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "safepass";
+  version = "3.1";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "darioteixeira";
+    repo = "ocaml-safepass";
+    rev = "v${version}";
+    sha256 = "1cwslwdb1774lfmhcclj9kymvidbcpjx1vp16jnjirqdqgl4zs5q";
+  };
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "OCaml library offering facilities for the safe storage of user passwords";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sail/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sail/default.nix
new file mode 100644
index 000000000000..a01afe5904a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sail/default.nix
@@ -0,0 +1,80 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, base64
+, omd
+, menhir
+, ott
+, linenoise
+, dune-site
+, pprint
+, makeWrapper
+, lem
+, z3
+, linksem
+, num
+, yojson
+}:
+
+buildDunePackage rec {
+  pname = "sail";
+  version = "0.16";
+
+  src = fetchFromGitHub {
+    owner = "rems-project";
+    repo = "sail";
+    rev = version;
+    hash = "sha256-HY/rgWi0S7ZiAWZF0fVIRK6fpoJ7Xp5EQcxoPRCPJ5Y=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  nativeBuildInputs = [
+    makeWrapper
+    ott
+    menhir
+    lem
+  ];
+
+  propagatedBuildInputs = [
+    base64
+    omd
+    dune-site
+    linenoise
+    pprint
+    linksem
+    yojson
+  ];
+
+  preBuild = ''
+    rm -r aarch*  # Remove code derived from non-bsd2 arm spec
+    rm -r snapshots  # Some of this might be derived from stuff in the aarch dir, it builds fine without it
+  '';
+  # `buildDunePackage` only builds the [pname] package
+  # This doesnt work in this case, as sail includes multiple packages in the same source tree
+  buildPhase = ''
+    runHook preBuild
+    dune build --release ''${enableParallelBuild:+-j $NIX_BUILD_CORES}
+    runHook postBuild
+  '';
+  checkPhase = ''
+    runHook preCheck
+    dune runtest ''${enableParallelBuild:+-j $NIX_BUILD_CORES}
+    runHook postCheck
+  '';
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix $out --libdir $OCAMLFIND_DESTDIR
+    runHook postInstall
+  '';
+  postInstall = ''
+    wrapProgram $out/bin/sail --set SAIL_DIR $out/share/sail
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/rems-project/sail";
+    description = "Language for describing the instruction-set architecture (ISA) semantics of processors";
+    maintainers = with maintainers; [ genericnerdyusername ];
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/samplerate/default.nix b/nixpkgs/pkgs/development/ocaml-modules/samplerate/default.nix
new file mode 100644
index 000000000000..c101cfc0c279
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/samplerate/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libsamplerate }:
+
+buildDunePackage rec {
+  pname = "samplerate";
+  version = "0.1.6";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-samplerate";
+    rev = "v${version}";
+    sha256 = "0h0i9v9p9n2givv3wys8qrfi1i7vp8kq7lnkf14s7d3m4r8x4wrp";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libsamplerate ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-samplerate";
+    description = "Interface for libsamplerate";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/saturn/default.nix b/nixpkgs/pkgs/development/ocaml-modules/saturn/default.nix
new file mode 100644
index 000000000000..582f0e7f5aea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/saturn/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, ocaml
+, saturn_lockfree
+, dscheck
+, qcheck, qcheck-alcotest, qcheck-stm
+}:
+
+buildDunePackage rec {
+  pname = "saturn";
+
+  inherit (saturn_lockfree) src version;
+
+  propagatedBuildInputs = [ saturn_lockfree ];
+
+  doCheck = lib.versionAtLeast ocaml.version "5.0";
+  checkInputs = [ dscheck qcheck qcheck-alcotest qcheck-stm ];
+
+  meta = saturn_lockfree.meta // {
+    description = "Parallelism-safe data structures for multicore OCaml";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/saturn/lockfree.nix b/nixpkgs/pkgs/development/ocaml-modules/saturn/lockfree.nix
new file mode 100644
index 000000000000..42858626e58d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/saturn/lockfree.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, domain_shims
+}:
+
+buildDunePackage rec {
+  pname = "saturn_lockfree";
+  version = "0.4.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/saturn/releases/download/${version}/saturn-${version}.tbz";
+    hash = "sha256-fHvslaJwVbQaqDVA/MHGqHybetYbxRGlMrhgXqM3iPs=";
+  };
+
+  propagatedBuildInputs = [ domain_shims ];
+
+  meta = {
+    description = "Lock-free data structures for multicore OCaml";
+    homepage = "https://github.com/ocaml-multicore/lockfree";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch b/nixpkgs/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch
new file mode 100644
index 000000000000..4f2cc99e76b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch
@@ -0,0 +1,9 @@
+--- sawja-1.5-orig/Makefile.config.example	2013-10-30 08:35:29.000000000 +0100
++++ sawja-1.5/Makefile.config.example	2014-07-05 18:54:37.902423482 +0200
+@@ -1,6 +1,3 @@
+-export OCAMLFIND_DESTDIR=$(LOCALDEST)
+-export OCAMLPATH=$(LOCALDEST)
+-
+ RECODE=-charset utf-8
+ DOCDIR = doc/api
+ 
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sawja/configure.sh.patch b/nixpkgs/pkgs/development/ocaml-modules/sawja/configure.sh.patch
new file mode 100644
index 000000000000..8165de242f57
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sawja/configure.sh.patch
@@ -0,0 +1,11 @@
+--- sawja-1.5-orig/configure.sh	2013-10-30 08:35:29.000000000 +0100
++++ sawja-1.5/configure.sh	2014-07-05 18:50:26.833798254 +0200
+@@ -39,7 +39,7 @@
+ DESTDIR=
+ # The ocamlpath variable for the compiler to locate the locally-installed
+ # packages (depends on LOCALDEST)
+-OCAMLPATH=
++#OCAMLPATH=
+ # The path to ocamlfind
+ FINDER=`which ocamlfind`
+ # The perl executable
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sawja/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sawja/default.nix
new file mode 100644
index 000000000000..465c568a1d1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sawja/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib, javalib }:
+
+let
+  pname = "sawja";
+  version = "1.5.12";
+in
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "${pname} is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation {
+
+  pname = "ocaml${ocaml.version}-${pname}";
+
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "javalib-team";
+    repo = pname;
+    rev = version;
+    hash = "sha256-G1W8/G0TEcldnFnH/NAb9a6ZSGGP2fWTM47lI8bBHnw=";
+  };
+
+  nativeBuildInputs = [ which ocaml findlib ];
+
+  strictDeps = true;
+
+  patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
+
+  createFindlibDestdir = true;
+
+  configureScript = "./configure.sh";
+  dontAddPrefix = "true";
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  propagatedBuildInputs = [ javalib ];
+
+  meta = with lib; {
+    description = "Library written in OCaml, relying on Javalib to provide a high level representation of Java bytecode programs";
+    homepage = "http://sawja.inria.fr/";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/secp256k1-internal/default.nix b/nixpkgs/pkgs/development/ocaml-modules/secp256k1-internal/default.nix
new file mode 100644
index 000000000000..b403b997027b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/secp256k1-internal/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, gmp
+, dune-configurator
+, cstruct
+, bigstring
+, alcotest
+, hex
+}:
+
+buildDunePackage rec {
+  pname = "secp256k1-internal";
+  version = "0.4";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ocaml-secp256k1-internal";
+    rev = "v${version}";
+    hash = "sha256-amVtp94cE1NxClWJgcJvRmilnQlC7z44mORUaxvPn00=";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    gmp
+    cstruct
+    bigstring
+  ];
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  checkInputs = [
+    alcotest
+    hex
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Bindings to secp256k1 internal functions (generic operations on the curve)";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/secp256k1/default.nix b/nixpkgs/pkgs/development/ocaml-modules/secp256k1/default.nix
new file mode 100644
index 000000000000..6dd4d7ad64a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/secp256k1/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, base, stdio, dune-configurator, secp256k1 }:
+
+buildDunePackage rec {
+  pname = "secp256k1";
+  version = "0.4.4";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "dakk";
+    repo = "secp256k1-ml";
+    rev = version;
+    hash = "sha256-22+dZb3MC1W5Qvsz3+IHV1/XiGCRmJHTH+6IW2QX2hU=";
+  };
+
+  buildInputs = [ base stdio dune-configurator secp256k1 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/dakk/secp256k1-ml";
+    description = "Elliptic curve library secp256k1 wrapper for Ocaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix
new file mode 100644
index 000000000000..b7303a425d62
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix
@@ -0,0 +1,85 @@
+{ lib
+, fetchFromGitHub
+, fetchurl
+, buildDunePackage
+, ocaml
+, gen
+, ppxlib
+, uchar
+, ppx_expect
+}:
+
+let param =
+  if lib.versionAtLeast ppxlib.version "0.26.0" then
+    {
+      version = "3.2";
+      sha256 = "sha256-5Vf1LRhSotNpTPzHmRgCMRYtrpgaspLlyzv1XdGt+u8=";
+    }
+  else {
+    version = "2.5";
+    sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy";
+  }
+; in
+
+let
+  unicodeVersion = "15.0.0";
+  baseUrl = "https://www.unicode.org/Public/${unicodeVersion}";
+
+  DerivedCoreProperties = fetchurl {
+    url = "${baseUrl}/ucd/DerivedCoreProperties.txt";
+    sha256 = "sha256-02cpC8CGfmtITGg3BTC90aCLazJARgG4x6zK+D4FYo0=";
+  };
+  DerivedGeneralCategory = fetchurl {
+    url = "${baseUrl}/ucd/extracted/DerivedGeneralCategory.txt";
+    sha256 = "sha256-/imkXAiCUA5ZEUCqpcT1Bn5qXXRoBhSK80QAxIucBvk=";
+  };
+  PropList = fetchurl {
+    url = "${baseUrl}/ucd/PropList.txt";
+    sha256 = "sha256-4FwKKBHRE9rkq9gyiEGZo+qNGH7huHLYJAp4ipZUC/0=";
+  };
+  atLeast31 = lib.versionAtLeast param.version "3.1";
+in
+buildDunePackage rec {
+  pname = "sedlex";
+  inherit (param) version;
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = "sedlex";
+    rev = "v${version}";
+    inherit (param) sha256;
+  };
+
+  propagatedBuildInputs = [
+    gen
+    ppxlib
+  ] ++ lib.optionals (!atLeast31) [
+    uchar
+  ];
+
+  preBuild = ''
+    rm src/generator/data/dune
+    ln -s ${DerivedCoreProperties} src/generator/data/DerivedCoreProperties.txt
+    ln -s ${DerivedGeneralCategory} src/generator/data/DerivedGeneralCategory.txt
+    ln -s ${PropList} src/generator/data/PropList.txt
+  '';
+
+  checkInputs = lib.optionals atLeast31 [
+    ppx_expect
+  ];
+
+  doCheck = true;
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://github.com/ocaml-community/sedlex";
+    changelog = "https://github.com/ocaml-community/sedlex/raw/v${version}/CHANGES";
+    description = "OCaml lexer generator for Unicode";
+    license = lib.licenses.mit;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sel/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sel/default.nix
new file mode 100644
index 000000000000..e9742c9b42d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sel/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, ppxlib, ppx_deriving, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "sel";
+  version = "0.4.0";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/gares/sel/releases/download/v${version}/sel-${version}.tbz";
+    hash = "sha256-Sp0eSeKyFmMvOQrebqLKP+HbHQB0D0eAmEjDzxnFL1I=";
+  };
+
+  buildInputs = [
+    ppxlib
+  ];
+
+  propagatedBuildInputs = [
+    ppx_deriving
+  ];
+
+  meta = {
+    description = "Simple event library";
+    homepage = "https://github.com/gares/sel/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/semaphore-compat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/semaphore-compat/default.nix
new file mode 100644
index 000000000000..a686ef42e708
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/semaphore-compat/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "semaphore-compat";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/semaphore-compat/releases/download/${version}/semaphore-compat-${version}.tbz";
+    sha256 = "139c5rxdp4dg1jcwyyxvhxr8213l1xdl2ab0mc288rfcppsiyxrb";
+  };
+
+  useDune2 = true;
+
+  meta = with lib; {
+    description = "Compatibility Semaphore module";
+    homepage = "https://github.com/mirage/semaphore-compat";
+    license = licenses.lgpl21Only;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/semver/default.nix b/nixpkgs/pkgs/development/ocaml-modules/semver/default.nix
new file mode 100644
index 000000000000..5f4880c0cf2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/semver/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildDunePackage, ocaml, alcotest }:
+
+buildDunePackage rec {
+  pname = "semver";
+  version = "0.2.1";
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/ocaml-semver/releases/download/${version}/semver-${version}.tbz";
+    hash = "sha256-CjzDUtoe5Hvt6zImb+EqVIulRUUUQd9MmuJ4BH/2mLg=";
+  };
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ alcotest ];
+
+  meta = {
+    homepage = "https://github.com/rgrinberg/ocaml-semver";
+    description = "Semantic versioning module";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/seq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/seq/default.nix
new file mode 100644
index 000000000000..6131585e34b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/seq/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation ({
+  version = "0.1";
+  pname = "ocaml${ocaml.version}-seq";
+
+  meta = {
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/c-cube/seq";
+    inherit (ocaml.meta) platforms;
+  };
+
+} // (if lib.versionOlder ocaml.version "4.07" then {
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "seq";
+    rev = "0.1";
+    sha256 = "1cjpsc7q76yfgq9iyvswxgic4kfq2vcqdlmxjdjgd4lx87zvcwrv";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  meta.description = "Compatibility package for OCaml’s standard iterator type starting from 4.07";
+
+} else {
+
+  src = ./src-base;
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/seq
+    cp META $out/lib/ocaml/${ocaml.version}/site-lib/seq
+  '';
+
+  meta.description = "dummy backward-compatibility package for iterators";
+
+}))
diff --git a/nixpkgs/pkgs/development/ocaml-modules/seq/src-base/META b/nixpkgs/pkgs/development/ocaml-modules/seq/src-base/META
new file mode 100644
index 000000000000..06b95eff3f8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/seq/src-base/META
@@ -0,0 +1,4 @@
+name="seq"
+version="[distributed with OCaml 4.07 or above]"
+description="dummy backward-compatibility package for iterators"
+requires=""
diff --git a/nixpkgs/pkgs/development/ocaml-modules/seqes/default.nix b/nixpkgs/pkgs/development/ocaml-modules/seqes/default.nix
new file mode 100644
index 000000000000..242895f95c5c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/seqes/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage, qcheck, qcheck-alcotest, alcotest }:
+
+buildDunePackage rec {
+  pname = "seqes";
+  version = "0.2";
+  src = fetchurl {
+    url = "https://gitlab.com/nomadic-labs/seqes/-/archive/${version}/seqes-${version}.tar.gz";
+    sha256 = "sha256-IxLA0jaIPdX9Zn/GL8UHDJYjA1UBW6leGbZmp64YMjI=";
+  };
+
+  minimalOCamlVersion = "4.14";
+
+  doCheck = true;
+  checkInputs = [ qcheck qcheck-alcotest alcotest ];
+
+  meta = with lib; {
+    description = "Variations of the Seq module with monads folded into the type";
+    homepage = "https://gitlab.com/nomadic-labs/seqes";
+    license = licenses.lgpl2; # Same as OCaml
+    maintainers = [ maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sha/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sha/default.nix
new file mode 100644
index 000000000000..c54c143d5b48
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sha/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, ocaml, stdlib-shims, ounit2 }:
+
+buildDunePackage rec {
+  pname = "sha";
+  version = "1.15.4";
+
+  src = fetchurl {
+    url = "https://github.com/djs55/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-beWxITmxmZzp30zHiloxiGwqVHydRIvyhT+LU7zx8bE=";
+  };
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [
+    ounit2
+  ];
+
+  meta = with lib; {
+    description = "Binding for SHA interface code in OCaml";
+    homepage = "https://github.com/djs55/ocaml-sha/";
+    license = licenses.isc;
+    maintainers = with maintainers; [ arthurteisseire ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/default.nix
new file mode 100644
index 000000000000..17dee792007b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppx_cstruct
+, cstruct
+, lwt
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "shared-memory-ring";
+  version = "3.1.1";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/shared-memory-ring/releases/download/v${version}/shared-memory-ring-${version}.tbz";
+    hash = "sha256-KW8grij/OAnFkdUdRRZF21X39DvqayzkTWeRKwF8uoU=";
+  };
+
+  buildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt
+    ounit
+  ];
+
+  meta = with lib; {
+    description = "Shared memory rings for RPC and bytestream communications";
+    license = licenses.isc;
+    homepage = "https://github.com/mirage/shared-memory-ring";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix
new file mode 100644
index 000000000000..dc34be8ed746
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildDunePackage
+, shared-memory-ring
+, ppx_cstruct
+, cstruct
+, lwt
+, lwt-dllist
+, mirage-profile
+, ounit
+}:
+
+buildDunePackage {
+  pname = "shared-memory-ring-lwt";
+
+  inherit (shared-memory-ring) version src;
+
+  duneVersion = "3";
+
+  buildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    shared-memory-ring
+    cstruct
+    lwt
+    lwt-dllist
+    mirage-profile
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    ounit
+  ];
+
+  meta = shared-memory-ring.meta // {
+    description = "Shared memory rings for RPC and bytestream communications using Lwt";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/shine/default.nix b/nixpkgs/pkgs/development/ocaml-modules/shine/default.nix
new file mode 100644
index 000000000000..13d41e72254b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/shine/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, shine }:
+
+buildDunePackage rec {
+  pname = "shine";
+  version = "0.2.3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-shine";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-x/ubqPXT89GWYV9KIyzny0rJDB3TBurLX71i0DlvHLU=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ shine ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-shine";
+    description = "Bindings to the fixed-point mp3 encoding library shine";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/simple-diff/default.nix b/nixpkgs/pkgs/development/ocaml-modules/simple-diff/default.nix
new file mode 100644
index 000000000000..a87026fb4a0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/simple-diff/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, topkg, ocamlbuild, re }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-simple-diff";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "gjaldon";
+    repo = "simple_diff";
+    rev = "v${version}";
+    sha256 = "sha256-OaKECUBCCt9KfdRJf3HcXTUJVxKKdYtnzOHpMPOllrk=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ re ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = "https://github.com/gjaldon/simple_diff";
+    description = "Simple_diff is a pure OCaml diffing algorithm";
+    license = licenses.isc;
+    maintainers = with maintainers; [ ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/slug/default.nix b/nixpkgs/pkgs/development/ocaml-modules/slug/default.nix
new file mode 100644
index 000000000000..2ae81209b549
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/slug/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, re, uunf, uuseg
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "slug";
+  version = "1.0.1";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "thangngoc89";
+    repo = "ocaml-slug";
+    rev = version;
+    sha256 = "sha256-pIk/0asSyibXbwmBSBuLwl2SS9aw6dNDDvwO+1VJGf8=";
+  };
+
+  propagatedBuildInputs = [
+    re
+    uunf
+    uuseg
+  ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Url safe slug generator for OCaml";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.niols ];
+    homepage = "https://github.com/thangngoc89/ocaml-slug";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix
new file mode 100644
index 000000000000..87fb82adcbeb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "sodium is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-sodium";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner  = "dsheets";
+    repo   = "ocaml-sodium";
+    rev    = version;
+    sha256 = "124gpi1jhac46x05gp5viykyrafnlp03v1cmkl13c6pgcs8w04pv";
+  };
+
+  patches = [
+    # ctypes.stubs no longer pulls in bigarray automatically
+    ./lib-gen-link-bigarray.patch
+  ];
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ ctypes libsodium ];
+
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow";
+
+  meta = with lib; {
+    homepage = "https://github.com/dsheets/ocaml-sodium";
+    description = "Binding to libsodium 1.0.9+";
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.rixed ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch b/nixpkgs/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch
new file mode 100644
index 000000000000..f05f53320975
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch
@@ -0,0 +1,7 @@
+diff --git a/lib_gen/_tags b/lib_gen/_tags
+index 7a7e632..7a4e0b7 100644
+--- a/lib_gen/_tags
++++ b/lib_gen/_tags
+@@ -1 +1 @@
+-<*.{ml,byte,native}>: package(ctypes.stubs)
++<*.{ml,byte,native}>: package(ctypes.stubs), package(bigarray)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix
new file mode 100644
index 000000000000..1ef11e363ff8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix
@@ -0,0 +1,42 @@
+{ lib, fetchFromGitHub, stdenv
+, findlib, ocaml, ocamlbuild
+}:
+
+lib.throwIf (lib.versionOlder ocaml.version "4.02")
+  "sosa is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-sosa";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = "sosa";
+    rev = "sosa.${version}";
+    sha256 = "053hdv6ww0q4mivajj4iyp7krfvgq8zajq9d8x4mia4lid7j0dyk";
+  };
+
+  postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "4.07") ''
+    for p in functors list_of of_mutable
+    do
+      substituteInPlace src/lib/$p.ml --replace Pervasives. Stdlib.
+    done
+  '';
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+
+  strictDeps = true;
+
+  buildPhase = "make build";
+
+  createFindlibDestdir = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "http://www.hammerlab.org/docs/sosa/master/index.html";
+    description = "Sane OCaml String API";
+    license = licenses.isc;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/soundtouch/default.nix b/nixpkgs/pkgs/development/ocaml-modules/soundtouch/default.nix
new file mode 100644
index 000000000000..fc79664d06bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/soundtouch/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, soundtouch }:
+
+buildDunePackage rec {
+  pname = "soundtouch";
+  version = "0.1.9";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-soundtouch";
+    rev = "v${version}";
+    sha256 = "sha256-81Mhk4PZx4jGrVIevzMslvVbKzipzDzHWnbtOjeZCI8=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ soundtouch ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-soundtouch";
+    description = "Bindings for the soundtouch library which provides functions for changing pitch and timestretching audio data";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff b/nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff
new file mode 100644
index 000000000000..baad34ce08b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff
@@ -0,0 +1,14 @@
+diff --git a/src/elf_locations.ml b/src/elf_locations.ml
+index a08b359..0db9274 100644
+--- a/src/elf_locations.ml
++++ b/src/elf_locations.ml
+@@ -37,7 +37,8 @@ let resolve_from_dwarf t ~program_counter =
+     | Some section ->
+       let body = Owee_buf.cursor (Owee_elf.section_body t.map section) in
+       let rec aux () =
+-        match Owee_debug_line.read_chunk body with
++        let pointers_to_other_sections = Owee_elf.debug_line_pointers t.map t.sections in
++        match Owee_debug_line.read_chunk body ~pointers_to_other_sections with
+         | None -> ()
+         | Some (header, chunk) ->
+           (* CR-soon mshinwell: fix owee .mli to note that [state] is
diff --git a/nixpkgs/pkgs/development/ocaml-modules/speex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/speex/default.nix
new file mode 100644
index 000000000000..1bf5f308ecf2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/speex/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, speex }:
+
+buildDunePackage rec {
+  pname = "speex";
+  version = "0.4.1";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-speex";
+    rev = "v${version}";
+    sha256 = "0p4ip37kihlz9qy604llak2kzd00g45ix1yiihnrri2nm01scfab";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ogg speex.dev ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-speex";
+    description = "Bindings to libspeex";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix b/nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix
new file mode 100644
index 000000000000..076cc5cc3a45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, seq
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "spelll";
+  version = "0.4";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-nI8fdArYynR70PUJIgyogGBCe4gFhfVzuRdZzFGKqOc=";
+  };
+
+  propagatedBuildInputs = [ seq stdlib-shims ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Fuzzy string searching, using Levenshtein automaton";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/spices/default.nix b/nixpkgs/pkgs/development/ocaml-modules/spices/default.nix
new file mode 100644
index 000000000000..a1d6b06d156b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/spices/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, colors
+, tty
+}:
+
+buildDunePackage rec {
+  pname = "spices";
+  version = "0.0.2";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/minttea/releases/download/${version}/minttea-${version}.tbz";
+    hash = "sha256-0eB7OuxcPdv9bf2aIQEeir44mQfx5W2AJj7Vb4pGtLI=";
+  };
+
+  propagatedBuildInputs = [
+    colors
+    tty
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Declarative styles for TUI applications";
+    homepage = "https://github.com/leostera/minttea";
+    changelog = "https://github.com/leostera/minttea/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix
new file mode 100644
index 000000000000..cfd03493d3af
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, sqlite, pkg-config, buildDunePackage, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "sqlite3";
+  version = "5.1.0";
+  duneVersion = "3";
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/sqlite3-ocaml/releases/download/${version}/sqlite3-${version}.tbz";
+    hash = "sha256-uw23EWkajfok/insTstpEkRK2Q4PTER6+Jgx5tHf/qU=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator sqlite ];
+
+  meta = with lib; {
+    homepage = "http://mmottl.github.io/sqlite3-ocaml/";
+    description = "OCaml bindings to the SQLite 3 database access library";
+    license = licenses.mit;
+    maintainers = with maintainers; [
+      maggesi vbgl
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/srt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/srt/default.nix
new file mode 100644
index 000000000000..d1e5ecd9ad55
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/srt/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, dune-configurator
+, posix-socket
+, srt
+, ctypes-foreign
+}:
+
+buildDunePackage rec {
+  pname = "srt";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-srt";
+    rev = "v${version}";
+    sha256 = "sha256-iD18bCbouBuMpuSzruDZJoYz2YyN080RK8BavUF3beY=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ctypes-foreign posix-socket srt ];
+
+  meta = with lib; {
+    description = "OCaml bindings for the libsrt library";
+    license = lib.licenses.gpl2Only;
+    inherit (src.meta) homepage;
+    maintainers = with maintainers; [ vbgl dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix
new file mode 100644
index 000000000000..329dd01f02ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix
@@ -0,0 +1,41 @@
+{ alcotest
+, buildDunePackage
+, dune-configurator
+, fetchFromGitHub
+, lib
+, ocaml
+, openssl
+, pkg-config
+}:
+
+buildDunePackage rec {
+  pname = "ssl";
+  version = "0.7.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ssl";
+    rev = "v${version}";
+    hash = "sha256-gi80iwlKaI4TdAVnCyPG03qRWFa19DHdTrA0KMFBAc4=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ openssl ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ alcotest ];
+  preCheck = ''
+    mkdir -p _build/default/tests/
+    cp tests/digicert_certificate.pem _build/default/tests/
+  '';
+
+  meta = {
+    homepage = "http://savonet.rastageeks.org/";
+    description = "OCaml bindings for libssl ";
+    license = "LGPL+link exception";
+    maintainers = with lib.maintainers; [ anmonteiro dandellion maggesi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix
new file mode 100644
index 000000000000..23eeca421f5e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix
@@ -0,0 +1,27 @@
+{ buildDunePackage
+, ocaml
+, lib
+, fetchurl
+}:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.2")
+  "stdcompat is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "stdcompat";
+  version = "19";
+
+  src = fetchurl {
+    url = "https://github.com/thierry-martinez/stdcompat/releases/download/v${version}/stdcompat-${version}.tar.gz";
+    sha256 = "sha256-DKQGd4nnIN6SPls6hcA/2Jvc7ivYNpeMU6rYsVc1ClU=";
+  };
+
+  # Otherwise ./configure script will run and create files conflicting with dune.
+  dontConfigure = true;
+
+  meta = {
+    homepage = "https://github.com/thierry-martinez/stdcompat";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix
new file mode 100644
index 000000000000..cec0ec818300
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix
@@ -0,0 +1,37 @@
+{ lib, fetchurl, buildDunePackage, ocaml, qcheck }:
+
+buildDunePackage rec {
+  pname = "stdint";
+  version = "0.7.2";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
+    sha256 = "sha256-FWAZjYvJx68+qVLEDavoJmZpQhDsw/35u/60MhHpd+Y=";
+  };
+
+  # 1. disable remaining broken tests, see
+  #    https://github.com/andrenth/ocaml-stdint/issues/59
+  # 2. fix tests to liberal test range
+  #    https://github.com/andrenth/ocaml-stdint/pull/61
+  postPatch = ''
+    substituteInPlace tests/stdint_test.ml \
+      --replace 'test "An integer should perform left-shifts correctly"' \
+                'skip "An integer should perform left-shifts correctly"' \
+      --replace 'test "Logical shifts must not sign-extend"' \
+                'skip "Logical shifts must not sign-extend"'
+  '';
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ qcheck ];
+
+  meta = {
+    description = "Various signed and unsigned integers for OCaml";
+    homepage = "https://github.com/andrenth/ocaml-stdint";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix
new file mode 100644
index 000000000000..45c8bb2e4a1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, lib, fetchurl, ocaml }:
+
+buildDunePackage rec {
+  pname = "stdlib-shims";
+  version = "0.3.0";
+  src = fetchurl {
+    url = "https://github.com/ocaml/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "0jnqsv6pqp5b5g7lcjwgd75zqqvcwcl5a32zi03zg1kvj79p5gxs";
+  };
+  doCheck = true;
+  meta = {
+    description = "Shims for forward-compatibility between versions of the OCaml standard library";
+    homepage = "https://github.com/ocaml/stdlib-shims";
+    inherit (ocaml.meta) license;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/stdune/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stdune/default.nix
new file mode 100644
index 000000000000..5e0b798772de
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdune/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, dune_3, dyn, ordering, csexp }:
+
+buildDunePackage {
+  pname = "stdune";
+  inherit (dune_3) version src;
+  duneVersion = "3";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dyn ordering csexp ];
+
+  preBuild = ''
+    rm -r vendor/csexp
+  '';
+
+  meta = dune_3.meta // {
+    description = "Dune's unstable standard library";
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/streaming/default.nix b/nixpkgs/pkgs/development/ocaml-modules/streaming/default.nix
new file mode 100644
index 000000000000..f2a8c883f724
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/streaming/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "streaming";
+  version = "0.8.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/odis-labs/streaming/releases/download/${version}/streaming-${version}.tbz";
+    hash = "sha256-W+3GYZpsLj1SnQhuSmjXdi/85fMajWpz4b7x5W0bnJs=";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  meta = {
+    homepage = "https://odis-labs.github.io/streaming";
+    license = lib.licenses.isc;
+    description = "Fast, safe and composable streaming abstractions";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix
new file mode 100644
index 000000000000..32d801f971fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, ocaml, buildDunePackage, ounit, qtest
+# Optionally enable tests; test script use OCaml-4.01+ features
+, doCheck ? lib.versionAtLeast ocaml.version "4.08"
+}:
+
+let version = "1.6.0"; in
+
+buildDunePackage {
+  pname = "stringext";
+  version = version;
+  duneVersion = "3";
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/stringext/releases/download/${version}/stringext-${version}.tbz";
+    sha256 = "1sh6nafi3i9773j5mlwwz3kxfzdjzsfqj2qibxhigawy5vazahfv";
+  };
+
+  checkInputs = [ ounit qtest ];
+  inherit doCheck;
+
+  meta = {
+    homepage = "https://github.com/rgrinberg/stringext";
+    description = "Extra string functions for OCaml";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix b/nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix
new file mode 100644
index 000000000000..e33194809526
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, fetchurl
+, astring, ptime, rresult, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "syslog-message";
+  version = "1.2.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/verbosemode/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    hash = "sha256-+eyiv6JvC0EKs3G1s5qoFtK0bU4Yg41AHg5Nc6xD9w0=";
+  };
+
+  propagatedBuildInputs = [
+    ptime
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    qcheck
+  ];
+
+  meta = with lib; {
+    description = "Syslog message parser";
+    homepage = "https://github.com/verbosemode/syslog-message";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix b/nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix
new file mode 100644
index 000000000000..ad9204847e10
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "syslog";
+  version = "2.0.2";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "geneanet";
+    repo = "ocaml-syslog";
+    rev = "v${version}";
+    hash = "sha256-WybNZBPhv4fhjzzb95E+6ZHcZUnfROLlNF3PMBGO9ys=";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/geneanet/ocaml-syslog";
+    description = "Simple wrapper to access the system logger from OCaml";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.rixed ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/taglib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/taglib/default.nix
new file mode 100644
index 000000000000..95b5ae04578f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/taglib/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, taglib, zlib }:
+
+buildDunePackage rec {
+  pname = "taglib";
+  version = "0.3.10";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-taglib";
+    rev = "v${version}";
+    sha256 = "sha256-tAvzVr0PW1o0kKFxdi/ks4obqnyBm8YfiiFupXZkUho=";
+  };
+
+  minimalOCamlVersion = "4.05.0"; # Documented version 4.02.0. 4.05.0 actually required.
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ taglib zlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-taglib";
+    description = "Bindings for the taglib library which provides functions for reading tags in headers of audio files";
+    license = with licenses; [ lgpl21Plus "link-exception" ]; # GNU Library Public License 2 Linking Exception
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tar/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tar/default.nix
new file mode 100644
index 000000000000..f0d8876fd41e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tar/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, camlp-streams
+, cstruct
+, decompress
+}:
+
+buildDunePackage rec {
+  pname = "tar";
+  version = "2.6.0";
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-tar/releases/download/v${version}/tar-${version}.tbz";
+    hash = "sha256-yv8MtwRjQ+K/9/wPkhfk4xI1VV5MSIn7GUeSmFtvse4=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    camlp-streams
+    cstruct
+    decompress
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Decode and encode tar format files in pure OCaml";
+    homepage = "https://github.com/mirage/ocaml-tar";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tar/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/tar/unix.nix
new file mode 100644
index 000000000000..92b5a9237f5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tar/unix.nix
@@ -0,0 +1,26 @@
+{ lib
+, buildDunePackage
+, tar
+, cstruct-lwt
+, lwt
+, git
+}:
+
+buildDunePackage rec {
+  pname = "tar-unix";
+  inherit (tar) version src doCheck;
+
+  propagatedBuildInputs = [
+    tar
+    cstruct-lwt
+    lwt
+  ];
+
+  nativeCheckInputs = [
+    git
+  ];
+
+  meta = tar.meta // {
+    description = "Decode and encode tar format files from Unix";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix
new file mode 100644
index 000000000000..1f86d7ef5bfb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix
@@ -0,0 +1,69 @@
+{ lib, buildDunePackage, fetchurl
+, pkg-config
+, cstruct, cstruct-lwt, mirage-net, mirage-clock
+, mirage-random, mirage-time
+, macaddr, macaddr-cstruct, fmt
+, lwt, lwt-dllist, logs, duration, randomconv, ethernet
+, alcotest, mirage-flow, mirage-vnetif, pcap-format
+, mirage-clock-unix, arp, ipaddr-cstruct, mirage-random-test
+, lru, metrics
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  pname = "tcpip";
+  version = "8.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-NrTBVr4WcCukxteBotqLoUYrIjcNFVcOERYFbL8CUjM=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+    cstruct-lwt
+    mirage-net
+    mirage-clock
+    mirage-random
+    mirage-time
+    ipaddr-cstruct
+    macaddr
+    macaddr-cstruct
+    fmt
+    lwt
+    lwt-dllist
+    logs
+    duration
+    randomconv
+    ethernet
+    lru
+    metrics
+    arp
+    mirage-flow
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    mirage-random-test
+    mirage-flow
+    mirage-vnetif
+    pcap-format
+    mirage-clock-unix
+  ];
+  __darwinAllowLocalNetworking = true;
+
+  meta = with lib; {
+    description = "OCaml TCP/IP networking stack, used in MirageOS";
+    homepage = "https://github.com/mirage/mirage-tcpip";
+    maintainers = [ maintainers.sternenseemann ];
+    license = licenses.isc;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix
new file mode 100644
index 000000000000..1feff4e0a39b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, ocamlPackages, buildOasisPackage, extlib, num }:
+
+buildOasisPackage rec {
+  pname = "tcslib";
+  version = "0.3";
+
+  minimumOCamlVersion = "4.03.0";
+
+  src = fetchFromGitHub {
+    owner  = "tcsprojects";
+    repo   = "tcslib";
+    rev    = "v${version}";
+    sha256 = "05g6m82blsccq8wx8knxv6a5fzww7hi624jx91f9h87nk2fsplhi";
+  };
+
+  propagatedBuildInputs = [ extlib num ];
+
+  meta = {
+    homepage = "https://github.com/tcsprojects/tcslib";
+    description = "Multi-purpose library for OCaml";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tdigest/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tdigest/default.nix
new file mode 100644
index 000000000000..4dc40da9dac6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tdigest/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitHub, nix-update-script
+, buildDunePackage
+, core
+}:
+
+buildDunePackage rec {
+  pname = "tdigest";
+  version = "2.1.2";
+
+  src = fetchFromGitHub {
+    owner = "SGrondin";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-pkJRJeEbBbAR1STb6v3Zu11twvHkAKAO0YjifRBFTDw=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    core
+  ];
+
+  passthru.updateScript = nix-update-script { };
+
+  meta = with lib; {
+    homepage = "https://github.com/SGrondin/${pname}";
+    description = "OCaml implementation of the T-Digest algorithm";
+    license = licenses.mit;
+    maintainers = with maintainers; [ niols ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/telegraml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/telegraml/default.nix
new file mode 100644
index 000000000000..ed0dc49fa9e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/telegraml/default.nix
@@ -0,0 +1,38 @@
+{ batteries
+, buildDunePackage
+, cohttp-lwt-unix
+, fetchFromGitHub
+, lib
+, logs
+, yojson
+}:
+
+buildDunePackage rec {
+  pname = "telegraml";
+  version = "unstable-2021-06-17";
+
+  src = fetchFromGitHub {
+    owner = "nv-vn";
+    repo = "TelegraML";
+    rev = "3e28933a287e5eacd34c46b434c487f155397abc";
+    sha256 = "sha256-2bMHARatwl8Zl/fWppvwbH6Ut+igJVKzwyQb8Q4gem4=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace batteries batteries.unthreaded
+  '';
+
+  propagatedBuildInputs = [
+    batteries
+    cohttp-lwt-unix
+    logs
+    yojson
+  ];
+
+  meta = with lib; {
+    description = "OCaml library implementing the Telegram bot API";
+    homepage = "https://github.com/nv-vn/TelegraML/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/telemetry/default.nix b/nixpkgs/pkgs/development/ocaml-modules/telemetry/default.nix
new file mode 100644
index 000000000000..d1a57745cefb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/telemetry/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "telemetry";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/telemetry/releases/download/${version}/telemetry-${version}.tbz";
+    hash = "sha256-YEf7zC/F2zJBtQNfyJ2OznKmoFo1Ms9O2WgiOFkhp28=";
+  };
+
+  doCheck = true;
+
+  meta = {
+    description = "Lightweight library for dispatching and handling events, with a focus on metrics and instrumentation";
+    homepage = "https://github.com/leostera/telemetry";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/terminal/default.nix b/nixpkgs/pkgs/development/ocaml-modules/terminal/default.nix
new file mode 100644
index 000000000000..8daf53abdb50
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/terminal/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl, ocaml
+, stdlib-shims, uutf, uucp
+, alcotest, fmt
+}:
+
+buildDunePackage rec {
+  pname = "terminal";
+  version = "0.2.2";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/CraigFe/progress/releases/download/${version}/progress-${version}.tbz";
+    hash = "sha256-M0HCGSOiHNa1tc+p7DmB9ZVyw2eUD+XgJFBTPftBELU=";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims uutf uucp ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+  checkInputs = [ alcotest fmt ];
+
+  meta = with lib; {
+    description = "Basic utilities for interacting with terminals";
+    homepage = "https://github.com/CraigFe/progress";
+    license = licenses.mit;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix b/nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix
new file mode 100644
index 000000000000..228a6f222efc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, ocaml, fetchurl, alcotest }:
+
+buildDunePackage rec {
+  pname = "terminal_size";
+  version = "0.2.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/cryptosense/terminal_size/releases/download/v${version}/terminal_size-${version}.tbz";
+    hash = "sha256-1rYs0oxAcayFypUoCIdFwSTJCU7+rpFyJRRzb5lzsPs=";
+  };
+
+  checkInputs = [ alcotest ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = with lib; {
+    description = "Get the dimensions of the terminal";
+    homepage = "https://github.com/cryptosense/terminal_size";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos-base58/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos-base58/default.nix
new file mode 100644
index 000000000000..1ed04a082d5b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos-base58/default.nix
@@ -0,0 +1,28 @@
+{ buildDunePackage, fetchurl, lib
+, zarith, digestif, fmt
+}:
+
+buildDunePackage rec {
+  pname = "tezos-base58";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/tarides/tezos-base58/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "14w2pff5dy6mxnz588pxaf2k8xpkd51sbsys065wr51kbv1f36da";
+  };
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  propagatedBuildInputs = [
+    zarith digestif fmt
+  ];
+
+  meta = with lib; {
+    description = "Base58 encoding for Tezos";
+    homepage = "https://github.com/tarides/tezos-base58/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ bezmuth ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tezt/default.nix
new file mode 100644
index 000000000000..afad07e77917
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezt/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, clap
+, ezjsonm
+, lwt
+, re
+}:
+
+buildDunePackage rec {
+  pname = "tezt";
+  version = "4.0.0";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = pname;
+    rev = version;
+    hash = "sha256-waFjE/yR+XAJOew1YsCnbvsJR8oe9gflyVj4yXAvNuM=";
+  };
+
+  propagatedBuildInputs = [
+    clap
+    ezjsonm
+    lwt
+    re
+  ];
+
+  meta = {
+    description = "Test framework for unit tests, integration tests, and regression tests";
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/theora/default.nix b/nixpkgs/pkgs/development/ocaml-modules/theora/default.nix
new file mode 100644
index 000000000000..6849056d2ded
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/theora/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, libtheora }:
+
+buildDunePackage rec {
+  pname = "theora";
+  version = "0.4.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-theora";
+    rev = "v${version}";
+    hash = "sha256-VN1XYqxMCO0W9tMTqSAwWKv7GErTtRZgnC2SnmmV7+k=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ogg libtheora ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-theora";
+    description = "Bindings to libtheora";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/thread-table/default.nix b/nixpkgs/pkgs/development/ocaml-modules/thread-table/default.nix
new file mode 100644
index 000000000000..155bca397ee6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/thread-table/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, alcotest
+, mdx
+}:
+
+buildDunePackage rec {
+  pname = "thread-table";
+  version = "1.0.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "pIzYhGNZfflELEuqaczAYJHKd7px5DjTYJ+64PO4Hd0=";
+  };
+
+  doCheck = true;
+
+  checkInputs = [
+    alcotest
+    mdx
+  ];
+
+  nativeCheckInputs = [
+    mdx.bin
+  ];
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/ocaml-${pname}";
+    changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/${version}/CHANGES.md";
+    description = "Lock-free thread-safe integer keyed hash table";
+    license = with lib.licenses; [ isc ];
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/timed/default.nix b/nixpkgs/pkgs/development/ocaml-modules/timed/default.nix
new file mode 100644
index 000000000000..988cb3f5487f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/timed/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, fetchFromGitHub
+, ocaml
+, buildDunePackage
+}:
+
+buildDunePackage rec {
+  version = "1.1";
+  pname = "timed";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "rlepigre";
+    repo = "ocaml-${pname}";
+    rev = version;
+    sha256 = "sha256-wUoI9j/j0IGYW2NfJHmyR2XEYfYejyoYLWnKsuWdFas=";
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Timed references for imperative state";
+    homepage = "https://github.com/rlepigre/ocaml-timed";
+    license = licenses.mit;
+    maintainers = with maintainers; [ bcdarwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/timedesc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/timedesc/default.nix
new file mode 100644
index 000000000000..b77f5af17b40
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/timedesc/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, angstrom
+, ptime
+, seq
+, timedesc-tzdb
+, timedesc-tzlocal
+}:
+
+buildDunePackage rec {
+  pname = "timedesc";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/daypack-dev/timere/releases/download/timedesc-${version}/timedesc-${version}.tar.gz";
+    hash = "sha256-NnnQpWOE1mt/F5lkWRPdDwpqXCUlcNi+Z5GE6YQQLK8=";
+  };
+
+  sourceRoot = ".";
+
+  propagatedBuildInputs = [
+    angstrom
+    ptime
+    seq
+    timedesc-tzdb
+    timedesc-tzlocal
+  ];
+
+  meta = {
+    description = "OCaml date time handling library";
+    homepage = "https://github.com/daypack-dev/timere";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzdb.nix b/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzdb.nix
new file mode 100644
index 000000000000..95fab02d11a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzdb.nix
@@ -0,0 +1,15 @@
+{ lib
+, buildDunePackage
+, timedesc
+}:
+
+buildDunePackage {
+  pname = "timedesc-tzdb";
+
+  inherit (timedesc) version src sourceRoot;
+
+  meta = timedesc.meta // {
+    description = "Virtual library for Timedesc time zone database backends";
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzlocal.nix b/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzlocal.nix
new file mode 100644
index 000000000000..6dcbfd741075
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/timedesc/tzlocal.nix
@@ -0,0 +1,16 @@
+{ lib
+, buildDunePackage
+, timedesc
+}:
+
+buildDunePackage {
+  pname = "timedesc-tzlocal";
+
+  inherit (timedesc) version src sourceRoot;
+
+  minimalOCamlVersion = "4.08";
+
+  meta = timedesc.meta // {
+    description = "Virtual library for Timedesc local time zone detection backends";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tiny_httpd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tiny_httpd/default.nix
new file mode 100644
index 000000000000..2e8e537cba80
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tiny_httpd/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, result
+, seq
+}:
+
+buildDunePackage rec {
+  pname = "tiny_httpd";
+  version = "0.16";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-9L4WCduQNj5Jd/u3SozuXiGTkgojwfGIP5KgQmnWgQw=";
+  };
+
+  buildInputs = [ result ];
+  propagatedBuildInputs = [ seq ];
+
+  meta = {
+    description = "Minimal HTTP server using good old threads";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "http_of_dir";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tls/async.nix b/nixpkgs/pkgs/development/ocaml-modules/tls/async.nix
new file mode 100644
index 000000000000..d4bdb84d685d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/async.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, tls, async, cstruct-async, core, cstruct, mirage-crypto-rng-async }:
+
+buildDunePackage rec {
+  pname = "tls-async";
+
+  inherit (tls) src version;
+
+  minimalOCamlVersion = "4.14";
+
+  doCheck = true;
+
+  propagatedBuildInputs = [
+    async
+    core
+    cstruct
+    cstruct-async
+    mirage-crypto-rng-async
+    tls
+  ];
+
+  meta = tls.meta // {
+    description = "Transport Layer Security purely in OCaml, Async layer";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tls/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tls/default.nix
new file mode 100644
index 000000000000..032b080bebd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/default.nix
@@ -0,0 +1,48 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, domain-name, fmt, logs, hkdf, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, mirage-crypto-rng, lwt, ptime, x509
+, ipaddr
+, alcotest, cstruct-unix, ounit2, randomconv
+}:
+
+buildDunePackage rec {
+  pname = "tls";
+  version = "0.17.3";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-tls/releases/download/v${version}/tls-${version}.tbz";
+    hash = "sha256-R+XezdMO0cNnc2RYpjrgd0dBR7PdZ1wUWQuBqS1QMdQ=";
+  };
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    cstruct
+    domain-name
+    fmt
+    logs
+    hkdf
+    mirage-crypto
+    mirage-crypto-ec
+    mirage-crypto-pk
+    mirage-crypto-rng
+    lwt
+    ptime
+    x509
+    ipaddr
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    cstruct-unix
+    ounit2
+    randomconv
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mirleft/ocaml-tls";
+    description = "TLS in pure OCaml";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tls/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/tls/lwt.nix
new file mode 100644
index 000000000000..d7db822182d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/lwt.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, tls, lwt, mirage-crypto-rng-lwt, cmdliner, x509 }:
+
+buildDunePackage rec {
+  pname = "tls-lwt";
+
+  inherit (tls) src meta version;
+
+  minimalOCamlVersion = "4.11";
+
+  doCheck = true;
+
+  propagatedBuildInputs = [
+    lwt
+    mirage-crypto-rng-lwt
+    tls
+    x509
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tls/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/tls/mirage.nix
new file mode 100644
index 000000000000..a8add9e6ea6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/mirage.nix
@@ -0,0 +1,26 @@
+{ buildDunePackage, tls
+, fmt, lwt, mirage-clock, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, mirage-flow, mirage-kv, ptime, x509
+}:
+
+buildDunePackage {
+  pname = "tls-mirage";
+  inherit (tls) src version;
+
+  propagatedBuildInputs = [
+    fmt
+    lwt
+    mirage-clock
+    mirage-crypto
+    mirage-crypto-ec
+    mirage-crypto-pk
+    mirage-flow
+    mirage-kv
+    ptime
+    tls
+    x509
+  ];
+
+  meta = tls.meta // {
+    description = "Transport Layer Security purely in OCaml, MirageOS layer";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/toml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/toml/default.nix
new file mode 100644
index 000000000000..baab042b1bf4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/toml/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, iso8601, menhir
+}:
+
+buildDunePackage rec {
+  pname = "toml";
+  version = "7.1.0";
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-toml";
+    repo = "to.ml";
+    rev = version;
+    hash = "sha256-uk14Py7lEEDJhFsRRtStXqKlJLtx0o8eS9DEIes4SHw=";
+  };
+
+  nativeBuildInputs = [ menhir ];
+  propagatedBuildInputs = [ iso8601 ];
+
+  meta = {
+    description = "Implementation in OCaml of the Toml minimal langage";
+    homepage = "http://ocaml-toml.github.io/To.ml";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix
new file mode 100644
index 000000000000..e0dbc77eafd9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix
@@ -0,0 +1,59 @@
+/* Topkg is a packager for distributing OCaml software. This derivation
+provides facilities to describe derivations for OCaml libraries
+using topkg.
+The `buildPhase` and `installPhase` attributes can be reused directly
+in many cases. When more fine-grained control on how to run the “topkg”
+build system is required, the attribute `run` can be used.
+*/
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, result, opaline }:
+
+let
+  param =
+  if lib.versionAtLeast ocaml.version "4.05" then {
+    version = "1.0.7";
+    sha256 = "sha256-X8Iq0/OtbRJ8sSRdGFgIgUeNotbeULIxXm3UWGxSvhk=";
+  } else if lib.versionAtLeast ocaml.version "4.03" then {
+    version = "1.0.3";
+    sha256 = "0b77gsz9bqby8v77kfi4lans47x9p2lmzanzwins5r29maphb8y6";
+  } else {
+    version = "1.0.0";
+    sha256 = "1df61vw6v5bg2mys045682ggv058yqkqb67w7r2gz85crs04d5fw";
+    propagatedBuildInputs = [ result ];
+  };
+
+/* This command allows to run the “topkg” build system.
+ * It is usually called with `build` or `test` as argument.
+ * Packages that use `topkg` may call this command as part of
+ *  their `buildPhase` or `checkPhase`.
+*/
+  run = "ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml";
+in
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-topkg";
+  inherit (param) version;
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/topkg/releases/topkg-${version}.tbz";
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = param.propagatedBuildInputs or [];
+
+  strictDeps = true;
+
+  buildPhase = "${run} build";
+  createFindlibDestdir = true;
+  installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
+
+  passthru = { inherit run; };
+
+  meta = {
+    homepage = "https://erratique.ch/software/topkg";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    description = "Packager for distributing OCaml software";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/torch/default.nix b/nixpkgs/pkgs/development/ocaml-modules/torch/default.nix
new file mode 100644
index 000000000000..f24a4fe96819
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/torch/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, stdenv
+, buildDunePackage
+, fetchFromGitHub
+, fetchpatch
+, cmdliner
+, ctypes
+, ctypes-foreign
+, dune-configurator
+, npy
+, ocaml-compiler-libs
+, ppx_custom_printf
+, ppx_expect
+, ppx_sexp_conv
+, sexplib
+, stdio
+, torch
+}:
+
+buildDunePackage rec {
+  pname = "torch";
+  version = "0.17";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "LaurentMazare";
+    repo = "ocaml-${pname}";
+    rev = version;
+    hash = "sha256-z/9NUBjeFWE63Z/e8OyzDiy8hrn6qzjaiBH8G9MPeos=";
+  };
+
+  patches = [
+    # Pytorch 2.0 support. Drop when it reaches a release
+    (fetchpatch {
+      url = "https://github.com/LaurentMazare/ocaml-torch/commit/ef7ef30cafecb09e45ec1ed8ce4bedae5947cfa5.patch";
+      hash = "sha256-smdwKy40iIISp/25L2J4az6KmqFS1soeChBElUyhl5A=";
+    })
+  ];
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [
+    cmdliner
+    ctypes
+    ctypes-foreign
+    npy
+    ocaml-compiler-libs
+    ppx_custom_printf
+    ppx_expect
+    ppx_sexp_conv
+    sexplib
+    stdio
+    torch
+    torch.dev
+  ];
+
+  preBuild = "export LIBTORCH=${torch.dev}/";
+
+  doCheck = !stdenv.isAarch64;
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Ocaml bindings to Pytorch";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.asl20;
+    broken = true; # Not compatible with libtorch ≥ 2.3.0
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/trace/default.nix b/nixpkgs/pkgs/development/ocaml-modules/trace/default.nix
new file mode 100644
index 000000000000..2c7356669860
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/trace/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "trace";
+  version = "0.5";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/c-cube/ocaml-trace/releases/download/v${version}/trace-${version}.tbz";
+    hash = "sha256-l0NvWPGBd1WR+b50WXEYfptuCUjda8MlZ/o5YngRNIg=";
+  };
+
+  meta = {
+    description = "Common interface for tracing/instrumentation libraries in OCaml";
+    license = lib.licenses.mit;
+    homepage = "https://c-cube.github.io/ocaml-trace/";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/trace/tef.nix b/nixpkgs/pkgs/development/ocaml-modules/trace/tef.nix
new file mode 100644
index 000000000000..618009d11fa7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/trace/tef.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage, trace, mtime }:
+
+buildDunePackage {
+  pname = "trace-tef";
+  inherit (trace) src version;
+
+  # This removes the dependency on the “atomic” package
+  # (not available in nixpkgs)
+  # Said package for OCaml ≥ 4.12 is empty
+  postPatch = ''
+    substituteInPlace src/tef/dune --replace 'atomic ' ""
+  '';
+
+  minimalOCamlVersion = "4.12";
+
+  propagatedBuildInputs = [ mtime trace ];
+
+  doCheck = true;
+
+  meta = trace.meta // {
+    description = "Simple backend for trace, emitting Catapult JSON into a file";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/trie/default.nix b/nixpkgs/pkgs/development/ocaml-modules/trie/default.nix
new file mode 100644
index 000000000000..935f71a5e224
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/trie/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "trie";
+  version = "1.0.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "kandu";
+    repo = pname;
+    rev = version;
+    sha256 = "0s7p9swjqjsqddylmgid6cv263ggq7pmb734z4k84yfcrgb6kg4g";
+  };
+
+  meta = {
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    description = "Strict impure trie tree";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tsdl-image/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsdl-image/default.nix
new file mode 100644
index 000000000000..008822459cc1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsdl-image/default.nix
@@ -0,0 +1,39 @@
+{ buildDunePackage
+, dune-configurator
+, fetchFromGitHub
+, lib
+, SDL2
+, SDL2_image
+, tsdl
+}:
+
+buildDunePackage rec {
+  pname = "tsdl-image";
+  version = "0.6";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "sanette";
+    repo = pname;
+    rev = version;
+    hash = "sha256-mgTFwkuFJVwJmHrzHSdNh8v4ehZIcWemK+eLqjglw5o=";
+  };
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    SDL2
+    SDL2_image
+    tsdl
+  ];
+
+  meta = with lib; {
+    description = "OCaml SDL2_image bindings to go with Tsdl";
+    homepage = "https://github.com/sanette/tsdl-image";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tsdl-mixer/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsdl-mixer/default.nix
new file mode 100644
index 000000000000..d2721c5398e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsdl-mixer/default.nix
@@ -0,0 +1,39 @@
+{ buildDunePackage
+, dune-configurator
+, fetchFromGitHub
+, lib
+, SDL2
+, SDL2_mixer
+, tsdl
+}:
+
+buildDunePackage rec {
+  pname = "tsdl-mixer";
+  version = "0.5";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "sanette";
+    repo = pname;
+    rev = version;
+    hash = "sha256-HGtO5iO3lxuVa707MDIhw0pgDZLHt9qY+Rd24sFkags=";
+  };
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    SDL2
+    SDL2_mixer
+    tsdl
+  ];
+
+  meta = with lib; {
+    description = "SDL2_mixer bindings to go with Tsdl";
+    homepage = "https://github.com/sanette/tsdl-mixer";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tsdl-ttf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsdl-ttf/default.nix
new file mode 100644
index 000000000000..086b0789a6a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsdl-ttf/default.nix
@@ -0,0 +1,39 @@
+{ buildDunePackage
+, dune-configurator
+, fetchFromGitHub
+, lib
+, SDL2
+, SDL2_ttf
+, tsdl
+}:
+
+buildDunePackage rec {
+  pname = "tsdl-ttf";
+  version = "0.6";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "sanette";
+    repo = pname;
+    rev = version;
+    hash = "sha256-1MGbsekaBoCz4vAwg+Dfzsl0xUKgs8dUEr+OpLopnig=";
+  };
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    SDL2
+    SDL2_ttf
+    tsdl
+  ];
+
+  meta = with lib; {
+    description = "SDL2_ttf bindings for Ocaml with Tsdl";
+    homepage = "https://github.com/sanette/tsdl-ttf";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix
new file mode 100644
index 000000000000..2d35f76d5bf0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, ctypes-foreign, result, SDL2, pkg-config
+, AudioToolbox, Cocoa, CoreAudio, CoreVideo, ForceFeedback }:
+
+if lib.versionOlder ocaml.version "4.03"
+then throw "tsdl is not available for OCaml ${ocaml.version}"
+else
+
+let
+  pname = "tsdl";
+  version = "1.0.0";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-${pname}";
+  inherit version;
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    hash = "sha256-XdgzCj9Uqplt/8Jk8rSFaQf8zu+9SZa8b9ZIlW/gjyE=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ SDL2 ctypes ctypes-foreign ]
+    ++ lib.optionals stdenv.isDarwin [ AudioToolbox Cocoa CoreAudio CoreVideo ForceFeedback ];
+
+  preConfigure = ''
+    # The following is done to avoid an additional dependency (ncurses)
+    # due to linking in the custom bytecode runtime. Instead, just
+    # compile directly into a native binary, even if it's just a
+    # temporary build product.
+    substituteInPlace myocamlbuild.ml \
+      --replace ".byte" ".native"
+  '';
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = webpage;
+    description = "Thin bindings to the cross-platform SDL library";
+    license = licenses.isc;
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix
new file mode 100644
index 000000000000..1e40488080a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, fetchFromGitHub, containers }:
+
+buildDunePackage rec {
+  pname = "tsort";
+  version = "2.1.0";
+  src = fetchFromGitHub {
+    owner = "dmbaturin";
+    repo = "ocaml-tsort";
+    rev = version;
+    sha256 = "sha256-SCd0R8iGwMeRhhSxMid9lzqj5fm+owCJ2dzwtLpFqB4=";
+  };
+
+  propagatedBuildInputs = [ containers ];
+
+  meta = {
+    description = "Easy to use and user-friendly topological sort";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tty/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tty/default.nix
new file mode 100644
index 000000000000..649973df578b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tty/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "tty";
+  version = "0.0.2";
+
+  minimalOCamlVersion = "5.1";
+
+  src = fetchurl {
+    url = "https://github.com/leostera/tty/releases/download/${version}/tty-${version}.tbz";
+    hash = "sha256-eeD5Y+/QXZzFoEHvOSZj2Q74V8BK5j3Lu3Zsrj2YUUs=";
+  };
+
+  propagatedBuildInputs = [
+    uutf
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Library for interacting with teletype and terminal emulators";
+    homepage = "https://github.com/leostera/tty";
+    changelog = "https://github.com/leostera/tty/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix
new file mode 100644
index 000000000000..e5db86d7fee4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchurl
+, ipaddr, macaddr, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "tuntap";
+  version = "2.0.0";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.04.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-tuntap/releases/download/v${version}/tuntap-v${version}.tbz";
+    sha256 = "12wmls28h3jzikwyfw08d5f7ycsc9njwzbhd3qk2l8jnf5rakfsa";
+  };
+
+  propagatedBuildInputs = [ ipaddr macaddr cmdliner ];
+
+  # tests manipulate network devices and use network
+  # also depend on LWT 5
+  doCheck = false;
+
+  meta = {
+    description = "Bindings to the UNIX tuntap facility";
+    homepage = "https://github.com/mirage/ocaml-tuntap";
+    license = lib.licenses.isc;
+    mainProgram = "otunctl";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/twt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/twt/default.nix
new file mode 100644
index 000000000000..069cacb34079
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/twt/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "twt is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-twt";
+  version = "0.94.0";
+
+  src = fetchFromGitHub {
+    owner = "mlin";
+    repo = "twt";
+    rev = "v${version}";
+    sha256 = "sha256-xbjLPd7P1KyuC3i6WHLBcdLwd14atcBsd5ER+l97KAk=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+
+  strictDeps = true;
+
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $OCAMLFIND_DESTDIR
+  '';
+
+  dontBuild = true;
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "“The Whitespace Thing” for OCaml";
+    homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/";
+    license = licenses.mit;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "ocaml+twt";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/type_eq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/type_eq/default.nix
new file mode 100644
index 000000000000..a1426789e3db
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/type_eq/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "type_eq";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.08.1";
+
+  src = fetchurl {
+    url = "https://github.com/skolemlabs/type_eq/releases/download/${version}/${pname}-${version}.tbz";
+    hash = "sha256-4u/HF92Hbf9Rcv+JTAMPhYZjoKZ1cS0mBMkzU/hxx38=";
+  };
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Type equality proofs for OCaml 4";
+    homepage = "https://github.com/skolemlabs/type_eq";
+    changelog = "https://github.com/skolemlabs/type_eq/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/type_id/default.nix b/nixpkgs/pkgs/development/ocaml-modules/type_id/default.nix
new file mode 100644
index 000000000000..6ecca71927aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/type_id/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, alcotest
+, type_eq
+}:
+
+buildDunePackage rec {
+  pname = "type_id";
+  version = "0.0.1";
+
+  minimalOCamlVersion = "4.08.1";
+
+  src = fetchurl {
+    url = "https://github.com/skolemlabs/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    hash = "sha256-hmVAD9vgU1HLnB7d1TX17V+Alf5ZXmvQgd2nLHnLhDk=";
+  };
+
+  propagatedBuildInputs = [
+    type_eq
+  ];
+
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Type identifiers, useful for runtime type-safe casting/coersions";
+    homepage = "https://github.com/skolemlabs/type_id";
+    changelog = "https://github.com/skolemlabs/type_id/blob/${version}/CHANGES.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ sixstring982 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix
new file mode 100644
index 000000000000..d58cee2cad3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, re, uutf }:
+
+buildDunePackage rec {
+  pname = "tyxml";
+  version = "4.6.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocsigen/tyxml/releases/download/${version}/tyxml-${version}.tbz";
+    hash = "sha256-v+tnPGtOEgpOykxIRIrdR9w/jQLCtA9j/9zMTpHJAt0=";
+  };
+
+  propagatedBuildInputs = [ uutf re ];
+
+  meta = with lib; {
+    homepage = "http://ocsigen.org/tyxml/";
+    description = "Library that makes it almost impossible for your OCaml programs to generate wrong XML output, using static typing";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [
+      gal_bolle vbgl
+    ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix
new file mode 100644
index 000000000000..09004e8a9438
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline, withShared ? true, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-uchar";
+  version = "0.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/uchar/releases/download/v${version}/uchar-${version}.tbz";
+    sha256 = "1w2saw7zanf9m9ffvz2lvcxvlm118pws2x1wym526xmydhqpyfa7";
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+
+  strictDeps = true;
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=${lib.boolToString withShared}";
+  installPhase = "${opaline}/bin/opaline -libdir $OCAMLFIND_DESTDIR";
+  configurePlatforms = [ ];
+
+  meta = {
+    description = "Compatibility library for OCaml’s Uchar module";
+    inherit (ocaml.meta) platforms license;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix
new file mode 100644
index 000000000000..1185977132dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitLab, buildDunePackage, ocaml, bigstring, alcotest, cstruct, hex }:
+
+buildDunePackage rec {
+  pname = "uecc";
+  version = "0.4";
+
+  duneVersion = "3";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ocaml-uecc";
+    rev = "v${version}";
+    hash = "sha256-o/DylUx+olRRloiCU6b1t/xOmW8A5IZB2n3U7fkMo80=";
+  };
+
+  propagatedBuildInputs = [
+    bigstring
+  ];
+
+  checkInputs = [
+    alcotest
+    cstruct
+    hex
+  ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    description = "Bindings for ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors";
+    homepage = "https://gitlab.com/nomadic-labs/ocaml-uecc";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix
new file mode 100644
index 000000000000..910d75dcdc2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4 }:
+
+let
+  pname = "ulex";
+  param =
+    if lib.versionAtLeast ocaml.version "4.02" then {
+      version = "1.2";
+      sha256 = "08yf2x9a52l2y4savjqfjd2xy4pjd1rpla2ylrr9qrz1drpfw4ic";
+    } else {
+      version = "1.1";
+      sha256 = "0cmscxcmcxhlshh4jd0lzw5ffzns12x3bj7h27smbc8waxkwffhl";
+    };
+in
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  inherit (param) version;
+
+  src = fetchFromGitHub {
+    owner = "whitequark";
+    repo = pname;
+    rev = "v${version}";
+    inherit (param) sha256;
+  };
+
+  createFindlibDestdir = true;
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ];
+  propagatedBuildInputs = [ camlp4 ];
+
+  strictDeps = true;
+
+  buildFlags = [ "all" "all.opt" ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Lexer generator for Unicode and OCaml";
+    license = lib.licenses.mit;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ lib.maintainers.roconnor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/unionFind/default.nix b/nixpkgs/pkgs/development/ocaml-modules/unionFind/default.nix
new file mode 100644
index 000000000000..aa1d5e82362b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/unionFind/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "unionFind";
+  version = "20220122";
+
+  useDune2 = true;
+  minimalOCamlVersion = "4.05";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256:0hdh56rbg8vfjd61q09cbmh8l5wmry5ykivg7gsm0v5ckkb3531r";
+  };
+
+  meta = {
+    description = "Implementations of the union-find data structure";
+    license = lib.licenses.lgpl2Only;
+    inherit (src.meta) homepage;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/unisim_archisec/default.nix b/nixpkgs/pkgs/development/ocaml-modules/unisim_archisec/default.nix
new file mode 100644
index 000000000000..a5b364312d41
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/unisim_archisec/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "unisim_archisec";
+  version = "0.0.5";
+
+  src = fetchurl {
+    url = "https://github.com/binsec/unisim_archisec/releases/download/0.0.5/unisim_archisec-0.0.5.tbz";
+    sha256 = "sha256-94Ky7rtR8oFTtWshTYaY6gyJdqrY3QKMF7qTkZQweXQ=";
+  };
+
+  duneVersion = "3";
+
+  meta = {
+    homepage = "https://binsec.github.io";
+    downloadPage = "https://github.com/binsec/unisim_archisec";
+    description = "UNISIM-VP DBA decoder";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.david-hamelin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/unix-errno/default.nix b/nixpkgs/pkgs/development/ocaml-modules/unix-errno/default.nix
new file mode 100644
index 000000000000..d869748ecb50
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/unix-errno/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl, ctypes, integers, result }:
+
+buildDunePackage rec {
+  pname = "unix-errno";
+  version = "0.6.2";
+
+  minimalOCamlVersion = "4.03.0"; # Specified to be 4.01.0, but it's actually 4.03
+
+  src = fetchurl {
+    url = "https://github.com/xapi-project/ocaml-unix-errno/releases/download/${version}/unix-errno-${version}.tbz";
+    sha256 = "sha256-LWqbyGcxs6f/FcOPo3JYR3U+AL0JHeWCiGjuYhxxrWU=";
+  };
+
+  propagatedBuildInputs = [ ctypes integers result ];
+
+  meta = with lib; {
+    homepage = "https://github.com/xapi-project/ocaml-unix-errno"; # This is the repo used in the opam package
+    description = "Unix errno types, maps, and support for OCaml";
+    license = with licenses; [ isc lgpl21Only ]; # All the files indicate ISC, but there's an LGPL LICENSE file
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/unstrctrd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/unstrctrd/default.nix
new file mode 100644
index 000000000000..b9be734a40e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/unstrctrd/default.nix
@@ -0,0 +1,46 @@
+{ alcotest
+, angstrom
+, bigstringaf
+, buildDunePackage
+, crowbar
+, fetchzip
+, fmt
+, hxd
+, ke
+, lib
+, rresult
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "unstrctrd";
+  version = "0.4";
+
+  src = fetchzip {
+    url = "https://github.com/dinosaure/unstrctrd/releases/download/v${version}/unstrctrd-${version}.tbz";
+    hash = "sha256-CGcDqEr+VDTbDYkjxeYB6IFWiTkOTLJJl/Y2bHtv19g=";
+  };
+
+  propagatedBuildInputs = [
+    angstrom
+    uutf
+  ];
+
+  checkInputs = [
+    alcotest
+    bigstringaf
+    crowbar
+    fmt
+    hxd
+    ke
+    rresult
+  ];
+  doCheck = true;
+
+  meta = {
+    description = "Library for parsing email headers";
+    homepage = "https://github.com/dinosaure/unstrctrd";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uri/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uri/default.nix
new file mode 100644
index 000000000000..f8e8efdaae67
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uri/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, ounit
+, angstrom, stringext
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.03";
+  pname = "uri";
+  version = "4.4.0";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    sha256 = "cdabaf6ef5cd2161e59cc7b74c6e4a68ecb80a9f4e96002e338e1b6bf17adec4";
+  };
+
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ angstrom stringext ];
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/mirage/ocaml-uri";
+    description = "RFC3986 URI parsing library for OCaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix b/nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix
new file mode 100644
index 000000000000..61aa01fad8ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix
@@ -0,0 +1,16 @@
+{ lib, ocaml, buildDunePackage, uri, ounit, ppx_sexp_conv, sexplib0 }:
+
+if lib.versionOlder ocaml.version "4.04"
+then throw "uri-sexp is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage {
+  pname = "uri-sexp";
+  inherit (uri) version src meta;
+
+  duneVersion = "3";
+
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ ppx_sexp_conv sexplib0 uri ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uring/default.nix
new file mode 100644
index 000000000000..c78e794b8034
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uring/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, buildDunePackage
+, cstruct
+, dune-configurator
+, fetchurl
+, fmt
+, optint
+, mdx
+}:
+
+buildDunePackage rec {
+  pname = "uring";
+  version = "0.9";
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-multicore/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
+    hash = "sha256-eXWIxfL9UsKKf4sanBjKfr6Od4fPDctVnkU+wjIXW0M=";
+  };
+
+  propagatedBuildInputs = [
+    cstruct
+    fmt
+    optint
+  ];
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  checkInputs = [
+    mdx
+  ];
+
+  nativeCheckInputs = [
+    mdx.bin
+  ];
+
+  doCheck = true;
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://github.com/ocaml-multicore/ocaml-${pname}";
+    changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md";
+    description = "Bindings to io_uring for OCaml";
+    license = with lib.licenses; [ isc mit ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix
new file mode 100644
index 000000000000..847868032ca1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, xmlm, topkg }:
+
+let
+  pname = "uucd";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+stdenv.mkDerivation rec {
+  name = "ocaml-${pname}-${version}";
+  version = "15.1.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    hash = "sha256-HIANZ5SDJcytlpw/W9Ae2eFTutrutJj2PgJCfByobfI=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  propagatedBuildInputs = [ xmlm ];
+
+  meta = with lib; {
+    description = "OCaml module to decode the data of the Unicode character database from its XML representation";
+    homepage = webpage;
+    inherit (ocaml.meta) platforms;
+    maintainers = [ maintainers.vbgl ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix
new file mode 100644
index 000000000000..1703cac867f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, uunf, uucd }:
+
+let
+  pname = "uucp";
+  version = "15.1.0";
+  webpage = "https://erratique.ch/software/${pname}";
+  minimalOCamlVersion = "4.03";
+  doCheck = true;
+in
+
+if lib.versionOlder ocaml.version minimalOCamlVersion
+then builtins.throw "${pname} needs at least OCaml ${minimalOCamlVersion}"
+else
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    hash = "sha256-qR5LiAZHt4oD3ak0x17GqbYXNaJmJxFk/WGoxT+yWYc=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg uutf uunf uucd ];
+
+  propagatedBuildInputs = [ uchar ];
+
+  strictDeps = true;
+
+  buildPhase = ''
+    runHook preBuild
+    ${topkg.buildPhase} --with-cmdliner false --tests ${lib.boolToString doCheck}
+    runHook postBuild
+  '';
+
+  inherit (topkg) installPhase;
+
+  inherit doCheck;
+  checkPhase = ''
+    runHook preCheck
+    ${topkg.run} test
+    runHook postCheck
+  '';
+  checkInputs = [ uucd ];
+
+  meta = with lib; {
+    description = "OCaml library providing efficient access to a selection of character properties of the Unicode character database";
+    homepage = webpage;
+    inherit (ocaml.meta) platforms;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix
new file mode 100644
index 000000000000..83b8cacc77a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner }:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
+  "uuidm is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  version = "0.9.8";
+  pname = "uuidm";
+  src = fetchurl {
+    url = "https://erratique.ch/software/uuidm/releases/uuidm-${version}.tbz";
+    sha256 = "sha256-/GZbkJVDQu1UY8SliK282kUWAVMfOnpQadUlRT/tJrM=";
+  };
+
+  postPatch = ''
+    substituteInPlace pkg/META --replace "bytes" ""
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  configurePlatforms = [];
+  buildInputs = [ topkg cmdliner ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "OCaml module implementing 128 bits universally unique identifiers version 3, 5 (name based with MD5, SHA-1 hashing) and 4 (random based) according to RFC 4122";
+    homepage = "https://erratique.ch/software/uuidm";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.maurer ];
+    mainProgram = "uuidtrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix
new file mode 100644
index 000000000000..2d473a4b8351
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf, cmdliner
+, cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
+, version ? if lib.versionAtLeast ocaml.version "4.14" then "15.1.0" else "15.0.0"
+}:
+
+let
+  pname = "uunf";
+  webpage = "https://erratique.ch/software/${pname}";
+  hash = {
+    "15.0.0" = "sha256-B/prPAwfqS8ZPS3fyDDIzXWRbKofwOCyCfwvh9veuug=";
+    "15.1.0" = "sha256-D8yvb7hVWaYxMqMZ5089/5tWDfvyGXKUOjhfU/4zSeQ=";
+  }."${version}";
+in
+
+if lib.versionOlder ocaml.version "4.03"
+then throw "${pname} is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    inherit hash;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg uutf ]
+  ++ lib.optional cmdlinerSupport cmdliner;
+
+  strictDeps = true;
+
+  prePatch = lib.optionalString stdenv.isAarch64 "ulimit -s 16384";
+
+  buildPhase = ''
+    runHook preBuild
+    ${topkg.run} build \
+      --with-uutf true \
+      --with-cmdliner ${lib.boolToString cmdlinerSupport}
+    runHook postBuild
+  '';
+
+  inherit (topkg) installPhase;
+
+  meta = with lib; {
+    description = "OCaml module for normalizing Unicode text";
+    homepage = webpage;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "unftrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix
new file mode 100644
index 000000000000..9a8cfa29491f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uucp, uutf, cmdliner
+, version ? if lib.versionAtLeast ocaml.version "4.14" then "15.1.0" else "15.0.0"
+, cmdlinerSupport ? lib.versionAtLeast cmdliner.version "1.1"
+}:
+
+let
+  pname = "uuseg";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation rec {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    hash = {
+      "15.1.0" = "sha256-IPI3Wd51HzX4n+uGcgc04us29jMjnKbGgVEAdp0CVMU=";
+      "15.0.0" = "sha256-q8x3bia1QaKpzrWFxUmLWIraKqby7TuPNGvbSjkY4eM=";
+    }."${version}";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [  topkg uutf ]
+  ++ lib.optional cmdlinerSupport cmdliner;
+  propagatedBuildInputs = [ uucp ];
+
+  strictDeps = true;
+
+  buildPhase = ''
+    runHook preBuild
+    ${topkg.run} build \
+      --with-uutf true \
+      --with-cmdliner ${lib.boolToString cmdlinerSupport}
+    runHook postBuild
+  '';
+
+  inherit (topkg) installPhase;
+
+  meta = with lib; {
+    description = "OCaml library for segmenting Unicode text";
+    homepage = webpage;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "usegtrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix
new file mode 100644
index 000000000000..62ac1fc7c1c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, cmdliner , topkg, uchar }:
+let
+  pname = "uutf";
+in
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.03")
+  "${pname} is not available with OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
+    sha256 = "sha256-h3KlYT0ecCmM4U3zMkGjaF8h5O9r20zwP+mF+x7KBWg=";
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ];
+  buildInputs = [ topkg cmdliner ];
+  propagatedBuildInputs = [ uchar ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "Non-blocking streaming Unicode codec for OCaml";
+    homepage = "https://erratique.ch/software/uutf";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "utftrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/uuuu/default.nix b/nixpkgs/pkgs/development/ocaml-modules/uuuu/default.nix
new file mode 100644
index 000000000000..6f0312cfb61a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uuuu/default.nix
@@ -0,0 +1,40 @@
+{ angstrom
+, buildDunePackage
+, fetchurl
+, findlib
+, lib
+, ocaml
+, re
+}:
+
+buildDunePackage rec {
+  pname = "uuuu";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/uuuu/releases/download/v${version}/uuuu-${version}.tbz";
+    sha256 = "sha256:19n39yc7spgzpk9i70r0nhkwsb0bfbvbgpf8d863p0a3wgryhzkb";
+  };
+
+  postPatch = ''
+    substituteInPlace src/dune --replace 'ocaml} ' \
+      'ocaml} -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib '
+  '';
+
+  nativeBuildInputs = [ findlib ];
+
+  buildInputs = [ angstrom ];
+
+  checkInputs = [ re ];
+  doCheck = true;
+
+  duneVersion = "3";
+
+  meta = {
+    description = "Library to normalize an ISO-8859 input to Unicode code-point";
+    homepage = "https://github.com/mirage/uuuu";
+    license = lib.licenses.mit;
+    maintainers = [ ];
+    mainProgram = "uuuu.generate";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix
new file mode 100644
index 000000000000..e727c8667669
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix
@@ -0,0 +1,43 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_cstruct, ppx_sexp_conv, ounit
+, lwt, cstruct, io-page, mirage-flow, xenstore, xenstore_transport
+, sexplib, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "vchan";
+  version = "6.0.1";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-vchan/releases/download/v${version}/vchan-${version}.tbz";
+    hash = "sha256-5E7dITMVirYoxUkp8ZamRAolyhA6avXGJNAioxeBuV0=";
+  };
+
+  propagatedBuildInputs = [
+    ppx_cstruct
+    ppx_sexp_conv
+    lwt
+    cstruct
+    io-page
+    mirage-flow
+    xenstore
+    xenstore_transport
+    sexplib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    cmdliner
+    ounit
+  ];
+
+  meta = with lib; {
+    description = "Xen Vchan implementation";
+    homepage = "https://github.com/mirage/ocaml-vchan";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vector/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vector/default.nix
new file mode 100644
index 000000000000..c5f4336bb833
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vector/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "vector";
+  version = "1.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/vector/releases/download/${version}/vector-${version}.tbz";
+    sha256 = "sha256:0hb6prpada4c5z07sxf5ayj5xbahsnwall15vaqdwdyfjgbd24pj";
+  };
+
+  doCheck = true;
+
+  meta = {
+    description = "Resizable arrays for OCaml";
+    license = lib.licenses.lgpl2Only;
+    homepage = "https://github.com/backtracking/vector";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vg/default.nix
new file mode 100644
index 000000000000..410e356be797
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vg/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, uchar, result, gg, uutf, otfm
+, js_of_ocaml, js_of_ocaml-ppx,
+  pdfBackend ? true, # depends on uutf and otfm
+  htmlcBackend ? true # depends on js_of_ocaml
+}:
+
+let
+  inherit (lib) optionals versionOlder;
+
+  pname = "vg";
+  version = "0.9.4";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+if versionOlder ocaml.version "4.03"
+then throw "vg is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "181sz6l5xrj5jvwg4m2yqsjzwp2s5h8v0mwhjcwbam90kdfx2nak";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ topkg ];
+
+  propagatedBuildInputs = [ uchar result gg ]
+                          ++ optionals pdfBackend [ uutf otfm ]
+                          ++ optionals htmlcBackend [ js_of_ocaml js_of_ocaml-ppx ];
+
+  strictDeps = true;
+
+  buildPhase = topkg.buildPhase
+    + " --with-uutf ${lib.boolToString pdfBackend}"
+    + " --with-otfm ${lib.boolToString pdfBackend}"
+    + " --with-js_of_ocaml ${lib.boolToString htmlcBackend}"
+    + " --with-cairo2 false";
+
+  inherit (topkg) installPhase;
+
+  meta = with lib; {
+    description = "Declarative 2D vector graphics for OCaml";
+    longDescription = ''
+    Vg is an OCaml module for declarative 2D vector graphics. In Vg, images
+    are values that denote functions mapping points of the cartesian plane
+    to colors. The module provides combinators to define and compose these
+    values.
+
+    Renderers for PDF, SVG and the HTML canvas are distributed with the
+    module. An API allows to implement new renderers.
+    '';
+    homepage = webpage;
+    license = licenses.isc;
+    maintainers = [ maintainers.jirkamarsik ];
+    mainProgram = "vecho";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/visitors/default.nix b/nixpkgs/pkgs/development/ocaml-modules/visitors/default.nix
new file mode 100644
index 000000000000..22762db02aa3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/visitors/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchFromGitLab, ppxlib, ppx_deriving, result }:
+
+buildDunePackage rec {
+  pname = "visitors";
+  version = "20210608";
+
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitLab {
+    owner = "fpottier";
+    repo = pname;
+    rev = version;
+    domain = "gitlab.inria.fr";
+    sha256 = "1p75x5yqwbwv8yb2gz15rfl3znipy59r45d1f4vcjdghhjws6q2a";
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving result ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.inria.fr/fpottier/visitors";
+    changelog = "https://gitlab.inria.fr/fpottier/visitors/-/raw/${version}/CHANGES.md";
+    license = licenses.lgpl21;
+    description = "OCaml syntax extension (technically, a ppx_deriving plugin) which generates object-oriented visitors for traversing and transforming data structures";
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix
new file mode 100644
index 000000000000..a6ba09ebc679
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, ocaml
+, dune-configurator
+}:
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "vlq is not available for OCaml ${ocaml.version}"
+
+buildDunePackage rec {
+  pname = "vlq";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "https://github.com/flowtype/ocaml-vlq/releases/download/v${version}/vlq-v${version}.tbz";
+    sha256 = "02wr9ph4q0nxmqgbc67ydf165hmrdv9b655krm2glc3ahb6larxi";
+  };
+
+  buildInputs = [ dune-configurator ];
+
+  meta = {
+    description = "encoding variable-length quantities, in particular base64";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/flowtype/ocaml-vlq";
+    maintainers = [ lib.maintainers.nomeata ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vorbis/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vorbis/default.nix
new file mode 100644
index 000000000000..5bfb230e6c7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vorbis/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, libvorbis }:
+
+buildDunePackage rec {
+  pname = "vorbis";
+  version = "0.8.0";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-vorbis";
+    rev = "v${version}";
+    hash = "sha256-iCoE7I70wAp4n4XfETVKeaob2811E97/e6144bY/nqk=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ ogg libvorbis ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-vorbis";
+    description = "Bindings to libvorbis";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/vpl-core/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vpl-core/default.nix
new file mode 100644
index 000000000000..08f8eccacc6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vpl-core/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, zarith
+}:
+
+buildDunePackage rec {
+  pname = "vpl-core";
+  version = "0.5";
+
+  minimalOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "VERIMAG-Polyhedra";
+    repo = "vpl";
+    rev = version;
+    hash = "sha256-mSD/xSweeK9WMxWDdX/vzN96iXo74RkufjuNvtzsP9o=";
+  };
+
+  propagatedBuildInputs = [
+    zarith
+  ];
+
+  meta = {
+    description = "Verified Polyhedra Library";
+    homepage = "https://amarechal.gitlab.io/home/projects/vpl/";
+    license = lib.licenses.lgpl3Only;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix
new file mode 100644
index 000000000000..95ba92c8bca3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+if lib.versionOlder ocaml.version "4.08"
+then throw "wasm is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-wasm";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "WebAssembly";
+    repo = "spec";
+    rev = "opam-${version}";
+    hash = "sha256-5eo8MIui2GxRS5X9az0NlLGZfxi5KGsTI/EaP6m/zts=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  strictDeps = true;
+
+  # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
+  hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";
+
+  makeFlags = [ "-C" "interpreter" ];
+
+  createFindlibDestdir = true;
+
+  postInstall = ''
+    mkdir $out/bin
+    cp -L interpreter/wasm $out/bin
+  '';
+
+  meta = {
+    description = "Executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
+    mainProgram = "wasm";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix b/nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix
new file mode 100644
index 000000000000..c839546a2ba6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, xmlm
+, eio
+, logs
+, fmt
+, cstruct
+, cmdliner
+, alcotest
+, eio_main
+}:
+
+buildDunePackage rec {
+  pname = "wayland";
+  version = "2.1";
+
+  minimalOCamlVersion = "5.0";
+
+  src = fetchurl {
+    url = "https://github.com/talex5/ocaml-wayland/releases/download/v${version}/wayland-${version}.tbz";
+    hash = "sha256-D/tTlYlU8e1O+HShIsBxqc8953rjQblj63tRPYAo88E=";
+  };
+
+  propagatedBuildInputs = [
+    eio
+    logs
+    fmt
+    cstruct
+  ];
+
+  buildInputs = [
+    cmdliner
+    xmlm
+  ];
+
+  checkInputs = [
+    alcotest
+    eio_main
+  ];
+  doCheck = true;
+
+  meta = {
+    description = "Pure OCaml Wayland protocol library";
+    homepage = "https://github.com/talex5/ocaml-wayland";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.sternenseemann ];
+    mainProgram = "wayland-scanner-ocaml";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix b/nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix
new file mode 100644
index 000000000000..7ace251e5533
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, astring, bos, cmdliner, rresult
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-webbrowser";
+  version = "0.6.1";
+  src = fetchurl {
+    url = "https://erratique.ch/software/webbrowser/releases/webbrowser-${version}.tbz";
+    sha256 = "137a948bx7b71zfv4za3hhznrn5lzbbrgzjy0das83zms508isx3";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ astring bos cmdliner rresult ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "Open and reload URIs in browsers from OCaml";
+    homepage = "https://erratique.ch/software/webbrowser";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    mainProgram = "browse";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/webmachine/default.nix b/nixpkgs/pkgs/development/ocaml-modules/webmachine/default.nix
new file mode 100644
index 000000000000..33436cd2c8c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/webmachine/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, cohttp, dispatch, ptime
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "webmachine";
+  version = "0.7.0";
+  duneVersion = "3";
+
+  minimalOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "ocaml-webmachine";
+    rev = version;
+    sha256 = "03ynb1l2jjqba88m9r8m5hwlm8izpfp617r4vcab5kmdim1l2ffx";
+  };
+
+  propagatedBuildInputs = [ cohttp dispatch ptime ];
+
+  checkInputs = [ ounit ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/inhabitedtype/ocaml-webmachine";
+    license = lib.licenses.bsd3;
+    description = "REST toolkit for OCaml";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wtf8/default.nix b/nixpkgs/pkgs/development/ocaml-modules/wtf8/default.nix
new file mode 100644
index 000000000000..bc071f9305f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wtf8/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "wtf8";
+  version = "1.0.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "09ygcxxd5warkdzz17rgpidrd0pg14cy2svvnvy1hna080lzg7vp";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/flowtype/ocaml-wtf8";
+    description = "WTF-8 is a superset of UTF-8 that allows unpaired surrogates";
+    license = licenses.mit;
+    maintainers = [ maintainers.eqyiel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/x509/default.nix b/nixpkgs/pkgs/development/ocaml-modules/x509/default.nix
new file mode 100644
index 000000000000..aca71e2dfc17
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/x509/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchurl, buildDunePackage
+, alcotest, cstruct-unix
+, asn1-combinators, domain-name, fmt, gmap, pbkdf, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, ipaddr
+, logs, base64
+}:
+
+buildDunePackage rec {
+  minimalOCamlVersion = "4.08";
+
+  pname = "x509";
+  version = "0.16.5";
+
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-x509/releases/download/v${version}/x509-${version}.tbz";
+    hash = "sha256-FJ4lpf6jf2GfsmkL7lwA8BydzzHTNfj/yqs5p1OMzZk=";
+  };
+
+  checkInputs = [ alcotest cstruct-unix ];
+  propagatedBuildInputs = [ asn1-combinators domain-name fmt gmap mirage-crypto mirage-crypto-pk mirage-crypto-ec pbkdf logs base64 ipaddr ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirleft/ocaml-x509";
+    description = "X509 (RFC5280) handling in OCaml";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xdg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xdg/default.nix
new file mode 100644
index 000000000000..52543175e07c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xdg/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, dune_3 }:
+
+buildDunePackage rec {
+  pname = "xdg";
+  inherit (dune_3) src version;
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.08";
+
+  dontAddPrefix = true;
+
+  meta = with lib; {
+    description = "XDG Base Directory Specification";
+    inherit (dune_3.meta) homepage;
+    maintainers = with lib.maintainers; [ ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix
new file mode 100644
index 000000000000..e75a2036642f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, camlp-streams, xenstore_transport, xenstore, lwt }:
+
+buildDunePackage {
+  pname = "xenstore-tool";
+
+  inherit (xenstore_transport) src version;
+
+  postPatch = ''
+    substituteInPlace cli/dune --replace 'libraries ' 'libraries camlp-streams '
+  '';
+
+  buildInputs = [ camlp-streams xenstore_transport xenstore lwt ];
+
+  meta = xenstore_transport.meta // {
+    description = "Command line tool for interfacing with xenstore";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix
new file mode 100644
index 000000000000..093ca1ffe902
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, ppx_cstruct, lwt, ounit2
+}:
+
+buildDunePackage rec {
+  pname = "xenstore";
+  version = "2.2.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-xenstore/releases/download/v${version}/xenstore-${version}.tbz";
+    hash = "sha256-1Mnqtt5zHeRdYJHvhdQNjN8d4yxUEKD2cpwtoc7DGC0=";
+  };
+
+  buildInputs = [ ppx_cstruct ];
+  propagatedBuildInputs = [ cstruct lwt ];
+
+  doCheck = true;
+  checkInputs = [ ounit2 ];
+
+  meta = with lib; {
+    description = "Xenstore protocol in pure OCaml";
+    license = licenses.lgpl21Only;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/ocaml-xenstore";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xenstore_transport/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xenstore_transport/default.nix
new file mode 100644
index 000000000000..f0867b4ec314
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xenstore_transport/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchFromGitHub, xenstore, lwt }:
+
+buildDunePackage rec {
+  pname = "xenstore_transport";
+  version = "1.3.0";
+
+  minimalOCamlVersion = "4.08";
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "xapi-project";
+    repo = "ocaml-xenstore-clients";
+    rev = "v${version}";
+    sha256 = "1kxxd9i4qiq98r7sgvl59iq2ni7y6drnv48qj580q5cyiyyc85q3";
+  };
+
+  propagatedBuildInputs = [ xenstore lwt ];
+
+  # requires a mounted xenfs and xen server
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Low-level libraries for connecting to a xenstore service on a xen host";
+    license = licenses.lgpl21Only;
+    homepage = "https://github.com/xapi-project/ocaml-xenstore-clients";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix
new file mode 100644
index 000000000000..5ebaadf214fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildDunePackage
+, fetchurl
+}:
+
+buildDunePackage rec {
+  pname = "xml-light";
+  version = "2.5";
+
+  duneVersion = "3";
+  minimalOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/ncannasse/xml-light/releases/download/${version}/xml-light-${version}.tbz";
+    hash = "sha256-9YwrPbcK0boICw0wauMvgsy7ldq7ksWZzcRn0eROAD0=";
+  };
+
+  meta = {
+    description = "Minimal Xml parser and printer for OCaml";
+    longDescription = ''
+      Xml-Light provides functions to parse an XML document into an OCaml
+      data structure, work with it, and print it back to an XML
+      document. It support also DTD parsing and checking, and is
+      entirely written in OCaml, hence it does not require additional C
+      library.
+    '';
+    homepage = "http://tech.motion-twin.com/xmllight.html";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix
new file mode 100644
index 000000000000..35459d14024b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+let
+  pname = "xmlm";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+if lib.versionOlder ocaml.version "4.05"
+then throw "xmlm is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "sha256-CRJSJY490WMgw85N2yG81X79nIwuv7eZ7mpUPtSS2fo=";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ topkg ];
+
+  strictDeps = true;
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "OCaml streaming codec to decode and encode the XML data format";
+    homepage = webpage;
+    license = licenses.isc;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "xmltrip";
+    inherit (ocaml.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xmlplaylist/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xmlplaylist/default.nix
new file mode 100644
index 000000000000..a30172573506
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xmlplaylist/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, xmlm }:
+
+buildDunePackage rec {
+  pname = "xmlplaylist";
+  version = "0.1.5";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-xmlplaylist";
+    rev = "v${version}";
+    sha256 = "1x5lbwkr2ip00x8vyfbl8936yy79j138vx8a16ix7g9p2j5qsfcq";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ xmlm ];
+
+  meta = with lib; {
+    homepage = "https://github.com/savonet/ocaml-xmlplaylist";
+    description = "Module to parse various RSS playlist formats";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ dandellion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix
new file mode 100644
index 000000000000..47e153e53c2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitLab, iri, re, sedlex, uutf }:
+
+buildDunePackage rec {
+  pname = "xtmpl";
+  version = "0.19.0";
+  duneVersion = "3";
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "xtmpl";
+    rev = version;
+    sha256 = "sha256:0vwj0aayg60wm98d91fg3hmj90730liljy4cn8771dpxvz8m07bw";
+  };
+
+  propagatedBuildInputs = [ iri re sedlex uutf ];
+
+  meta = with lib; {
+    description = "XML templating library for OCaml";
+    homepage = "https://www.good-eris.net/xtmpl/";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ regnat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xtmpl/ppx.nix b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/ppx.nix
new file mode 100644
index 000000000000..0e23cdc48f70
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/ppx.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, xtmpl, ppxlib }:
+
+buildDunePackage {
+  pname = "xtmpl_ppx";
+  minimalOCamlVersion = "4.11";
+  duneVersion = "3";
+
+  inherit (xtmpl) src version;
+
+  buildInputs = [ ppxlib xtmpl ];
+
+  meta = xtmpl.meta // {
+    description = "Xml templating library, ppx extension";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xxhash/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xxhash/default.nix
new file mode 100644
index 000000000000..d8ef8f3d60ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xxhash/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, xxHash
+, ctypes
+, ctypes-foreign
+, dune-configurator
+, ppx_expect
+}:
+
+buildDunePackage rec {
+  pname = "xxhash";
+  version = "0.2";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "314eter";
+    repo = "ocaml-xxhash";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-0+ac5EWV9DCVMT4wOcXC95GVEwsUIZzFn2laSzmK6jE=";
+  };
+
+  postPatch = ''
+    substituteInPlace stubs/dune --replace-warn 'ctypes))' 'ctypes ctypes.stubs))'
+  '';
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    ctypes
+    ctypes-foreign
+    xxHash
+  ];
+
+  doCheck = true;
+
+  checkInputs = [
+    ppx_expect
+  ];
+
+  meta = {
+    homepage = "https://github.com/314eter/ocaml-xxhash";
+    description = "Bindings for xxHash, an extremely fast hash algorithm";
+    license = with lib.licenses; [ mit ];
+    maintainers = with lib.maintainers; [ toastal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix
new file mode 100644
index 000000000000..99b6fb245a26
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchurl, buildDunePackage
+, dune-configurator
+, bos, ctypes, fmt, logs
+, mdx, alcotest, crowbar, junit_alcotest, ezjsonm
+}:
+
+buildDunePackage rec {
+  pname = "yaml";
+  version = "3.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/avsm/ocaml-yaml/releases/download/v${version}/yaml-${version}.tbz";
+    hash = "sha256-xQ0qyii5+WZ5K3HhYDNR5dJO2k39PkRT+9UDZqOggic=";
+  };
+
+  minimalOCamlVersion = "4.13";
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ bos ctypes ];
+
+  doCheck = true;
+  nativeCheckInputs = [ mdx.bin ];
+  checkInputs = [ fmt logs alcotest crowbar junit_alcotest ezjsonm ];
+
+  meta = {
+    description = "Parse and generate YAML 1.1 files";
+    homepage = "https://github.com/avsm/ocaml-yaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix b/nixpkgs/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix
new file mode 100644
index 000000000000..051019c73479
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, yaml, dune-configurator, ppx_sexp_conv, sexplib
+, junit_alcotest
+}:
+
+buildDunePackage rec {
+  pname = "yaml-sexp";
+
+  inherit (yaml) version src;
+
+  propagatedBuildInputs = [ yaml ppx_sexp_conv sexplib ];
+
+  doCheck = true;
+  checkInputs = [ junit_alcotest ];
+
+  meta = yaml.meta // {
+    description = "ocaml-yaml with sexp support";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix b/nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix
new file mode 100644
index 000000000000..ec5c86036ad2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage, seq }:
+
+buildDunePackage rec {
+  pname = "yojson";
+  version = "2.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz";
+    hash = "sha256-v9wzvvMUG7qaj6ZqiFtUsp9r+rRQBAiE3Yz3zex4RRk=";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  meta = with lib; {
+    description = "Optimized parsing and printing library for the JSON format";
+    homepage = "https://github.com/ocaml-community/${pname}";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    mainProgram = "ydump";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/yuscii/default.nix b/nixpkgs/pkgs/development/ocaml-modules/yuscii/default.nix
new file mode 100644
index 000000000000..3080cb772e9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yuscii/default.nix
@@ -0,0 +1,39 @@
+{ alcotest
+, buildDunePackage
+, ocaml
+, fetchzip
+, gcc
+, fmt
+, lib
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "yuscii";
+  version = "0.3.0";
+
+  minimalOCamlVersion = "4.03";
+  duneVersion = "3";
+
+  src = fetchzip {
+    url = "https://github.com/mirage/yuscii/releases/download/v${version}/yuscii-v${version}.tbz";
+    sha256 = "0idywlkw0fbakrxv65swnr5bj7f2vns9kpay7q03gzlv82p670hy";
+  };
+
+  nativeCheckInputs = [
+    gcc
+  ];
+  checkInputs = [
+    alcotest
+    fmt
+    uutf
+  ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+
+  meta = {
+    description = "Simple mapper between UTF-7 to Unicode according RFC2152";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/mirage/yuscii";
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/yuujinchou/default.nix b/nixpkgs/pkgs/development/ocaml-modules/yuujinchou/default.nix
new file mode 100644
index 000000000000..48c1fb471fad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yuujinchou/default.nix
@@ -0,0 +1,42 @@
+{ lib, ocaml, fetchFromGitHub, buildDunePackage
+, algaeff, bwd
+, qcheck-alcotest
+}:
+
+let params = if lib.versionAtLeast ocaml.version "5.0" then {
+    version = "5.1.0";
+    hash = "sha256-J3qkytgJkk2gT83KJ47nNM4cXqVHbx4iTPK+fLwR7Wk=";
+    propagatedBuildInputs = [ algaeff bwd ];
+  } else {
+    version = "2.0.0";
+    hash = "sha256:1nhz44cyipy922anzml856532m73nn0g7iwkg79yzhq6yb87109w";
+  }
+; in
+
+buildDunePackage rec {
+  pname = "yuujinchou";
+  inherit (params) version;
+
+  minimalOCamlVersion = "4.12";
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = pname;
+    rev = version;
+    inherit (params) hash;
+  };
+
+  propagatedBuildInputs = params.propagatedBuildInputs or [];
+
+
+  doCheck = true;
+  checkInputs = [ qcheck-alcotest ];
+
+  meta = {
+    description = "Name pattern combinators";
+    homepage = "https://github.com/RedPRL/yuujinchou";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/z3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/z3/default.nix
new file mode 100644
index 000000000000..f2ece5550d78
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/z3/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, ocaml, findlib, zarith, z3 }:
+
+if lib.versionOlder ocaml.version "4.07"
+then throw "z3 is not available for OCaml ${ocaml.version}"
+else
+
+let z3-with-ocaml = (z3.override {
+  ocamlBindings = true;
+  inherit ocaml findlib zarith;
+}); in
+
+stdenv.mkDerivation {
+
+  pname = "ocaml${ocaml.version}-z3";
+  inherit (z3-with-ocaml) version;
+
+  dontUnpack = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $OCAMLFIND_DESTDIR
+    cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/stublibs $OCAMLFIND_DESTDIR
+    cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/Z3 $OCAMLFIND_DESTDIR/z3
+    runHook postInstall
+  '';
+
+  nativeBuildInputs = [ findlib ];
+  propagatedBuildInputs = [ zarith ];
+
+  strictDeps = true;
+
+  meta = z3.meta // {
+    description = "Z3 Theorem Prover (OCaml API)";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix
new file mode 100644
index 000000000000..b260d946ce1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub
+, ocaml, findlib, pkg-config
+, gmp
+}:
+
+if lib.versionOlder ocaml.version "4.04"
+then throw "zarith is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-zarith";
+  version = "1.13";
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = "Zarith";
+    rev = "release-${version}";
+    sha256 = "sha256-CNVKoJeO3fsmWaV/dwnUA8lgI4ZlxR/LKCXpCXUrpSg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ocaml findlib ];
+  propagatedBuildInputs = [ gmp ];
+  strictDeps = true;
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+  configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ];
+
+  preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs";
+
+  meta = with lib; {
+    description = "Fast, arbitrary precision OCaml integers";
+    homepage    = "https://github.com/ocaml/Zarith";
+    changelog   = "https://github.com/ocaml/Zarith/raw/${src.rev}/Changes";
+    license     = licenses.lgpl2;
+    inherit (ocaml.meta) platforms;
+    maintainers = with maintainers; [ thoughtpolice vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zed/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zed/default.nix
new file mode 100644
index 000000000000..4b05b21c69d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zed/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, fetchFromGitHub, react, result, uchar, uutf, uucp, uuseg }:
+
+buildDunePackage rec {
+  pname = "zed";
+  version = "3.2.3";
+
+  propagatedBuildInputs = [ react result uchar uutf uucp uuseg ];
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-lbhqjZxeUqHdd+yahRO+B6L2mc+h+4T2+qKVgWC2HY8=";
+  };
+
+  meta = {
+    description = "Abstract engine for text edition in OCaml";
+    longDescription = ''
+    Zed is an abstract engine for text edition. It can be used to write text editors, edition widgets, readlines, ...
+
+    Zed uses Camomile to fully support the Unicode specification, and implements an UTF-8 encoded string type with validation, and a rope datastructure to achieve efficient operations on large Unicode buffers. Zed also features a regular expression search on ropes.
+
+    To support efficient text edition capabilities, Zed provides macro recording and cursor management facilities.
+    '';
+    homepage = "https://github.com/ocaml-community/zed";
+    changelog = "https://github.com/ocaml-community/zed/blob/${version}/CHANGES.md";
+    license = lib.licenses.bsd3;
+    maintainers = [
+      lib.maintainers.gal_bolle
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zelus-gtk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zelus-gtk/default.nix
new file mode 100644
index 000000000000..759a625d26a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zelus-gtk/default.nix
@@ -0,0 +1,24 @@
+{ buildDunePackage
+, zelus
+, lablgtk
+}:
+
+buildDunePackage {
+  pname = "zelus-gtk";
+  inherit (zelus) version src postPatch;
+
+  minimalOCamlVersion = "4.10";
+
+  nativeBuildInputs = [
+    zelus
+  ];
+
+  buildInputs = [
+    lablgtk
+  ];
+
+  meta = {
+    description = "Zelus GTK library";
+    inherit (zelus.meta) homepage license maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zelus/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zelus/default.nix
new file mode 100644
index 000000000000..07d268d45de9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zelus/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, buildDunePackage
+, fetchFromGitHub
+, menhir
+, menhirLib
+}:
+
+buildDunePackage rec {
+  pname = "zelus";
+  version = "2.2";
+
+  minimalOCamlVersion = "4.08.1";
+
+  src = fetchFromGitHub {
+    owner = "INRIA";
+    repo = "zelus";
+    rev = version;
+    hash = "sha256-NcGX343LProADtzJwlq1kmihLaya1giY6xv9ScvdgTA=";
+  };
+
+  # ./configure: cannot execute: required file not found
+  postPatch = lib.optionalString stdenv.isLinux ''
+    patchShebangs configure
+  '';
+
+  nativeBuildInputs = [
+    menhir
+  ];
+
+  buildInputs = [
+    menhirLib
+  ];
+
+  meta = with lib; {
+    description = "Synchronous language with ODEs";
+    homepage = "https://zelus.di.ens.fr";
+    license = licenses.inria-zelus;
+    mainProgram = "zeluc";
+    maintainers = with maintainers; [ wegank ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zipc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zipc/default.nix
new file mode 100644
index 000000000000..a31d2644e668
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zipc/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl
+, ocaml, findlib, ocamlbuild, topkg, cmdliner
+}:
+
+lib.throwIfNot (lib.versionAtLeast ocaml.version "4.14")
+  "zipc is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-zipc";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/zipc/releases/zipc-${version}.tbz";
+    hash = "sha256-YQqkCURwrJgFH0+zgfket25zJQ4w+Tcc1mTSrDuWRt0=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    ocaml findlib ocamlbuild
+  ];
+
+  buildInputs = [ cmdliner topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "ZIP archive and deflate codec for OCaml";
+    homepage = "https://erratique.ch/software/zipc";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix
new file mode 100644
index 000000000000..abfe608055df
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildDunePackage, dune-configurator, czmq, stdint }:
+
+buildDunePackage rec {
+  pname = "zmq";
+  version = "5.3.0";
+
+  src = fetchurl {
+    url = "https://github.com/issuu/ocaml-zmq/releases/download/${version}/zmq-${version}.tbz";
+    hash = "sha256-tetCmVg27/WHZ+HMwKZVHCrHTzWAlKwkAjNDibB1+6g=";
+  };
+
+  buildInputs = [ czmq dune-configurator ];
+
+  meta = {
+    description = "ZeroMQ bindings for OCaml";
+    license     = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ akavel ];
+    homepage = "https://engineering.issuu.com/ocaml-zmq/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix
new file mode 100644
index 000000000000..1bbc1b7ad63e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix
@@ -0,0 +1,8 @@
+{ buildDunePackage, zmq, lwt }:
+
+buildDunePackage {
+  pname = "zmq-lwt";
+  inherit (zmq) version src meta;
+
+  propagatedBuildInputs = [ zmq lwt ];
+}