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/afl-persistent/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/apron/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/arp/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/astring/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atd/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/awa/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/awa/lwt.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bap/default.nix79
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/base64/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bheap/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bin_prot/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biniou/1.0.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bolt/default.nix66
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bos/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlimages/4.2.4.nix75
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/META6
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix68
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.2.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/default.nix67
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/git.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix46
-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/chacha/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/charInfo_width/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cil/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cmdliner/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix60
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/comparelib/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix27
-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.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/containers/data.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/containers/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cow/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix38
-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.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/1.5.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix50
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/curly/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/curses/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dap/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/diet/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix32
-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.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/client.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/server.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix61
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/duff/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dum/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/duration/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/earley/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eigen/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/either/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/elina/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix62
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eliom/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/emile/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/encore/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/enumerate/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/estring/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/expat/0.9.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/expat/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/expat/unittest.patch15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix28
-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/facile/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faillib/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ff/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fiat-p256/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fieldslib/default.nix29
-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/fmt/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/functory/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gen/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gg/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/cohttp-unix.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/cohttp.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/paf.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/git/unix.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gmetadom/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch18
-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.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/gtktop/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/h2/default.nix59
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hacl_x25519/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/herelib/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hex/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/higlo/install.patch14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/index/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/integers/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/io-page/unix.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iri/default.nix34
-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.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/http.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/layers.nix18
-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.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/irmin/unix.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/iter/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix508
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix863
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/bin_prot.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/core_bench.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix601
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/fieldslib.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage.nix21
-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.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/old.nix639
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-here.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-let.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/sexp.patch30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/sexplib.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/typerep.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/janestreet/variantslib.nix19
-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.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ke/default.nix30
-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.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix8
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix8
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix81
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lacaml/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lens/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix84
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/logs/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lru/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/luv/default.nix35
-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-watcher/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/cstruct.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/macaque/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/magick/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/markup/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mccs/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix29
-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/metrics/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/mirage.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix19
-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/mimic/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix17
-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.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-clock/unix.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-device/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-fs/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix51
-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.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-random/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-stack/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.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix78
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/types-lwt.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mirage/types.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mlgmp/META7
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mlgmp/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mmap/default.nix20
-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/mtime/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix55
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/nocrypto/default.nix71
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/noise/default.nix60
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/notty/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/npy/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/num/default.nix31
-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.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix87
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch84
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix52
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix58
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix22
-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/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix24
-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.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-text/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix12
-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.nix44
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlsdl/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix70
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odate/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odn/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/omd/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-core/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-format/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix26
-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.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opium_kernel/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/optcomp/META12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opti/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/optint/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/otr/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owee/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owl-base/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/owl/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pa_bench/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pa_ounit/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/paf/default.nix84
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parany/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/path_glob/default.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pcre/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix8
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pipebang/default.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/base.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix16
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/posix/types.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pp/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_blob/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix45
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix57
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix73
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppxfind/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix77
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/process/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/prof_spacetime/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/progress/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/psq/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ptset/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/pycaml/default.nix46
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/randomconv/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/re/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/react/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix11
-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.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix23
-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/repr/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/repr/ppx.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix11
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/ezresto-directory.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/ezresto.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/resto/json.nix12
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ringo/lwt.nix17
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rope/default.nix41
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/routes/default.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix23
-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.nix48
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/secp256k1/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sedlex/2.nix67
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/semaphore-compat/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/sha/default.nix29
-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.nix37
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix36
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch7
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/sqlite3EZ/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/srt/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix35
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix75
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/base.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/clic.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/crypto.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/error-monad.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/event-logging.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/lmdb.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/micheline.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/p2p-services.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/p2p.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix19
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix15
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/requester.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/rpc.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/sapling.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/shell-services.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib.nix53
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/test-services.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/version.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tezos/workers.nix18
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/async.nix21
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tls/default.nix52
-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.nix54
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/torch/default.nix60
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/trie/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix42
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/twt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/type_conv/108.08.00.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/type_conv/109.60.01.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/type_conv/112.01.01.nix20
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/typerep/default.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix34
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uri/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix14
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix51
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix24
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix63
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/variantslib/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix47
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vg/default.nix61
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/visitors/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix25
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix49
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/webmachine/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wodan/default.nix40
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wodan/irmin.nix26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/wodan/unix.nix27
-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/xenstore-tool/default.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix30
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xenstore_transport/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix43
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix39
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch26
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix28
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix22
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/z3/default.nix29
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix38
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zed/default.nix33
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix27
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix8
698 files changed, 22416 insertions, 0 deletions
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..5625cd95764f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/afl-persistent/default.nix
@@ -0,0 +1,39 @@
+{ 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";
+  };
+
+  buildInputs = [ 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..bb1b18e3ec19
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl
+, astring, cmdliner, fmt, uuidm, re, stdlib-shims, uutf
+}:
+
+buildDunePackage rec {
+  pname = "alcotest";
+  version = "1.4.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/alcotest/releases/download/${version}/alcotest-mirage-${version}.tbz";
+    sha256 = "sha256:1h9yp44snb6sgm5g1x3wg4gwjscic7i56jf0j8jr07355pxwrami";
+  };
+
+  propagatedBuildInputs = [ astring cmdliner fmt uuidm re stdlib-shims uutf ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/alcotest";
+    description = "A 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..5a57dc0fcc2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/lwt.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, alcotest, logs, ocaml_lwt, fmt
+, re, cmdliner
+}:
+
+buildDunePackage {
+  pname = "alcotest-lwt";
+
+  inherit (alcotest) version src useDune2;
+
+  propagatedBuildInputs = [ alcotest logs ocaml_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..b4ba4246b2cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/alcotest/mirage.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, alcotest, lwt, logs, mirage-clock, duration }:
+
+buildDunePackage {
+  pname = "alcotest-mirage";
+
+  inherit (alcotest) version src useDune2;
+
+  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/angstrom-async/default.nix b/nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix
new file mode 100644
index 000000000000..8c9f97f81abc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-async/default.nix
@@ -0,0 +1,19 @@
+{ lib, fetchFromGitHub, buildDunePackage, angstrom, async }:
+
+buildDunePackage rec {
+  pname = "angstrom-async";
+
+  inherit (angstrom) version useDune2 src;
+
+  minimumOCamlVersion = "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..1bb8833cf079
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix
@@ -0,0 +1,19 @@
+{ lib, fetchFromGitHub, buildDunePackage, angstrom, ocaml_lwt }:
+
+buildDunePackage rec {
+  pname = "angstrom-lwt-unix";
+
+  inherit (angstrom) version useDune2 src;
+
+  minimumOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [ angstrom ocaml_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..af72c7f8d2d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom-unix/default.nix
@@ -0,0 +1,19 @@
+{ lib, fetchFromGitHub, buildDunePackage, angstrom }:
+
+buildDunePackage rec {
+  pname = "angstrom-unix";
+
+  inherit (angstrom) version useDune2 src;
+
+  minimumOCamlVersion = "4.03";
+
+  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..749a043e739e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/angstrom/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, ocaml-syntax-shims, alcotest, result, bigstringaf, ppx_let }:
+
+buildDunePackage rec {
+  pname = "angstrom";
+  version = "0.15.0";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner  = "inhabitedtype";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1hmrkdcdlkwy7rxhngf3cv3sa61cznnd9p5lmqhx20664gx2ibrh";
+  };
+
+  checkInputs = [ alcotest ppx_let ];
+  buildInputs = [ ocaml-syntax-shims ];
+  propagatedBuildInputs = [ bigstringaf result ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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..edd40fb4df29
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ansiterminal/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "ANSITerminal";
+  version = "0.8.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "Chris00";
+    repo = pname;
+    rev = version;
+    sha256 = "0dyjischrgwlxqz1p5zbqq76jvk6pl1qj75i7ydhijssr9pj278d";
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A 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).
+    '';
+    inherit (src.meta) homepage;
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
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..959a7203dfa9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/apron/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchFromGitHub, perl, gmp, mpfr, ppl, ocaml, findlib, camlidl, mlgmpidl }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-apron-${version}";
+  version = "0.9.13";
+  src = fetchFromGitHub {
+    owner = "antoinemine";
+    repo = "apron";
+    rev = "v${version}";
+    sha256 = "14ymjahqdxj26da8wik9d5dzlxn81b3z1iggdl7rn2nn06jy7lvy";
+  };
+
+  buildInputs = [ perl gmp mpfr ppl ocaml findlib camlidl ];
+  propagatedBuildInputs = [ mlgmpidl ];
+
+  outputs = [ "out" "bin" "dev" ];
+
+  configurePhase = ''
+    runHook preConfigure
+    ./configure -prefix $out
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+    runHook postConfigure
+  '';
+
+  postInstall = ''
+    mkdir -p $dev/lib
+    mv $out/lib/ocaml $dev/lib/
+    mkdir -p $bin
+    mv $out/bin $bin/
+  '';
+
+  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..d900f2b772e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/arp/default.nix
@@ -0,0 +1,55 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, ipaddr, macaddr, logs, lwt, duration
+, mirage-time, mirage-protocols, mirage-profile
+, alcotest, ethernet, fmt, mirage-vnetif, mirage-random
+, mirage-random-test, mirage-clock-unix, mirage-time-unix
+, bisect_ppx
+}:
+
+buildDunePackage rec {
+  pname = "arp";
+  version = "2.3.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "1s09ibj9v6pp2ckn96wxmn3mjifcj97asls5xc4zg75pflk0grgz";
+  };
+
+  minimumOCamlVersion = "4.06";
+  useDune2 = true;
+
+  nativeBuildInputs = [
+    bisect_ppx
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+    duration
+    ipaddr
+    logs
+    lwt
+    macaddr
+    mirage-profile
+    mirage-protocols
+    mirage-time
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    ethernet
+    mirage-clock-unix
+    mirage-profile
+    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/asn1-combinators/default.nix b/nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix
new file mode 100644
index 000000000000..289f6a6cba4b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/asn1-combinators/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, zarith, bigarray-compat, stdlib-shims, ptime, alcotest
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.05";
+
+  pname = "asn1-combinators";
+  version = "0.2.5";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-asn1-combinators/releases/download/v${version}/asn1-combinators-v${version}.tbz";
+    sha256 = "1pbcdwm12hnfpd1jv2b7cjfkj5r7h61xp2gr8dysb8waa455kwln";
+  };
+
+  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..ba8cd98327fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/astring/default.nix
@@ -0,0 +1,47 @@
+{ 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 {
+  name = "ocaml${ocaml.version}-astring-${param.version}";
+  inherit (param) version;
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/astring/releases/astring-${param.version}.tbz";
+    inherit (param) sha256;
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  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..de6ade61518a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atd/default.nix
@@ -0,0 +1,31 @@
+{ lib, menhir, easy-format, fetchurl, buildDunePackage, which, re, nixosTests }:
+
+buildDunePackage rec {
+  pname = "atd";
+  version = "2.2.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/ahrefs/atd/releases/download/2.2.1/atd-2.2.1.tbz";
+    sha256 = "17jm79np69ixp53a4njxnlb1pg8sd1g47nm3nyki9clkc8d4qsyv";
+  };
+
+  buildInputs = [ which menhir ];
+  propagatedBuildInputs = [ easy-format re ];
+
+  doCheck = true;
+
+  passthru.tests = {
+    smoke-test = nixosTests.atd;
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/mjambon/atd";
+    description = "Syntax for cross-language type definitions";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ aij jwilberding ];
+  };
+}
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..2537c92d97a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/atdgen/default.nix
@@ -0,0 +1,26 @@
+{ buildDunePackage, atd, biniou, yojson }:
+
+let runtime =
+  buildDunePackage {
+    pname = "atdgen-runtime";
+    inherit (atd) version useDune2 src;
+
+    propagatedBuildInputs = [ biniou yojson ];
+
+    meta = { inherit (atd.meta) license; };
+  }
+; in
+
+buildDunePackage {
+  pname = "atdgen";
+  inherit (atd) version useDune2 src;
+
+  buildInputs = [ atd ];
+
+  propagatedBuildInputs = [ runtime ];
+
+  meta = {
+    description = "Generates efficient JSON serializers, deserializers and validators";
+    inherit (atd.meta) license;
+  };
+}
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..14f99bb6f8db
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/awa/default.nix
@@ -0,0 +1,38 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_sexp_conv, ppx_cstruct
+, mirage-crypto, mirage-crypto-rng, mirage-crypto-pk
+, x509, cstruct, cstruct-unix, cstruct-sexp, sexplib
+, rresult, mtime, logs, fmt, cmdliner, base64, hacl_x25519
+, zarith
+}:
+
+buildDunePackage rec {
+  pname = "awa";
+  version = "0.0.3";
+
+  minimumOCamlVersion = "4.07";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/awa-ssh/releases/download/v${version}/awa-v${version}.tbz";
+    sha256 = "5a7927363ffe672cccf12d5425386e84f6f553a17ffec2b01ae5dc28180c831a";
+  };
+
+  nativeBuildInputs = [ ppx_sexp_conv ppx_cstruct ];
+
+  propagatedBuildInputs = [
+    mirage-crypto mirage-crypto-rng mirage-crypto-pk x509
+    cstruct cstruct-sexp sexplib rresult mtime
+    logs base64 hacl_x25519 zarith
+  ];
+
+  doCheck = true;
+  checkInputs = [ cstruct-unix cmdliner fmt ];
+
+  meta = with lib; {
+    description = "SSH implementation in OCaml";
+    license = licenses.isc;
+    homepage = "https://github.com/mirage/awa-ssh";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/awa/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/awa/lwt.nix
new file mode 100644
index 000000000000..00be799ddff2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/awa/lwt.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, awa
+, cstruct, mtime, lwt, cstruct-unix, mirage-crypto-rng
+}:
+
+buildDunePackage {
+  pname = "awa-lwt";
+
+  inherit (awa) version src useDune2;
+
+  propagatedBuildInputs = [
+    awa cstruct mtime lwt cstruct-unix mirage-crypto-rng
+  ];
+
+  inherit (awa) meta;
+}
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..4f9b425f8a01
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/awa/mirage.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, awa
+, cstruct, mtime, lwt, mirage-flow, mirage-clock, logs
+}:
+
+buildDunePackage {
+  pname = "awa-mirage";
+
+  inherit (awa) version src useDune2;
+
+  propagatedBuildInputs = [
+    awa cstruct mtime lwt mirage-flow mirage-clock logs
+  ];
+
+  inherit (awa) meta;
+}
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..c1cb7de2d188
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bap/default.nix
@@ -0,0 +1,79 @@
+{ lib, stdenv, fetchFromGitHub, fetchurl
+, ocaml, findlib, ocamlbuild, ocaml_oasis
+, bitstring, camlzip, cmdliner, core_kernel, ezjsonm, fileutils, ocaml_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.versionAtLeast ocaml.version "4.08"
+then throw "BAP is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-bap-${version}";
+  version = "2.2.0";
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = "bap";
+    rev = "v${version}";
+    sha256 = "0c53sps6ba9n5cjdmapi8ylzlpcc11pksijp9swzlwgxyz5d276f";
+  };
+
+  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/${name}/"
+    export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/${name}-llvm-plugins/"
+  '';
+
+  nativeBuildInputs = [ which makeWrapper ];
+
+  buildInputs = [ ocaml findlib ocamlbuild ocaml_oasis
+                  linenoise
+                  ounit
+                  ppx_bitstring
+                  z3
+                  utop libxml2 ncurses ];
+
+  propagatedBuildInputs = [ bitstring camlzip cmdliner ppx_bap core_kernel ezjsonm fileutils ocaml_lwt ocamlgraph ocurl re uri zarith piqi parsexp
+                            piqi-ocaml uuidm frontc yojson ];
+
+  installPhase = ''
+    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
+  '';
+
+  disableIda = "--disable-ida";
+
+  patches = [ ./curses_is_ncurses.patch ];
+
+  preConfigure = ''
+    substituteInPlace oasis/elf-loader --replace bitstring.ppx ppx_bitstring
+  '';
+
+  configureFlags = [ "--enable-everything ${disableIda}" "--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/";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.mit;
+  };
+}
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..efb7f41b95dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/base64/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, ocaml, alcotest, bos, rresult }:
+
+buildDunePackage rec {
+  pname = "base64";
+  version = "3.5.0";
+
+  minimumOCamlVersion = "4.03";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-base64/releases/download/v${version}/base64-v${version}.tbz";
+    sha256 = "sha256-WJ3pwAV46/54QZismBjTWGxHSyMWts0+HEbMsfYq46Q=";
+  };
+
+  # otherwise fmt breaks evaluation
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  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..7785a70e0509
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/batteries/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, qtest, num }:
+
+let version = "3.3.0"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-batteries-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-batteries-team/batteries-included/releases/download/v${version}/batteries-${version}.tar.gz";
+    sha256 = "002pqkcg18zx59hsf172wg6s7lwsiagp5sfvf5yssp7xxal5jdgx";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  checkInputs = [ qtest ];
+  propagatedBuildInputs = [ num ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.04" && !stdenv.isAarch64;
+  checkTarget = "test";
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://batteries.forge.ocamlcore.org/";
+    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;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
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..07432dd7c6e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/benchmark/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, ocaml_pcre }:
+
+let version = "1.4"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-benchmark-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/Chris00/ocaml-benchmark/releases/download/${version}/benchmark-${version}.tar.gz";
+    sha256 = "16wi8ld7c3mq77ylpgbnj8qqqqimyzwxs47v06vyrwpma5pab5xa";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ocaml_pcre ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://ocaml-benchmark.forge.ocamlcore.org/";
+    platforms = ocaml.meta.platforms or [];
+    description = "Benchmark running times of code";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ volth ];
+  };
+}
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..487249ce5ae5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigarray-compat/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "bigarray-compat";
+  version = "1.0.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "06j1dwlpisxshdd0nab4n4x266gg1s1n8na16lpgw3fvcznwnimz";
+  };
+
+  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..e02b1159a9c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigarray-overlap/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl
+, bigarray-compat, alcotest, astring, fpath, bos, findlib, pkg-config
+}:
+
+buildDunePackage rec {
+  pname = "bigarray-overlap";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/overlap/releases/download/v${version}/bigarray-overlap-v${version}.tbz";
+    sha256 = "1v86avafsbyxjccy0y9gny31s2jzb0kd42v3mhcalklx5f044lcy";
+  };
+
+  minimumOCamlVersion = "4.07";
+  useDune2 = true;
+
+  propagatedBuildInputs = [ bigarray-compat ];
+
+  checkInputs = [ alcotest astring fpath bos findlib pkg-config ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/dinosaure/overlap";
+    description = "A 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..f966e0b90b1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigstring/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "bigstring";
+  version = "0.3";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  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..852459c2bac1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bigstringaf/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigarray-compat }:
+
+buildDunePackage rec {
+  pname = "bigstringaf";
+  version = "0.7.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    sha256 = "1q1sqxzdnlrpl95ccrhl7lwy3zswgd9rbn19ildclh0lyi2vazbj";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ bigarray-compat ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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/bin_prot/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bin_prot/default.nix
new file mode 100644
index 000000000000..50ef935aff6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bin_prot/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildOcaml, fetchurl, ocaml, type_conv }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "bin_prot-112.24.00 is not available for OCaml ${ocaml.version}"
+else
+
+buildOcaml rec {
+  name = "bin_prot";
+  version = "112.24.00";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/bin_prot/archive/${version}.tar.gz";
+    sha256 = "dc0c978a825c7c123990af3317637c218f61079e6f35dc878260651084f1adb4";
+  };
+
+  propagatedBuildInputs = [ type_conv ];
+
+  hasSharedObjects = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/bin_prot";
+    description = "Binary protocol generator ";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/biniou/1.0.nix b/nixpkgs/pkgs/development/ocaml-modules/biniou/1.0.nix
new file mode 100644
index 000000000000..795e63401290
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biniou/1.0.nix
@@ -0,0 +1,36 @@
+{lib, stdenv, fetchurl, ocaml, findlib, easy-format}:
+let
+  pname = "biniou";
+  version = "1.0.9";
+  webpage = "http://mjambon.com/${pname}.html";
+in
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "3.11";
+
+stdenv.mkDerivation rec {
+
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://mjambon.com/releases/${pname}/${name}.tar.gz";
+    sha256 = "14j3hrhbjqxbizr1pr8fcig9dmfzhbjjwzwyc99fcsdic67w8izb";
+  };
+
+  buildInputs = [ ocaml findlib easy-format ];
+
+  createFindlibDestdir = true;
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  preBuild = ''
+    mkdir $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
+    homepage = webpage;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..535b34b03dcd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biniou/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, easy-format }:
+
+buildDunePackage rec {
+  pname = "biniou";
+  version = "1.2.1";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    sha256 = "0x2kiy809n1j0yf32l7hj102y628jp5jdrkbi3z7ld8jq04h1790";
+  };
+
+  propagatedBuildInputs = [ easy-format ];
+
+  postPatch = ''
+   patchShebangs .
+  '';
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.bsd3;
+  };
+}
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..596ed6161d7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/biocaml/default.nix
@@ -0,0 +1,30 @@
+{ 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.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "biocaml";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "1il84vvypgkhdyc2j5fmgh14a58069s6ijbd5dvyl2i7jdxaazji";
+  };
+
+  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/bisect_ppx/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bisect_ppx/default.nix
new file mode 100644
index 000000000000..ddeda86e9bf7
--- /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.6.1";
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = "bisect_ppx";
+    rev = version;
+    sha256 = "sha256-YeLDlH3mUbVEY4OmzlrvSwVUav3uMtSsTFlOsQKnz84=";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  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.";
+    license = licenses.mit;
+    homepage = "https://github.com/aantron/bisect_ppx";
+    maintainers = with maintainers; [ ];
+  };
+}
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..197a3eaf69dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bistro/default.nix
@@ -0,0 +1,41 @@
+{ lib, fetchFromGitHub, fetchpatch, buildDunePackage
+, base64, bos, core, lwt_react, ocamlgraph, rresult, tyxml
+}:
+
+buildDunePackage rec {
+  pname = "bistro";
+  version = "0.5.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "pveber";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "114gq48cpj2mvycypa9lfyqqb26wa2gkdfwkcqhnx7m6sdwv9a38";
+  };
+
+  patches = [
+  # The following patch adds support for core.v0.13
+  (fetchpatch {
+    url = "https://github.com/pveber/bistro/commit/0931db43a146ad7829dff5120161a775f732a878.patch";
+    sha256 = "06y0sxbbab1mssc1xfjjv12lpv4rny5iqv9qkdqyzrvzpl1bdvnd";
+  })
+  # The following patch adds support for core.v0.14
+  (fetchpatch {
+    url = "https://github.com/pveber/bistro/commit/afbdcb2af7777ef7711c7f3c45dff605350a27b2.patch";
+    sha256 = "0ix6lx9qjnn3vqp0164c6l5an8b4rq69h2mxrg89piyk2g1yv0zg";
+  })
+  ];
+
+  propagatedBuildInputs = [ base64 bos core lwt_react ocamlgraph rresult tyxml ];
+
+  minimumOCamlVersion = "4.08";
+
+  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/bitstring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bitstring/default.nix
new file mode 100644
index 000000000000..12ed4ae787da
--- /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.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "xguerin";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0mghsl8b2zd2676mh1r9142hymhvzy9cw8kgkjmirxkn56wbf56b";
+  };
+
+  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..4d391d3458dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bitstring/ppx.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, ocaml
+, bitstring, ppxlib
+, ounit
+}:
+
+if !lib.versionAtLeast 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 useDune2 src;
+
+  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..23e8d145a308
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bitv/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchzip, autoreconfHook, which, ocaml, findlib }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "bitv is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-bitv-${version}";
+  version = "1.3";
+
+  src = fetchzip {
+    url = "https://github.com/backtracking/bitv/archive/${version}.tar.gz";
+    sha256 = "0vkh1w9fpi5m1sgiqg6r38j3fqglhdajmbyiyr91113lrpljm75i";
+  };
+
+  buildInputs = [ autoreconfHook which ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "A 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/bls12-381/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix
new file mode 100644
index 000000000000..08bb426d8abc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bls12-381/default.nix
@@ -0,0 +1,38 @@
+{ lib, fetchFromGitLab, buildDunePackage, ff, zarith, ctypes, tezos-rust-libs, alcotest }:
+
+buildDunePackage rec {
+  pname = "bls12-381";
+  version = "0.3.15";
+
+  src = fetchFromGitLab {
+    owner = "dannywillems";
+    repo = "ocaml-bls12-381";
+    rev = version;
+    sha256 = "1s8n657fsl2gs01p7v2ffpcfzymavifhhpriyx1gq5qh4zvvw4vr";
+  };
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+  propagatedBuildInputs = [
+    ff
+    zarith
+    ctypes
+    tezos-rust-libs
+  ];
+
+  checkInputs = [
+    alcotest
+  ];
+
+  # This is a hack to work around the hack used in the dune files
+  OPAM_SWITCH_PREFIX = "${tezos-rust-libs}";
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/dannywillems/ocaml-bls12-381";
+    description = "OCaml binding for bls12-381 from librustzcash";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/bolt/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bolt/default.nix
new file mode 100644
index 000000000000..ea32d659f646
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bolt/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, which, camlp4 }:
+
+let inherit (lib) getVersion versionAtLeast; in
+
+assert versionAtLeast (getVersion ocaml) "4.00.0";
+assert versionAtLeast (getVersion findlib) "1.3.3";
+
+if versionAtLeast ocaml.version "4.06"
+then throw "bolt is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+
+  name = "bolt-1.4";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/1043/${name}.tar.gz";
+    sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild which camlp4 ];
+
+  patches = [ (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/bolt/bolt.1.4/files/opam.patch";
+      sha256 = "08cl39r98w312sw23cskd5wian6zg20isn9ki41hnbcgkazhi7pb";
+    })
+  ];
+
+  postPatch = ''
+    patch myocamlbuild.ml <<EOF
+70,74c70
+<         let camlp4of =
+<           try
+<             let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
+<             Filename.concat path_bin "camlp4of"
+<           with _ -> "camlp4of" in
+---
+>         let camlp4of = "camlp4of" in
+EOF
+  '';
+
+  # The custom `configure` script does not expect the --prefix
+  # option. Installation is handled by ocamlfind.
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  createFindlibDestdir = true;
+
+  buildFlags = [ "all" ];
+
+  doCheck = true;
+  checkTarget = "tests";
+
+  meta = with lib; {
+    homepage = "http://bolt.x9c.fr";
+    description = "A logging tool for the OCaml language";
+    longDescription = ''
+      Bolt is a logging tool for the OCaml language. It is inspired by and
+      modeled after the famous log4j logging framework for Java.
+    '';
+    license = licenses.lgpl3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
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..62438526d703
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bos/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, astring, fmt, fpath, logs, rresult
+}:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-bos-${version}";
+  version = "0.2.0";
+  src = fetchurl {
+    url = "https://erratique.ch/software/bos/releases/bos-${version}.tbz";
+    sha256 = "1s10iqx8rgnxr5n93lf4blwirjf8nlm272yg5sipr7lsr35v49wc";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg ];
+  propagatedBuildInputs = [ astring fmt fpath logs rresult ];
+
+  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/bz2/default.nix b/nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix
new file mode 100644
index 000000000000..52a92d3a8d40
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/bz2/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+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
+  ];
+
+  buildInputs = [
+    ocaml
+    findlib
+  ];
+
+  propagatedBuildInputs = [
+    bzip2
+  ];
+
+  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; [ superherointj ];
+  };
+}
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..31dea9201bbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ca-certs-nss/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, rresult
+, mirage-crypto
+, mirage-clock
+, x509
+, logs
+, fmt
+, hex
+, bos
+, astring
+, cmdliner
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "ca-certs-nss";
+  version = "3.66";
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ca-certs-nss/releases/download/v${version}/ca-certs-nss-v${version}.tbz";
+    sha256 = "f0f8035b470f2a48360b92d0e6287f41f98e4ba71576a1cd4c9246c468932f09";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    rresult
+    mirage-crypto
+    mirage-clock
+    x509
+  ];
+
+  buildInputs = [
+    logs
+    fmt
+    hex
+    bos
+    astring
+    cmdliner
+  ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = with lib; {
+    license = licenses.isc;
+    description = "X.509 trust anchors extracted from Mozilla's NSS";
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/ca-certs-nss";
+  };
+}
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..acf869dbd275
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ca-certs/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchurl
+, bos, fpath, rresult, ptime, mirage-crypto, x509, astring, logs
+, cacert, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "ca-certs";
+  version = "0.2.1";
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ca-certs/releases/download/v${version}/ca-certs-v${version}.tbz";
+    sha256 = "d43109496a5129feff967d557c556af96f8b10456896a405c43b7cf0c35d0af3";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ bos fpath rresult ptime mirage-crypto x509 astring logs ];
+
+  doCheck = true;
+  checkInputs = [
+    cacert    # for /etc/ssl/certs/ca-bundle.crt
+    alcotest
+  ];
+
+  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..0a9922f67885
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cairo2/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchurl, buildDunePackage, ocaml, dune-configurator, pkg-config, cairo }:
+
+buildDunePackage rec {
+  pname = "cairo2";
+  version = "0.6.2";
+
+  src = fetchurl {
+    url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tbz";
+    sha256 = "sha256-a7P1kiVmIwT6Fhtwxs29ffgO4iexsulxUoc9cnJmEK4=";
+  };
+
+  minimalOCamlVersion = "4.02";
+  useDune2 = true;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ cairo dune-configurator ];
+
+  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..1210ed41dc2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/calendar/default.nix
@@ -0,0 +1,23 @@
+{stdenv, lib, fetchurl, ocaml, findlib}:
+
+stdenv.mkDerivation {
+  name = "ocaml-calendar-2.5";
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/915/calendar-2.5.tar.bz2";
+    sha256 = "04pvhwb664g3s644c7v7419a3kvf5s3pynkhmk5j59dvlfm1yf0f";
+    };
+
+  buildInputs = [ocaml findlib];
+
+  createFindlibDestdir = true;
+
+  meta =  {
+    homepage = "https://forge.ocamlcore.org/projects/calendar/";
+    description = "An Objective Caml library managing dates and times";
+    license = "LGPL";
+    platforms = ocaml.meta.platforms or [];
+    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..a9dfb80f2a11
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/callipyge/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ocaml
+
+, 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";
+    sha256 = "sha256-T/94a88xvK51TggjXecdKc9kyTE9aIyueIt5T24sZB0=";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [ fmt eqaf ];
+
+  # 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/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/4.2.4.nix b/nixpkgs/pkgs/development/ocaml-modules/camlimages/4.2.4.nix
new file mode 100644
index 000000000000..8ed562a27e69
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlimages/4.2.4.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, ocaml
+, findlib
+, omake
+, graphicsmagick
+, libpng
+, libjpeg
+, libexif
+, libtiff
+, libXpm
+, freetype
+, giflib
+, ghostscript
+}:
+
+assert lib.versionOlder ocaml.version "4.06";
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  pname = "camlimages";
+  version = "4.2.4";
+
+  src = fetchFromGitLab {
+    owner = "camlspotter";
+    repo = pname;
+    rev = "c4f0ec4178fd18cb85872181965c5f020c349160";
+    sha256 = "17hvsql5dml7ialjcags8wphs7w6z88b2rgjir1382bg8vn62bkr";
+  };
+
+  nativeBuildInputs = [
+    omake
+    ocaml
+    findlib
+    graphicsmagick
+  ];
+
+  propagatedBuildInputs = [
+    libpng
+    libjpeg
+    libexif
+    libtiff
+    libXpm
+    freetype
+    giflib
+    ghostscript
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+    omake
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preBuild
+    omake install
+    runHook postBuild
+  '';
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    # 4.2.5 requires OCaml >= 4.06
+    branch = "4.2.4";
+    homepage = "https://gitlab.com/camlspotter/camlimages";
+    description = "OCaml image processing library";
+    license = licenses.lgpl2Only;
+    maintainers = [
+      maintainers.vbgl
+      maintainers.sternenseemann
+    ];
+  };
+}
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..ba36cfa05b99
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlimages/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitLab, buildDunePackage, dune-configurator, cppo
+, graphics, lablgtk, stdio
+}:
+
+buildDunePackage rec {
+  pname = "camlimages";
+  version = "5.0.4";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchFromGitLab {
+    owner = "camlspotter";
+    repo = pname;
+    rev = version;
+    sha256 = "1m2c76ghisg73dikz2ifdkrbkgiwa0hcmp21f2fm2rkbf02rq3f4";
+  };
+
+  buildInputs = [ dune-configurator cppo 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/camlpdf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix
new file mode 100644
index 000000000000..f496ce91c826
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlpdf/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "camlpdf is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "2.4";
+  name = "ocaml${ocaml.version}-camlpdf-${version}";
+  src = fetchFromGitHub {
+    owner = "johnwhitington";
+    repo = "camlpdf";
+    rev = "v${version}";
+    sha256 = "09kzrgmlxb567315p3fy59ba0kv7xhp548n9i3l4wf9n06p0ww9m";
+  };
+
+  buildInputs = [ which ocaml findlib ];
+
+  preInstall = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+  '';
+
+  meta = with lib; {
+    description = "An 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..c2c2e98b2e06
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camlzip/default.nix
@@ -0,0 +1,68 @@
+{lib, stdenv, fetchurl, zlib, ocaml, findlib}:
+
+let
+  param =
+    if lib.versionAtLeast ocaml.version "4.02"
+    then {
+      version = "1.10";
+      url = "https://github.com/xavierleroy/camlzip/archive/rel110.tar.gz";
+      sha256 = "X0YcczaQ3lFeJEiTIgjSSZ1zi32KFMtmZsP0FFpyfbI=";
+      patches = [];
+      postPatchInit = ''
+        cp META-zip META-camlzip
+        echo 'directory="../zip"' >> META-camlzip
+      '';
+    } 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 = "camlzip";
+  version = param.version;
+
+  src = fetchurl {
+    inherit (param) url;
+    inherit (param) sha256;
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  propagatedBuildInputs = [zlib];
+
+  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 = "A 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";
+    platforms = ocaml.meta.platforms or [];
+    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.2.nix b/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.2.nix
new file mode 100644
index 000000000000..79c7a46e6e99
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.2.nix
@@ -0,0 +1,30 @@
+{stdenv, lib, fetchurl, ocaml, findlib, camlp4}:
+
+if lib.versionAtLeast ocaml.version "4.05"
+then throw "camomile-0.8.2 is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  pname = "camomile";
+  version = "0.8.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/camomile/camomile-${version}.tar.bz2";
+    sha256 = "0x43pjxx70kgip86mmdn08s97k4qzdqc8i79xfyyx28smy1bsa00";
+  };
+
+  buildInputs = [ocaml findlib camlp4];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://camomile.sourceforge.net/";
+    description = "A comprehensive Unicode library for OCaml";
+    license = lib.licenses.lgpl21;
+    branch = "0.8.2";
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
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..67bd8b8c755d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camomile/0.8.5.nix
@@ -0,0 +1,30 @@
+{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";
+  })];
+
+  buildInputs = [ocaml findlib camlp4];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://github.com/yoriyuki/Camomile/tree/master/Camomile";
+    description = "A comprehensive Unicode library for OCaml";
+    license = lib.licenses.lgpl21;
+    platforms = ocaml.meta.platforms or [];
+    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..090b96ece0cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/camomile/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, cppo }:
+
+buildDunePackage rec {
+  pname = "camomile";
+  version = "1.0.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "yoriyuki";
+    repo = pname;
+    rev = version;
+    sha256 = "00i910qjv6bpk0nkafp5fg97isqas0bwjf7m6rz11rsxilpalzad";
+  };
+
+  buildInputs = [ cppo ];
+
+  configurePhase = ''
+    runHook preConfigure
+    ocaml configure.ml --share $out/share/camomile
+    runHook postConfigure
+  '';
+
+  meta = {
+    inherit (src.meta) homepage;
+    maintainers = [ lib.maintainers.vbgl ];
+    license = lib.licenses.lgpl21;
+    description = "A Unicode library for OCaml";
+  };
+}
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..0e0da6a94bb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/async.nix
@@ -0,0 +1,11 @@
+{ lib, buildDunePackage, async_kernel, async_unix, caqti, core_kernel }:
+
+buildDunePackage {
+  pname = "caqti-async";
+  useDune2 = true;
+  inherit (caqti) version src;
+
+  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..105a6a9dfe18
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, cppo, logs, ptime, uri }:
+
+buildDunePackage rec {
+  pname = "caqti";
+  version = "1.5.1";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner = "paurkedal";
+    repo = "ocaml-${pname}";
+    rev = "v${version}";
+    sha256 = "1vl61kdyj89whc3mh4k9bis6rbj9x2scf6hnv9afyalp4j65sqx1";
+  };
+
+  buildInputs = [ cppo ];
+  propagatedBuildInputs = [ logs ptime uri ];
+
+  meta = {
+    description = "Unified interface to relational database libraries";
+    license = "LGPL-3.0-or-later WITH OCaml-LGPL-linking-exception";
+    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..5f4f681540e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, caqti, mariadb }:
+
+buildDunePackage {
+  pname = "caqti-driver-mariadb";
+  useDune2 = true;
+  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..a1b427a5edf4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, caqti, postgresql }:
+
+buildDunePackage {
+  pname = "caqti-driver-postgresql";
+  useDune2 = true;
+  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..5282ba5ef505
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, caqti, ocaml_sqlite3 }:
+
+buildDunePackage {
+  pname = "caqti-driver-sqlite3";
+  useDune2 = true;
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti ocaml_sqlite3 ];
+
+  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..6ed86683728b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/dynload.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, caqti }:
+
+buildDunePackage {
+  pname = "caqti-dynload";
+  useDune2 = true;
+  inherit (caqti) version src;
+
+  propagatedBuildInputs = [ caqti ];
+
+  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..f02fa377f806
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/lwt.nix
@@ -0,0 +1,11 @@
+{ lib, buildDunePackage, caqti, logs, lwt }:
+
+buildDunePackage {
+  pname = "caqti-lwt";
+  useDune2 = true;
+  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..d2050e2cf474
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/caqti/type-calendar.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, calendar, caqti }:
+
+buildDunePackage {
+  pname = "caqti-type-calendar";
+  version = "1.2.0";
+  useDune2 = true;
+  inherit (caqti) src;
+
+  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/default.nix b/nixpkgs/pkgs/development/ocaml-modules/carton/default.nix
new file mode 100644
index 000000000000..81893ae9ac36
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/default.nix
@@ -0,0 +1,67 @@
+{ lib, buildDunePackage, fetchurl
+, ke, duff, decompress, cstruct, optint, bigstringaf, stdlib-shims
+, bigarray-compat, checkseum, logs, psq, fmt
+, result, rresult, fpath, base64, bos, digestif, mmap, alcotest
+, crowbar, alcotest-lwt, lwt, findlib, mirage-flow, cmdliner, hxd
+}:
+
+buildDunePackage rec {
+  pname = "carton";
+  version = "0.4.2";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-git/releases/download/${pname}-v${version}/${pname}-${pname}-v${version}.tbz";
+    sha256 = "a0a03b2f7bb7dafe070bc6a74583b6d6da714d2c636dd4d5a6443c9f299ceacc";
+  };
+
+  # remove changelogs for mimic and the git* packages
+  postPatch = ''
+    rm CHANGES.md
+  '';
+
+  buildInputs = [
+    cmdliner
+    digestif
+    mmap
+    result
+    rresult
+    fpath
+    bos
+    hxd
+  ];
+  propagatedBuildInputs = [
+    ke
+    duff
+    decompress
+    cstruct
+    optint
+    bigstringaf
+    stdlib-shims
+    bigarray-compat
+    checkseum
+    logs
+    psq
+    fmt
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    base64
+    alcotest
+    alcotest-lwt
+    crowbar
+    lwt
+    findlib
+    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..ef41ff2b5947
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/git.nix
@@ -0,0 +1,28 @@
+{ buildDunePackage, carton, carton-lwt
+, bigarray-compat, bigstringaf, lwt, fpath, result
+, mmap, fmt, decompress, astring
+, alcotest, alcotest-lwt, cstruct, logs
+, mirage-flow, rresult, ke
+}:
+
+buildDunePackage {
+  pname = "carton-git";
+
+  inherit (carton) version src useDune2 minimumOCamlVersion postPatch;
+
+  propagatedBuildInputs = [
+    carton
+    carton-lwt
+    bigarray-compat
+    bigstringaf
+    lwt
+    fpath
+    result
+    mmap
+    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..024ff51559e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/carton/lwt.nix
@@ -0,0 +1,46 @@
+{ buildDunePackage, carton
+, lwt, decompress, optint, bigstringaf
+, alcotest, alcotest-lwt, cstruct, fmt, logs
+, mirage-flow, result, rresult, bigarray-compat
+, ke, base64, bos, checkseum, digestif, fpath, mmap
+, stdlib-shims
+, git-binary # pkgs.git
+}:
+
+buildDunePackage {
+  pname = "carton-lwt";
+
+  inherit (carton) version src useDune2 minimumOCamlVersion postPatch;
+
+  propagatedBuildInputs = [
+    carton
+    lwt
+    decompress
+    optint
+    bigstringaf
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    git-binary
+    alcotest
+    alcotest-lwt
+    cstruct
+    fmt
+    logs
+    mirage-flow
+    result
+    rresult
+    bigarray-compat
+    ke
+    base64
+    bos
+    checkseum
+    digestif
+    fpath
+    mmap
+    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..303fdc01011d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cfstream/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, fetchFromGitHub, m4, core_kernel, ounit }:
+
+buildDunePackage rec {
+  pname = "cfstream";
+  version = "1.3.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04.1";
+
+  src = fetchFromGitHub {
+    owner = "biocaml";
+    repo   = pname;
+    rev    = version;
+    sha256 = "0qnxfp6y294gjsccx7ksvwn9x5q20hi8sg24rjypzsdkmlphgdnd";
+  };
+
+  patches = [ ./git_commit.patch ];
+
+  buildInputs = [ m4 ];
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ core_kernel ];
+
+  doCheck = true;
+
+  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/chacha/default.nix b/nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix
new file mode 100644
index 000000000000..21bae79ab5f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/chacha/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ocaml
+
+, alcotest
+, cstruct
+, mirage-crypto
+}:
+
+buildDunePackage rec {
+  pname = "chacha";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/abeaumont/ocaml-chacha/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "sha256-t8dOMQQDpje0QbuOhjSIa3xnXuXcxMVTLENa/rwdgA4=";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  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/charInfo_width/default.nix b/nixpkgs/pkgs/development/ocaml-modules/charInfo_width/default.nix
new file mode 100644
index 000000000000..5b9814cea69a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/charInfo_width/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchzip, buildDunePackage, camomile, result }:
+
+buildDunePackage rec {
+  pname = "charInfo_width";
+  version = "1.1.0";
+  useDune2 = true;
+  src = fetchzip {
+    url = "https://bitbucket.org/zandoye/charinfo_width/get/${version}.tar.bz2";
+    sha256 = "19mnq9a1yr16srqs8n6hddahr4f9d2gbpmld62pvlw1ps7nfrp9w";
+  };
+
+  propagatedBuildInputs = [ camomile result ];
+
+  meta = {
+    homepage = "https://bitbucket.org/zandoye/charinfo_width/";
+    description = "Determine column width for a character";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..3483af1dd416
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/checkseum/default.nix
@@ -0,0 +1,49 @@
+{ lib, fetchurl, buildDunePackage, dune-configurator, pkg-config
+, bigarray-compat, optint
+, fmt, rresult, bos, fpath, astring, alcotest
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  version = "0.3.2";
+  pname = "checkseum";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/checkseum/releases/download/v${version}/checkseum-v${version}.tbz";
+    sha256 = "9cdd282ea1cfc424095d7284e39e4d0ad091de3c3f2580539d03f6966d45ccd5";
+  };
+
+  nativeBuildInputs = [
+    dune-configurator
+    pkg-config
+  ];
+  propagatedBuildInputs = [
+    bigarray-compat
+    optint
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  checkInputs = [
+    alcotest
+    bos
+    astring
+    fmt
+    fpath
+    rresult
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/mirage/checkseum";
+    description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..3aefe2eb874c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cil/default.nix
@@ -0,0 +1,31 @@
+{ 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 {
+  name = "ocaml-cil-1.7.3";
+  src = fetchurl {
+    url = "mirror://sourceforge/cil/cil-1.7.3.tar.gz";
+    sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9";
+  };
+
+  buildInputs = [ perl ocaml findlib ocamlbuild ];
+
+  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 = "A 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/cmdliner/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/default.nix
new file mode 100644
index 000000000000..7e49679406ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cmdliner/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
+
+let
+  pname = "cmdliner";
+in
+
+assert lib.versionAtLeast ocaml.version "4.01.0";
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.03" then {
+    version = "1.0.4";
+    sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw";
+  } else {
+    version = "1.0.2";
+    sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1";
+  }
+; in
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  inherit (param) version;
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ topkg ];
+  propagatedBuildInputs = [ result ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/cmdliner";
+    description = "An OCaml module for the declarative definition of command line interfaces";
+    license = licenses.bsd3;
+    platforms = ocaml.meta.platforms or [];
+    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..060d2c6fb6a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/async.nix
@@ -0,0 +1,60 @@
+{ lib
+, buildDunePackage
+, ppx_sexp_conv
+, base
+, async
+, async_kernel
+, async_unix
+, cohttp
+, conduit-async
+, uri
+, uri-sexp
+, logs
+, fmt
+, sexplib0
+, ipaddr
+, magic-mime
+, ounit
+, mirage-crypto
+, core
+}:
+
+buildDunePackage {
+  pname = "cohttp-async";
+
+  inherit (cohttp)
+    version
+    src
+    minimumOCamlVersion
+    useDune2
+    ;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    cohttp
+    conduit-async
+    async_kernel
+    async_unix
+    async
+    base
+    magic-mime
+    logs
+    fmt
+    sexplib0
+    uri
+    uri-sexp
+    ipaddr
+  ];
+
+  doCheck = true;
+  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..c1dc973d0eea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_sexp_conv, base64, jsonm, re, stringext, uri-sexp
+, ocaml, fmt, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "cohttp";
+  version = "4.0.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-v${version}.tbz";
+    sha256 = "bd7aa4cd2c82744990ed7c49e3ee7a40324c64cb3d8509804809155e2bacd1d2";
+  };
+
+  buildInputs = [ jsonm ppx_sexp_conv ];
+
+  propagatedBuildInputs = [ base64 re stringext uri-sexp ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  checkInputs = [ fmt alcotest ];
+
+  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-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix
new file mode 100644
index 000000000000..57885b0e65e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix
@@ -0,0 +1,28 @@
+{ 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;
+
+  useDune2 = true;
+
+  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..158aa3b27b26
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/lwt.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, cohttp, ocaml_lwt, uri, ppx_sexp_conv, logs, sexplib0 }:
+
+buildDunePackage {
+  pname = "cohttp-lwt";
+  inherit (cohttp)
+    version
+    src
+    useDune2
+    minimumOCamlVersion
+    ;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    cohttp ocaml_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..d2d3e945645b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cohttp/mirage.nix
@@ -0,0 +1,23 @@
+{ 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 minimumOCamlVersion useDune2;
+
+  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/comparelib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/comparelib/default.nix
new file mode 100644
index 000000000000..addba7a4b349
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/comparelib/default.nix
@@ -0,0 +1,22 @@
+{lib, buildOcaml, fetchurl, type_conv}:
+
+buildOcaml rec {
+  name = "comparelib";
+  version = "113.00.00";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/comparelib/archive/${version}.tar.gz";
+    sha256 = "02l343drgi4200flfx73nzdk61zajwidsqjk9n80b2d37lvhazlf";
+  };
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/comparelib";
+    description = "Syntax extension for deriving \"compare\" functions automatically";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
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..e78cb2bc5165
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/async.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, async, async_ssl, ppx_sexp_conv, ppx_here, uri, conduit }:
+
+buildDunePackage {
+  pname = "conduit-async";
+  inherit (conduit)
+    version
+    src
+    minimumOCamlVersion
+    useDune2
+    ;
+
+  buildInputs = [ ppx_sexp_conv ppx_here ];
+
+  propagatedBuildInputs = [ async async_ssl conduit uri ];
+
+  meta = conduit.meta // {
+    description = "A 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..96f5bf43d214
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_sexp_conv, sexplib, astring, uri, logs
+, ipaddr, ipaddr-sexp
+}:
+
+buildDunePackage rec {
+  pname = "conduit";
+  version = "4.0.0";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-conduit/releases/download/v${version}/conduit-v${version}.tbz";
+    sha256 = "74b29d72bf47adc5d5c4cae6130ad5a2a4923118b9c571331bd1cb3c56decd2a";
+  };
+
+  buildInputs = [ ppx_sexp_conv ];
+  propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ];
+
+  meta = {
+    description = "A 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..ce6016012d76
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt-unix.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage
+, conduit-lwt, ppx_sexp_conv, ocaml_lwt, uri, ipaddr, ipaddr-sexp, ca-certs, logs
+, lwt_ssl, tls, lwt_log, ssl
+}:
+
+buildDunePackage {
+  pname = "conduit-lwt-unix";
+  inherit (conduit-lwt) version src minimumOCamlVersion useDune2;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    conduit-lwt
+    ocaml_lwt
+    uri
+    ipaddr
+    ipaddr-sexp
+    tls
+    ca-certs
+    logs
+    lwt_ssl
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt_log
+    ssl
+  ];
+
+  meta = conduit-lwt.meta // {
+    description = "A 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..2f18027a67b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/conduit/lwt.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, ppx_sexp_conv, conduit, ocaml_lwt, sexplib }:
+
+buildDunePackage {
+  pname = "conduit-lwt";
+  inherit (conduit) version src useDune2 minimumOCamlVersion;
+
+  buildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [ conduit ocaml_lwt sexplib ];
+
+  meta = conduit.meta // {
+    description = "A 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..d1f636be93c4
--- /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-stack, mirage-flow
+, mirage-flow-combinators, mirage-random, mirage-time, mirage-clock
+, dns-client, vchan, xenstore, tls, tls-mirage, ipaddr, ipaddr-sexp
+, tcpip, ca-certs-nss
+}:
+
+buildDunePackage {
+  pname = "conduit-mirage";
+
+  inherit (conduit-lwt) version src minimumOCamlVersion useDune2;
+
+  nativeBuildInputs = [ ppx_sexp_conv ];
+
+  propagatedBuildInputs = [
+    sexplib uri cstruct mirage-stack mirage-clock mirage-flow
+    mirage-flow-combinators mirage-random mirage-time
+    dns-client conduit-lwt vchan xenstore tls tls-mirage
+    ipaddr ipaddr-sexp tcpip ca-certs-nss
+  ];
+
+  meta = conduit-lwt.meta // {
+    description = "A 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..29c7cd61c3f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/config-file/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, camlp4 }:
+
+stdenv.mkDerivation {
+  name = "ocaml-config-file-1.2";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-1.2.tar.gz";
+    sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
+  };
+
+  buildInputs = [ ocaml findlib camlp4 ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://config-file.forge.ocamlcore.org/";
+    platforms = ocaml.meta.platforms or [];
+    description = "An 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/containers/data.nix b/nixpkgs/pkgs/development/ocaml-modules/containers/data.nix
new file mode 100644
index 000000000000..3694a7b2941b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/containers/data.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, containers
+, dune-configurator
+, gen, iter, qcheck
+}:
+
+buildDunePackage {
+  pname = "containers-data";
+
+  inherit (containers) src version useDune2;
+
+  buildInputs = [ dune-configurator ];
+  doCheck = true;
+  checkInputs = [ gen iter qcheck ];
+
+  propagatedBuildInputs = [ containers ];
+
+  meta = containers.meta // {
+    description = "A 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..b0df52061520
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/containers/default.nix
@@ -0,0 +1,42 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml
+, dune-configurator
+, seq
+, gen, iter, ounit, qcheck, uutf
+}:
+
+buildDunePackage rec {
+  version = "3.4";
+  pname = "containers";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "ocaml-containers";
+    rev = "v${version}";
+    sha256 = "0ixpy81p6rc3lq71djfndb2sg2hfj20j1jbzzrrmgqsysqdjsgzz";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ seq ];
+
+  checkInputs = [ gen iter ounit qcheck uutf ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://github.com/c-cube/ocaml-containers";
+    description = "A 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..2ece4543c2a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cooltt/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, cmdliner
+, menhir
+, menhirLib
+, ppx_deriving
+, ppxlib
+, uuseg
+, uutf
+}:
+
+buildDunePackage {
+  pname = "cooltt";
+  version = "unstable-2021-05-25";
+
+  minimumOCamlVersion = "4.10";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = "cooltt";
+    rev = "8ac06cbf7e05417d777f3ac6a471fe3576249f79";
+    sha256 = "sha256-JBLNJaRuP/gwlg8RS3cpOpzxChOVKfmFulf5HKhhHh4=";
+  };
+
+  nativeBuildInputs = [
+    cmdliner
+    menhir
+    ppxlib
+  ];
+
+  propagatedBuildInputs = [
+    menhirLib
+    ppx_deriving
+    uuseg
+    uutf
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/RedPRL/cooltt";
+    description = "A cool implementation of normalization by evaluation (nbe) & elaboration for Cartesian cubical type theory";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fortuneteller2k ];
+  };
+}
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..13ee99804d8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cow/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage, alcotest
+, uri, xmlm, omd, ezjsonm }:
+
+buildDunePackage rec {
+  useDune2 = true;
+  minimumOCamlVersion = "4.02.3";
+
+  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..2a0fae4a1dbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cpdf/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }:
+
+if !lib.versionAtLeast ocaml.version "4.10"
+then throw "cpdf is not available for OCaml ${ocaml.version}"
+else
+
+let version = "2.4"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-cpdf-${version}";
+
+  src = fetchFromGitHub {
+    owner = "johnwhitington";
+    repo = "cpdf-source";
+    rev = "v${version}";
+    sha256 = "1a8lmfc76dr8x6pxgm4aypbys02pfma9yh4z3l1qxp2q1909na5l";
+  };
+
+  buildInputs = [ ocaml findlib ncurses ];
+  propagatedBuildInputs = [ camlpdf ];
+
+  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; {
+    homepage = "https://www.coherentpdf.com/";
+    platforms = ocaml.meta.platforms or [];
+    description = "PDF Command Line Tools";
+    license = licenses.unfree;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
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..33702ca18296
--- /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
+  '';
+
+  buildInputs = [ 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..e114e7d8433a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/crowbar/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, buildDunePackage, fetchFromGitHub, ocplib-endian, cmdliner, afl-persistent
+, calendar, fpath, pprint, uutf, uunf, uucp }:
+
+buildDunePackage rec {
+  pname = "crowbar";
+  version = "0.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner  = "stedolan";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "0wjfc9irvirfkic32ivvj6qb7r838w08b0d3vmngigbjpjyc9b14";
+  };
+
+  minimumOCamlVersion = "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/cryptgps/default.nix b/nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix
new file mode 100644
index 000000000000..6011c6953baa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cryptgps/default.nix
@@ -0,0 +1,37 @@
+{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";
+  };
+
+  buildInputs = [ocaml findlib];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+    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..6a50c73103b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cryptokit/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchurl, zlib, dune-configurator, zarith, ncurses }:
+
+buildDunePackage {
+  pname = "cryptokit";
+  version = "1.16.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/xavierleroy/cryptokit/archive/release1161.tar.gz";
+    sha256 = "0kzqkk451m69nqi5qiwak0rd0rp5vzi613gcngsiig7dyxwka61c";
+  };
+
+  # dont do autotools configuration, but do trigger findlib's preConfigure hook
+  configurePhase = ''
+    runHook preConfigure
+    runHook postConfigure
+  '';
+
+  buildInputs = [ dune-configurator ncurses ];
+  propagatedBuildInputs = [ zarith zlib ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://pauillac.inria.fr/~xleroy/software.html";
+    description = "A 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..664d9a773ab0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csexp/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, result }:
+
+buildDunePackage rec {
+  pname = "csexp";
+  version = "1.5.1";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-dune/csexp/releases/download/${version}/csexp-${version}.tbz";
+    sha256 = "sha256-1gXkBl+pCliABEDvLzOi2TE5i/LCIGGorLffhFwKrAI=";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    result
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ocaml-dune/csexp/";
+    description = "Minimal support for Canonical S-expressions";
+    license = licenses.mit;
+    maintainers = with maintainers; [ marsam ];
+  };
+}
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..579f12776c08
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/async.nix
@@ -0,0 +1,11 @@
+{ lib, buildDunePackage, cstruct, async_unix }:
+
+buildDunePackage rec {
+  pname = "cstruct-async";
+  inherit (cstruct) src version meta useDune2;
+
+  propagatedBuildInputs = [
+    async_unix
+    cstruct
+  ];
+}
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..8b0c4ee9ebbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage, bigarray-compat, alcotest, ocaml }:
+
+buildDunePackage rec {
+  pname = "cstruct";
+  version = "6.0.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-v${version}.tbz";
+    sha256 = "0xi6cj85z033fqrqdkwac6gg07629vzdhx03c3lhiwwc4lpnv8bq";
+  };
+
+  propagatedBuildInputs = [ bigarray-compat ];
+
+  # alcotest isn't available for OCaml < 4.05 due to fmt
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  checkInputs = [ alcotest ];
+
+  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..df8941d1260d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/lwt.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, cstruct, lwt }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+  pname = "cstruct-lwt";
+  inherit (cstruct) version src useDune2 meta;
+
+  minimumOCamlVersion = "4.03";
+
+  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..aa003295e908
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/ppx.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, cstruct, sexplib, ppxlib, stdlib-shims
+, ounit, cppo, ppx_sexp_conv, cstruct-unix, cstruct-sexp
+, fetchpatch
+}:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+  pname = "ppx_cstruct";
+  inherit (cstruct) version src useDune2 meta;
+
+  minimumOCamlVersion = "4.07";
+
+  # prevent ANSI escape sequences from messing up the test cases
+  # https://github.com/mirage/ocaml-cstruct/issues/283
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/mirage/ocaml-cstruct/pull/285/commits/60dfed98b4c34455bf339ac60e2ed5ef05feb48f.patch";
+      sha256 = "1x9i62nrlfy9l44vb0a7qjfrg2wyki4c8nmmqnzwpcbkgxi3q6n5";
+    })
+  ];
+
+  propagatedBuildInputs = [ cstruct ppxlib sexplib stdlib-shims ];
+
+  # disable until ppx_sexp_conv uses ppxlib 0.20.0 (or >= 0.16.0)
+  # since the propagation of the older ppxlib breaks the ppx_cstruct
+  # build.
+  doCheck = false;
+  checkInputs = [ ounit cppo ppx_sexp_conv cstruct-sexp cstruct-unix ];
+}
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..b04810e48038
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/sexp.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage rec {
+  pname = "cstruct-sexp";
+  inherit (cstruct) version src useDune2 meta;
+
+  minimumOCamlVersion = "4.03";
+
+  # alcotest is only available on OCaml >= 4.05 due to fmt
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  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..1ea27bb04de4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cstruct/unix.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, cstruct }:
+
+if !lib.versionAtLeast (cstruct.version or "1") "3"
+then cstruct
+else
+
+buildDunePackage {
+  pname = "cstruct-unix";
+  inherit (cstruct) version src useDune2 meta;
+
+  minimumOCamlVersion = "4.06";
+
+  propagatedBuildInputs = [ cstruct ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/csv/1.5.nix b/nixpkgs/pkgs/development/ocaml-modules/csv/1.5.nix
new file mode 100644
index 000000000000..6fdf20308611
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/1.5.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchzip, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-csv-1.5";
+
+  src = fetchzip {
+    url = "https://github.com/Chris00/ocaml-csv/releases/download/1.5/csv-1.5.tar.gz";
+    sha256 = "1ca7jgg58j24pccs5fshis726s06fdcjshnwza5kwxpjgdbvc63g";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  createFindlibDestdir = true;
+
+  configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
+
+  buildPhase = "ocaml setup.ml -build";
+
+  doCheck = true;
+  checkPhase = "ocaml setup.ml -test";
+
+  installPhase = "ocaml setup.ml -install";
+
+  meta = with lib; {
+    description = "A pure OCaml library to read and write CSV files";
+    homepage = "https://github.com/Chris00/ocaml-csv";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..12c0dfa160e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/csvtool.nix
@@ -0,0 +1,16 @@
+{ lib, ocamlPackages }:
+
+let inherit (ocamlPackages) buildDunePackage csv uutf; in
+
+buildDunePackage {
+  pname = "csvtool";
+  inherit (csv) src version useDune2;
+
+  buildInputs = [ csv uutf ];
+
+  doCheck = true;
+
+  meta = csv.meta // {
+    description = "Command line tool for handling CSV files";
+  };
+}
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..d4c3d72a6d80
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/default.nix
@@ -0,0 +1,20 @@
+{ 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";
+  };
+
+  useDune2 = true;
+
+  meta = {
+    description = "A 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..b0f771209aa6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/csv/lwt.nix
@@ -0,0 +1,14 @@
+{ lib, buildDunePackage, ocaml, csv, ocaml_lwt }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "csv-lwt is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage {
+  pname = "csv-lwt";
+  inherit (csv) src version useDune2 meta;
+
+  propagatedBuildInputs = [ csv ocaml_lwt ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.03";
+}
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..f8ccffcf217f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ctypes/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchzip, ocaml, findlib, libffi, pkg-config, ncurses, integers, bigarray-compat }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "ctypes is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-ctypes-${version}";
+  version = "0.18.0";
+
+  src = fetchzip {
+    url = "https://github.com/ocamllabs/ocaml-ctypes/archive/${version}.tar.gz";
+    sha256 = "03zrbnl16m67ls0yfhq7a4k4238x6x6b3m456g4dw2yqwc153vks";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ocaml findlib ncurses ];
+  propagatedBuildInputs = [ integers libffi bigarray-compat ];
+
+  buildPhase =  ''
+     make XEN=false libffi.config ctypes-base ctypes-stubs
+     make XEN=false ctypes-foreign
+  '';
+
+  installPhase =  ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
+    make install XEN=false
+  '';
+
+  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 ];
+    inherit (ocaml.meta) platforms;
+  };
+}
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..22de0e690c8b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/cudf/default.nix
@@ -0,0 +1,50 @@
+{ lib, fetchurl, stdenv, ocaml, ocamlbuild, findlib, ocaml_extlib, glib, perl, pkg-config, stdlib-shims, ounit }:
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-cudf";
+  version = "0.9";
+
+  src = fetchurl {
+    url = "https://gforge.inria.fr/frs/download.php/36602/cudf-0.9.tar.gz";
+    sha256 = "sha256-mTLk2V3OI1sUNIYv84nM3reiirf0AuozG5ZzLCmn4Rw=";
+  };
+
+  buildFlags = [
+    "all"
+    "opt"
+  ];
+  nativeBuildInputs = [
+    findlib
+    ocaml
+    ocamlbuild
+    pkg-config
+  ];
+  buildInputs = [
+    glib
+    perl
+    stdlib-shims
+  ];
+  propagatedBuildInputs = [
+    ocaml_extlib
+  ];
+
+  checkTarget = [
+    "all"
+    "test"
+  ];
+  checkInputs = [
+    ounit
+  ];
+  doCheck = true;
+
+  preInstall = "mkdir -p $OCAMLFIND_DESTDIR";
+  installFlags = "BINDIR=$(out)/bin";
+
+  meta = with lib; {
+    description = "A library for CUDF format";
+    homepage = "https://www.mancoosi.org/cudf/";
+    downloadPage = "https://gforge.inria.fr/projects/cudf/";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ superherointj ];
+  };
+}
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..20197e207af3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/curly/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, buildDunePackage, fetchurl, ocaml
+, result, alcotest, cohttp-lwt-unix, odoc, curl, cacert
+}:
+
+buildDunePackage rec {
+  pname = "curly";
+  version = "0.2.0";
+
+  minimumOCamlVersion = "4.02";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
+    sha256 = "07vqdrklar0d5i83ip7sjw2c1v18a9m3anw07vmi5ay29pxzal6k";
+  };
+
+  propagatedBuildInputs = [ result ];
+  checkInputs = [ alcotest cohttp-lwt-unix cacert ];
+  # 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..f1211ad9cdc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/curses/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-curses";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "http://ocaml.phauna.org/distfiles/ocaml-curses-${version}.ogunden1.tar.gz";
+    sha256 = "08wq1r93lincdfzlriyc5nl2p4q7ca4h6ygzgp1nhkgd93pgk9v2";
+  };
+
+  propagatedBuildInputs = [ ncurses ];
+
+  buildInputs = [ ocaml findlib ];
+
+  # Fix build for recent ncurses versions
+  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://opam.ocaml.org/packages/curses/curses.1.0.4/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.volth ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..6d14945ee15e
--- /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";
+  useDune2 = true;
+  src = fetchurl {
+    url = "https://github.com/hackwaly/ocaml-dap/releases/download/${version}/dap-${version}.tbz";
+    sha256 = "1zq0f8429m38a4x3h9n3rv7n1vsfjbs72pfi5902a89qwyilkcp0";
+  };
+
+  minimumOCamlVersion = "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..2e4e0518a522
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/data-encoding/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, ezjsonm
+, zarith
+, hex
+, json-data-encoding
+, json-data-encoding-bson
+, alcotest
+, crowbar
+}:
+
+buildDunePackage {
+  pname = "data-encoding";
+  version = "0.2.0";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "data-encoding";
+    rev = "0.2";
+    sha256 = "0d9c2ix2imqk4r0jfhnwak9laarlbsq9kmswvbnjzdm2g0hwin1d";
+  };
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    ezjsonm
+    zarith
+    hex
+    json-data-encoding
+    json-data-encoding-bson
+  ];
+
+  checkInputs = [
+    alcotest
+    crowbar
+  ];
+
+  doCheck = true;
+
+  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/decompress/default.nix b/nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix
new file mode 100644
index 000000000000..7629349c1d1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/decompress/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage
+, checkseum, bigarray-compat, optint, cmdliner
+, bigstringaf, alcotest, camlzip, base64, ctypes, fmt
+}:
+
+buildDunePackage rec {
+  version = "1.4.2";
+  pname = "decompress";
+
+  minimumOCamlVersion = "4.07";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/decompress/releases/download/v${version}/decompress-v${version}.tbz";
+    sha256 = "822f125b46c87f4a902c334db8c86d4d5f33ebe978e93c40351a4d3269b95225";
+  };
+
+  buildInputs = [ cmdliner ];
+  propagatedBuildInputs = [ optint bigarray-compat checkseum ];
+  checkInputs = [ alcotest bigstringaf ctypes fmt camlzip base64 ];
+  doCheck = true;
+
+  meta = {
+    description = "Pure OCaml implementation of Zlib";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/mirage/decompress";
+  };
+}
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..cd14d2a06af5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/diet/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl, stdlib-shims, ounit }:
+
+buildDunePackage rec {
+  pname = "diet";
+  version = "0.4";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz";
+    sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741";
+  };
+
+  minimumOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  doCheck = true;
+  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..e2501c60f5a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/digestif/default.nix
@@ -0,0 +1,32 @@
+{ lib, ocaml, fetchurl, buildDunePackage
+, bigarray-compat, eqaf, stdlib-shims
+, alcotest, astring, bos, findlib, fpath
+}:
+
+buildDunePackage rec {
+  pname = "digestif";
+  version = "1.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/digestif/releases/download/v${version}/digestif-v${version}.tbz";
+    sha256 = "11188ya6ksb0p0zvs6saz3qxv4a8pyy8m3sq35f3qfxrxhghqi99";
+  };
+
+  propagatedBuildInputs = [ bigarray-compat eqaf stdlib-shims ];
+
+  checkInputs = [ alcotest astring bos fpath ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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..eae11953113b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/directories/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "directories";
+  version = "0.2";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "ocamlpro";
+    repo = pname;
+    rev = version;
+    sha256 = "0s7ginh0g0fhw8xf9v58cx99a8q9jqsf4i0p134m5qzf84qpjwff";
+  };
+
+  meta = {
+    homepage = "https://github.com/ocamlpro/directories";
+    description = "An 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..65baa3dc4982
--- /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";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "ocaml-dispatch";
+    rev = version;
+    sha256 = "12r39ylbxc297cbwjadhd1ghxnwwcdzfjk68r97wim8hcgzxyxv4";
+  };
+
+  propagatedBuildInputs = [ result ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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..31b39d18225c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/certify.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage, dns, dns-tsig, dns-mirage, randomconv, x509
+, mirage-random, mirage-time, mirage-clock, mirage-stack
+, logs, mirage-crypto-pk, mirage-crypto-rng, mirage-crypto-ec, lwt
+}:
+
+buildDunePackage {
+  pname = "dns-certify";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [
+    dns
+    dns-tsig
+    dns-mirage
+    randomconv
+    x509
+    mirage-random
+    mirage-time
+    mirage-clock
+    mirage-stack
+    logs
+    mirage-crypto-pk
+    mirage-crypto-rng
+    mirage-crypto-ec
+    lwt
+  ];
+
+  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..6e149180642d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/cli.nix
@@ -0,0 +1,48 @@
+{ buildDunePackage, dns, dns-tsig, dns-client, dns-server, dns-certify
+, rresult, 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";
+
+  minimumOCamlVersion = "4.08";
+
+  inherit (dns) version src useDune2;
+
+  # no need to propagate as this is primarily
+  # an executable package
+  buildInputs = [
+    dns
+    dns-tsig
+    dns-client
+    dns-server
+    dns-certify
+    rresult
+    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";
+  };
+}
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..a6dc40de24ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/client.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, dns, ocaml_lwt, mirage-clock, mirage-time
+, mirage-random, mirage-stack, mirage-crypto-rng, mtime, randomconv
+, cstruct, fmt, logs, rresult, domain-name, ipaddr, alcotest }:
+
+buildDunePackage {
+  pname = "dns-client";
+  inherit (dns) src version;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ cstruct fmt logs dns rresult randomconv domain-name ipaddr
+                            ocaml_lwt mirage-stack mirage-random mirage-time mirage-clock
+                            mtime mirage-crypto-rng ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = dns.meta // {
+    description = "Pure DNS resolver API";
+  };
+}
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..8a5115f10f05
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl, alcotest
+, cstruct, domain-name, duration, gmap, ipaddr, logs, lru, metrics, ptime, rresult, astring, fmt
+}:
+
+buildDunePackage rec {
+  pname = "dns";
+  version = "5.0.1";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-dns/releases/download/v${version}/dns-v${version}.tbz";
+    sha256 = "72c0a1a91c8e409bd448c8e0ea28d16d13177c326aea403ee1c30ddcb5969adc";
+  };
+
+  propagatedBuildInputs = [ rresult astring fmt logs ptime domain-name gmap cstruct ipaddr lru duration metrics ];
+
+  doCheck = true;
+  checkInputs = lib.optional doCheck alcotest;
+
+  meta = {
+    description = "An 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/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix
new file mode 100644
index 000000000000..4a45abba68e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/mirage.nix
@@ -0,0 +1,18 @@
+{ buildDunePackage, dns, mirage-stack, ipaddr, lwt }:
+
+buildDunePackage {
+  pname = "dns-mirage";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [
+    dns
+    mirage-stack
+    ipaddr
+    lwt
+  ];
+
+  meta = dns.meta // {
+    description = "An 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..121ecb588d02
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/resolver.nix
@@ -0,0 +1,32 @@
+{ buildDunePackage, dns, dns-server, dns-mirage, lru, duration
+, randomconv, lwt, mirage-time, mirage-clock, mirage-random
+, alcotest
+}:
+
+buildDunePackage {
+  pname = "dns-resolver";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [
+    dns
+    dns-server
+    dns-mirage
+    lru
+    duration
+    randomconv
+    lwt
+    mirage-time
+    mirage-clock
+    mirage-random
+  ];
+
+  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..1dc001f5f808
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/server.nix
@@ -0,0 +1,34 @@
+{ buildDunePackage, dns, dns-mirage, randomconv, duration, lwt
+, mirage-time, mirage-clock, mirage-stack, metrics
+, alcotest, mirage-crypto-rng, dns-tsig, base64
+}:
+
+buildDunePackage {
+  pname = "dns-server";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [
+    dns
+    dns-mirage
+    randomconv
+    duration
+    lwt
+    mirage-time
+    mirage-clock
+    mirage-stack
+    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..dfe623f1c500
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/stub.nix
@@ -0,0 +1,33 @@
+{ buildDunePackage, dns, dns-client, dns-mirage, dns-resolver, dns-tsig
+, dns-server, duration, randomconv, lwt, mirage-time, mirage-clock
+, mirage-random, mirage-stack, metrics
+}:
+
+buildDunePackage {
+  pname = "dns-stub";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [
+    dns
+    dns-client
+    dns-mirage
+    dns-resolver
+    dns-tsig
+    dns-server
+    duration
+    randomconv
+    lwt
+    mirage-time
+    mirage-clock
+    mirage-random
+    mirage-stack
+    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..11786a21e0dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dns/tsig.nix
@@ -0,0 +1,22 @@
+{ buildDunePackage, dns, mirage-crypto, base64, alcotest }:
+
+buildDunePackage {
+  pname = "dns-tsig";
+
+  inherit (dns) version src useDune2 minimumOCamlVersion;
+
+  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..56b87a4e971d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolmen/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage
+, menhir, menhirLib
+, fmt
+}:
+
+buildDunePackage rec {
+  pname = "dolmen";
+  version = "0.6";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/Gbury/dolmen/releases/download/v${version}/dolmen-v${version}.tbz";
+    sha256 = "133l23mwxa9xy340izvk4zp5jqjz2cwsm2innsgs2kg85pd39c41";
+  };
+
+  buildInputs = [ menhir ];
+  propagatedBuildInputs = [ menhirLib fmt ];
+
+  doCheck = true;
+
+  meta = {
+    description = "An 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/dolog/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix
new file mode 100644
index 000000000000..690823c5358a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dolog/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild }:
+
+let version = "3.0"; in
+
+stdenv.mkDerivation {
+  pname = "ocaml-dolog";
+  inherit version;
+  src = fetchzip {
+    url = "https://github.com/UnixJunkie/dolog/archive/v${version}.tar.gz";
+    sha256 = "0gx2s4509vkkkaikl2yp7k5x7bqv45s1y1vsy408d8rakd7yl1zb";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  createFindlibDestdir = true;
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = {
+    homepage = "https://github.com/UnixJunkie/dolog";
+    description = "Minimalistic lazy logger in OCaml";
+    platforms = ocaml.meta.platforms or [];
+    license = lib.licenses.bsd3;
+    maintainers = with 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..a34c06aa8ee1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/domain-name/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchurl
+, alcotest
+, astring, fmt
+}:
+
+buildDunePackage rec {
+  pname = "domain-name";
+  version = "0.3.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/domain-name/releases/download/v${version}/domain-name-v${version}.tbz";
+    sha256 = "12kc9p2a2fi1ipc2hyhbzivxpph3npglxwdgvhd6v20rqqdyvnad";
+  };
+
+  minimumOCamlVersion = "4.03";
+
+  checkInputs = [ alcotest ];
+
+  propagatedBuildInputs = [ astring fmt ];
+
+  doCheck = true;
+
+  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/dose3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix
new file mode 100644
index 000000000000..733427cdb914
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dose3/default.nix
@@ -0,0 +1,61 @@
+{ lib, buildDunePackage, fetchFromGitLab
+, camlzip, ocamlgraph, parmap, re, stdlib-shims
+, base64, bz2, ocaml_extlib, cudf
+, dpkg, git, ocaml, ounit, python39, python39Packages
+}:
+
+buildDunePackage rec {
+  pname = "dose3";
+  version = "6.1";
+
+  src = fetchFromGitLab {
+    owner = "irill";
+    repo = "dose3";
+    rev = version;
+    sha256 = "sha256-RFChY7VH2pVD4u5U1qng46h9aAv8I/3yXVaNmFDmKFI=";
+  };
+
+  minimalOCamlVersion = "4.03";
+  useDune2 = true;
+
+  buildInputs = [
+    parmap
+  ];
+
+  propagatedBuildInputs = [
+    base64
+    bz2
+    camlzip
+    cudf
+    ocaml_extlib
+    ocamlgraph
+    re
+    stdlib-shims
+  ];
+
+  checkInputs = [
+    dpkg                      # Replaces: conf-dpkg
+    git
+    ounit
+    python39                  # Replaces: conf-python-3
+    python39Packages.pyyaml   # Replaces: conf-python3-yaml
+  ];
+  doCheck = false; # Tests are failing.
+                   # To enable tests use: lib.versionAtLeast ocaml.version "4.04";
+
+  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/dtoa/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix
new file mode 100644
index 000000000000..44bc5d7498bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "dtoa";
+  version = "0.3.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0zkhn0rdq82g6gamsv6nkx6i44s8104nh6jg5xydazl9jl1704xn";
+  };
+
+  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/duff/default.nix b/nixpkgs/pkgs/development/ocaml-modules/duff/default.nix
new file mode 100644
index 000000000000..a57f8564d9e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/duff/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchurl, buildDunePackage, fetchpatch
+, stdlib-shims, bigarray-compat, fmt
+, alcotest, hxd, crowbar, bigstringaf
+}:
+
+buildDunePackage rec {
+  pname = "duff";
+  version = "0.4";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/duff/releases/download/v${version}/duff-v${version}.tbz";
+    sha256 = "4795e8344a2c2562e0ef6c44ab742334b5cd807637354715889741b20a461da4";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims bigarray-compat 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..d8aa1f371f3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dum/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib
+, easy-format
+}:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-dum-${version}";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "mjambon";
+    repo = "dum";
+    rev = "v${version}";
+    sha256 = "0yrxl97szjc0s2ghngs346x3y0xszx2chidgzxk93frjjpsr1mlr";
+  };
+
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ easy-format ];
+
+  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..65c55da6e3b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-action-plugin/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, dune_2, dune-glob, dune-private-libs }:
+
+buildDunePackage rec {
+  pname = "dune-action-plugin";
+  inherit (dune_2) src version patches;
+
+  useDune2 = true;
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dune-glob dune-private-libs ];
+
+  meta = with lib; {
+    inherit (dune_2.meta) homepage;
+    description = "API for writing dynamic Dune actions";
+    maintainers = [ maintainers.marsam ];
+    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..5d9f105782b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-build-info/default.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, dune_2 }:
+
+buildDunePackage rec {
+  pname = "dune-build-info";
+  inherit (dune_2) src version patches;
+
+  useDune2 = true;
+
+  dontAddPrefix = true;
+
+  meta = with lib; {
+    inherit (dune_2.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..f5303db9a3b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-configurator/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, dune_2, csexp, result }:
+
+buildDunePackage rec {
+  pname = "dune-configurator";
+
+  useDune2 = true;
+
+  inherit (dune_2) src version patches;
+
+  minimumOCamlVersion = "4.03";
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ csexp result ];
+
+  meta = with lib; {
+    description = "Helper library for gathering system configuration";
+    maintainers = [ maintainers.marsam ];
+    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..c7c6f9be4ee0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-glob/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, dune_2, dune-private-libs }:
+
+buildDunePackage rec {
+  pname = "dune-glob";
+  inherit (dune_2) src version patches;
+
+  useDune2 = true;
+
+  dontAddPrefix = true;
+
+  propagatedBuildInputs = [ dune-private-libs ];
+
+  meta = with lib; {
+    inherit (dune_2.meta) homepage;
+    description = "Glob string matching language supported by dune";
+    maintainers = [ maintainers.marsam ];
+    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..8a635efa3a59
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dune-private-libs/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, dune_2 }:
+
+buildDunePackage rec {
+  pname = "dune-private-libs";
+
+  useDune2 = true;
+
+  inherit (dune_2) src version patches;
+
+  minimumOCamlVersion = "4.08";
+
+  dontAddPrefix = true;
+
+  meta = with lib; {
+    description = "Private libraries of Dune";
+    maintainers = [ maintainers.marsam ];
+    license = licenses.mit;
+  };
+}
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..a547a919c31d
--- /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.1.3";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/duration/releases/download/${version}/duration-${version}.tbz";
+    sha256 = "0m9r0ayhpl98g9vdxrbjdcllns274jilic5v8xj1x7dphw21p95h";
+  };
+
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  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/dypgen/default.nix b/nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix
new file mode 100644
index 000000000000..5b5b107b694b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/dypgen/default.nix
@@ -0,0 +1,36 @@
+{stdenv, lib, fetchurl, ocaml, findlib}:
+
+let
+  pname = "dypgen";
+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 = "20120619-1";
+
+  src = fetchurl {
+    url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2";
+    sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97";
+  };
+
+  buildInputs = [ocaml findlib];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..c7b2d09d6674
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/earley/default.nix
@@ -0,0 +1,28 @@
+{ 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";
+    license = lib.licenses.cecill-b;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/rlepigre/ocaml-earley";
+  };
+}
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..a6a3648bec65
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/earlybird/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, ocaml, buildDunePackage
+, cmdliner, dap, fmt, iter, logs, lru, lwt_ppx, lwt_react, menhir, menhirLib, path_glob, ppx_deriving_yojson
+}:
+
+if lib.versionAtLeast ocaml.version "4.13"
+then throw "earlybird is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage rec {
+  pname = "earlybird";
+  version = "1.1.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.11";
+
+  src = fetchurl {
+    url = "https://github.com/hackwaly/ocamlearlybird/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "1pwzhcr3pw24ra4j4d23vz71h0psz4xkyp7b12l2wl1slxzjbrxa";
+  };
+
+  buildInputs = [ cmdliner dap fmt iter logs lru lwt_ppx lwt_react menhir menhirLib path_glob ppx_deriving_yojson ];
+
+  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..161e263e129b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/easy-format/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchzip, ocaml, findlib }:
+let
+  pname = "easy-format";
+  version = "1.2.0";
+in
+stdenv.mkDerivation {
+
+  name = "${pname}-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/mjambon/${pname}/archive/v${version}.tar.gz";
+    sha256 = "00ga7mrlycjc99gzp3bgx6iwhf7i6j8856f8xzrf1yas7zwzgzm9";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+  strictDeps = true;
+
+  createFindlibDestdir = true;
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "A high-level and functional interface to the Format module of the OCaml standard library";
+    homepage = "https://github.com/ocaml-community/${pname}";
+    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..47b002fd7302
--- /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";
+
+  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/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..4eff6c2957de
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/elina/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchurl, perl, gmp, mpfr, ocaml, findlib, camlidl, apron }:
+
+stdenv.mkDerivation rec {
+  version = "1.1";
+  name = "ocaml${ocaml.version}-elina-${version}";
+  src = fetchurl {
+    url = "http://files.sri.inf.ethz.ch/elina-${version}.tar.gz";
+    sha256 = "1nymykskq1yx87y4xl6hl9i4q6kv0qaq25rniqgl1bfn883p1ysc";
+  };
+
+  buildInputs = [ perl ocaml findlib ];
+
+  propagatedBuildInputs = [ apron camlidl gmp mpfr ];
+
+  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 ];
+    inherit (ocaml.meta) platforms;
+  };
+}
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..79c7a650cffd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eliom/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, lib, fetchzip, which, ocsigen_server, ocaml,
+  lwt_react,
+  opaline, ppx_deriving, findlib
+, ocaml-migrate-parsetree
+, ppx_tools_versioned
+, js_of_ocaml-ocamlbuild, js_of_ocaml-ppx, js_of_ocaml-ppx_deriving_json
+, js_of_ocaml-lwt
+, js_of_ocaml-tyxml
+, lwt_ppx
+, ocamlnet
+}:
+
+stdenv.mkDerivation rec
+{
+  pname = "eliom";
+  version = "8.6.0";
+
+  src = fetchzip {
+    url = "https://github.com/ocsigen/eliom/archive/${version}.tar.gz";
+    sha256 = "0s1hpawwhqp4qcy8w1067n8c6zg8jcjpzplc39bjbb1ycqw667j9";
+  };
+
+  buildInputs = [ ocaml which findlib js_of_ocaml-ocamlbuild
+    ocaml-migrate-parsetree
+    js_of_ocaml-ppx_deriving_json opaline
+    ppx_tools_versioned
+    ocamlnet
+  ];
+
+  propagatedBuildInputs = [
+    js_of_ocaml-lwt
+    js_of_ocaml-ppx
+    js_of_ocaml-tyxml
+    lwt_ppx
+    lwt_react
+    ocsigen_server
+    ppx_deriving
+  ];
+
+  installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
+
+  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/default.nix b/nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix
new file mode 100644
index 000000000000..642a249e4937
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/elpi/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchzip, buildDunePackage, camlp5
+, ppxlib, ppx_deriving, re, perl, ncurses
+, version ? "1.13.5"
+}:
+with lib;
+let fetched = import ../../../build-support/coq/meta-fetch/default.nix
+  {inherit lib stdenv fetchzip; } ({
+    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;
+
+  minimumOCamlVersion = "4.04";
+
+  buildInputs = [ perl ncurses ];
+
+  propagatedBuildInputs = [ camlp5 ppxlib ppx_deriving re ];
+
+  meta = {
+    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"
+  '';
+
+  useDune2 = true;
+}
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..d296e3de967b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/emile/default.nix
@@ -0,0 +1,39 @@
+{ lib, buildDunePackage, fetchurl, ocaml
+, angstrom, ipaddr, base64, pecu, uutf
+, alcotest, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "emile";
+  version = "1.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/emile/releases/download/v${version}/emile-v${version}.tbz";
+    sha256 = "0r1141makr0b900aby1gn0fccjv1qcqgyxib3bzq8fxmjqwjan8p";
+  };
+
+  buildInputs = [ cmdliner ];
+
+  propagatedBuildInputs = [
+    angstrom
+    ipaddr
+    base64
+    pecu
+    uutf
+  ];
+
+  # technically emile is available for ocaml >= 4.03, but alcotest
+  # and angstrom (fmt) are only available for >= 4.05. Disabling
+  # tests for < 4.05 at least improves the error message
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  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..5924845c4f46
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/encore/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, ocaml
+, fmt, bigstringaf, angstrom, alcotest }:
+
+buildDunePackage rec {
+  pname = "encore";
+  version = "0.8";
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/encore/releases/download/v${version}/encore-v${version}.tbz";
+    sha256 = "a406bc9863b04bb424692045939d6c170a2bb65a98521ae5608d25b0559344f6";
+  };
+
+  useDune2 = true;
+
+  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/enumerate/default.nix b/nixpkgs/pkgs/development/ocaml-modules/enumerate/default.nix
new file mode 100644
index 000000000000..eb0495be797f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/enumerate/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, type_conv, camlp4 }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "4.00";
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "enumerate-111.08.00 is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-enumerate-111.08.00";
+
+  src = fetchurl {
+    url = "https://ocaml.janestreet.com/ocaml-core/111.08.00/individual/enumerate-111.08.00.tar.gz";
+    sha256 = "0b6mx5p01lcpimvak4wx6aj2119707wsfzd83rwgb91bhpgzh156";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ type_conv camlp4 ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "Quotation expanders for enumerating finite types";
+    license = lib.licenses.asl20;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..a3f64cb7bd95
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/eqaf/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, buildDunePackage, cstruct, bigarray-compat }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.03";
+  pname = "eqaf";
+  version = "0.7";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/eqaf/releases/download/v${version}/eqaf-v${version}.tbz";
+    sha256 = "1q09pwhs121vpficl2af1yzs4y7dd9bc1lcxbqyfc4x4m6p6drhh";
+  };
+
+  propagatedBuildInputs = [ cstruct bigarray-compat ];
+
+  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..56b5c9295708
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/erm_xml/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "erm_xml is not available for OCaml ${ocaml.version}"
+else
+
+let version = "0.3+20180112"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-erm_xml-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/hannesm/xml/archive/bbabdade807d8281fc48806da054b70dfe482479.tar.gz";
+    sha256 = "1gawpmg8plip0wia0xq60m024dn7l3ykwbjpbqx9f9bdmx74n1rr";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  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..9eaad7575ec3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4, ocamlbuild
+, erm_xml, mirage-crypto, mirage-crypto-rng, base64
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.3+20200317";
+  name = "ocaml${ocaml.version}-erm_xmpp-${version}";
+
+  src = fetchFromGitHub {
+    owner  = "hannesm";
+    repo   = "xmpp";
+    rev    = "7fa5bea252671fd88625c6af109998b879ca564f";
+    sha256 = "0spzyd9kbyizzwl8y3mq8z19zlkzxnkh2fppry4lyc7vaw7bqrwq";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
+  propagatedBuildInputs = [ erm_xml mirage-crypto mirage-crypto-rng base64 ];
+
+  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/estring/default.nix b/nixpkgs/pkgs/development/ocaml-modules/estring/default.nix
new file mode 100644
index 000000000000..7424d14220dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/estring/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildOcaml, ocaml, fetchurl }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "estring is not available for OCaml ${ocaml.version}"
+else
+
+buildOcaml rec {
+  name = "estring";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/1012/estring-${version}.tar.gz";
+    sha256 = "0b6znz5igm8pp28w4b7sgy82rpd9m5aw6ss933rfbw1mrh05gvcg";
+  };
+
+  meta = with lib; {
+    homepage = "http://estring.forge.ocamlcore.org/";
+    description = "Extension for string literals";
+    license = licenses.bsd3;
+  };
+}
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..bc4f4a475447
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildDunePackage, fetchurl
+, rresult, cstruct, ppx_cstruct, mirage-net, mirage-protocols
+, mirage-profile, macaddr, fmt, lwt, logs
+}:
+
+buildDunePackage rec {
+  pname = "ethernet";
+  version = "2.2.0";
+
+  minimumOCamlVersion = "4.06";
+
+  # necessary due to cstruct
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0qzisqibx2gd8rh330n642mk5wz229199rnlrs7x8cr5pnymif7z";
+  };
+
+  nativeBuildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    rresult
+    cstruct
+    mirage-net
+    mirage-protocols
+    macaddr
+    mirage-profile
+    fmt
+    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/0.9.nix b/nixpkgs/pkgs/development/ocaml-modules/expat/0.9.nix
new file mode 100644
index 000000000000..219b8164e7c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/expat/0.9.nix
@@ -0,0 +1,51 @@
+{stdenv, lib, fetchurl, ocaml, findlib, ounit, expat}:
+
+let
+  pname = "ocaml-expat";
+  testcase = fetchurl {
+    url = "http://www.w3.org/TR/1998/REC-xml-19980210.xml";
+    sha256 = "00a3gsfvlkdhmcbziqhvpvy1zmcgbcihfqwcvl6ay03zf7gvw0k1";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url = "http://www.xs4all.nl/~mmzeeman/ocaml/${pname}-${version}.tar.gz";
+    sha256 = "16n2j3y0jc9xgqyshw9plrwqnjiz30vnpbhahmgxlidbycw8rgjz";
+  };
+
+  buildInputs = [ocaml findlib ounit expat];
+
+  createFindlibDestdir = true;
+
+  patches = [ ./unittest.patch ];
+
+  postPatch = ''
+    substituteInPlace "unittest.ml" \
+      --replace "/home/maas/xml-samples/REC-xml-19980210.xml.txt" "${testcase}"
+    substituteInPlace Makefile --replace "EXPAT_LIBDIR=/usr/local/lib" "EXPAT_LIBDIR=${expat.out}/lib" \
+      --replace "EXPAT_INCDIR=/usr/local/include" "EXPAT_INCDIR=${expat.dev}/include" \
+      --replace "gcc" "\$(CC)"
+  '';
+
+  dontConfigure = true;  	# Skip configure
+
+  buildPhase = ''
+    make all allopt
+  '';
+
+  doCheck = true;
+
+  checkTarget = "testall";
+
+  meta = {
+    homepage = "http://www.xs4all.nl/~mmzeeman/ocaml/";
+    description = "An ocaml wrapper for the Expat XML parsing library";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.roconnor ];
+  };
+}
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..1812473e78bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/expat/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-expat-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "whitequark";
+    repo = "ocaml-expat";
+    rev = "v${version}";
+    sha256 = "07wm9663z744ya6z2lhiz5hbmc76kkipg04j9vw9dqpd1y1f2x3q";
+  };
+
+  prePatch = ''
+    substituteInPlace Makefile --replace "gcc" "\$(CC)"
+  '';
+
+  buildInputs = [ ocaml findlib expat ounit ];
+
+  doCheck = !lib.versionAtLeast ocaml.version "4.06";
+  checkTarget = "testall";
+
+  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/expat/unittest.patch b/nixpkgs/pkgs/development/ocaml-modules/expat/unittest.patch
new file mode 100644
index 000000000000..489b745c503a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/expat/unittest.patch
@@ -0,0 +1,15 @@
+--- old/Makefile	2005-03-13 09:00:29.000000000 -0500
++++ new/Makefile	2010-08-26 14:20:34.515785557 -0400
+@@ -67,10 +67,10 @@
+ testall: test testopt
+ .PHONY: test
+ test: unittest 	
+-	./unittest
++	LD_LIBRARY_PATH=. ./unittest
+ .PHONY: testopt
+ testopt: unittest.opt
+-	./unittest.opt
++	LD_LIBRARY_PATH=. ./unittest.opt
+ unittest: all unittest.ml
+ 	$(OCAMLFIND) ocamlc -o unittest -package oUnit -ccopt -L. -linkpkg \
+ 	$(ARCHIVE) unittest.ml
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..d27fe085569f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/extlib/1.7.7.nix
@@ -0,0 +1,14 @@
+# Older version of extlib for Haxe 4.0 and 4.1.
+# May be replaceable by the next extlib + extlib-base64 release.
+{ lib, fetchurl, ocaml, ocaml_extlib }:
+
+ocaml_extlib.overrideAttrs (x: rec {
+  version = "1.7.7";
+  src = fetchurl {
+    url = "https://github.com/ygrek/ocaml-extlib/releases/download/${version}/extlib-${version}.tar.gz";
+    sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1";
+  };
+  meta = x.meta // {
+    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..d1860788838a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/extlib/default.nix
@@ -0,0 +1,28 @@
+{ 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.8";
+
+  src = fetchurl {
+    url = "https://ygrek.org/p/release/ocaml-extlib/extlib-${version}.tar.gz";
+    sha256 = "0npq4hq3zym8nmlyji7l5cqk6drx2rkcx73d60rxqh5g8dla8p4k";
+  };
+
+  buildInputs = [ ocaml findlib cppo ];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ lib.maintainers.sternenseemann ];
+  };
+}
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..fd3187055126
--- /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.2.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ezjsonm/releases/download/v${version}/ezjsonm-v${version}.tbz";
+    sha256 = "1q6cf63cc614lr141rzhm2w4rhi1snfqai6fmkhvfjs84hfbw2w7";
+  };
+
+  propagatedBuildInputs = [ jsonm hex sexplib0 ];
+
+  meta = {
+    description = "An 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/facile/default.nix b/nixpkgs/pkgs/development/ocaml-modules/facile/default.nix
new file mode 100644
index 000000000000..8834de53a8fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/facile/default.nix
@@ -0,0 +1,19 @@
+{ lib, fetchurl, buildDunePackage }:
+
+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;
+
+  meta = {
+    homepage = "http://opti.recherche.enac.fr/facile/";
+    license = lib.licenses.lgpl21Plus;
+    description = "A Functional Constraint Library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/faillib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/faillib/default.nix
new file mode 100644
index 000000000000..63040fadda5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faillib/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildOcaml, fetchurl, ocaml, herelib, camlp4 }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "faillib-111.17.00 is not available for OCaml ${ocaml.version}"
+else
+
+buildOcaml rec {
+  minimumSupportedOcamlVersion = "4.00";
+  name = "faillib";
+  version = "111.17.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/faillib/archive/${version}.tar.gz";
+    sha256 = "12dvaxkmgf7yzzvbadcyk1n17llgh6p8qr33867d21npaljy7l9v";
+  };
+
+  propagatedBuildInputs = [ camlp4 herelib ];
+
+  doCheck = true;
+  checkPhase = "make test";
+
+  meta = with lib; {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "Library for dealing with failure in OCaml";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+  };
+}
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..666eb684925c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/async.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, faraday, core, async }:
+
+buildDunePackage rec {
+  pname = "faraday-async";
+  inherit (faraday) version src useDune2;
+
+  minimumOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [ faraday core 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..48a6a82a738c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigstringaf }:
+
+buildDunePackage rec {
+  pname = "faraday";
+  version = "0.7.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    sha256 = "0gdysszzk6b6npic4nhpdnz2nbq7rma6aml0rbn113bfh0rmb36x";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ bigstringaf ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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..23914de26575
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt-unix.nix
@@ -0,0 +1,12 @@
+{ buildDunePackage, faraday, faraday-lwt, lwt }:
+
+buildDunePackage rec {
+  pname = "faraday-lwt-unix";
+  inherit (faraday) version src useDune2 minimumOCamlVersion;
+
+  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..7fe7319575c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/faraday/lwt.nix
@@ -0,0 +1,12 @@
+{ buildDunePackage, faraday, lwt }:
+
+buildDunePackage rec {
+  pname = "faraday-lwt";
+  inherit (faraday) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [ faraday lwt ];
+
+  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..77eef7f29a98
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/farfadet/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, faraday
+}:
+
+if !lib.versionAtLeast ocaml.version "4.3"
+then throw "farfadet is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-farfadet-${version}";
+  version = "0.3";
+
+  src = fetchurl {
+    url = "https://github.com/oklm-wsh/Farfadet/releases/download/v${version}/farfadet-${version}.tbz";
+    sha256 = "0nlafnp0pwx0n4aszpsk6nvcvqi9im306p4jhx70si7k3xprlr2j";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ faraday ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "A 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..d3915b65935e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fdkaac/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, dune-configurator
+, fdk_aac
+}:
+
+buildDunePackage rec {
+  pname = "fdkaac";
+  version = "0.3.2";
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-fdkaac";
+    rev = version;
+    sha256 = "10i6hsjkrpw7zgx99zvvka3sapd7zy53k7z4b6khj9rdrbrgznv8";
+  };
+
+  useDune2 = true;
+
+  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 ];
+  };
+
+}
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..2a51b377e883
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ff/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitLab, buildDunePackage, zarith, alcotest }:
+
+buildDunePackage rec {
+  pname = "ff";
+  version = "0.4.0";
+
+  src = fetchFromGitLab {
+    owner = "dannywillems";
+    repo = "ocaml-ff";
+    rev = version;
+    sha256 = "1ik29srzkd0pl48p1si9p1c4f8vmx5rgm02yv2arj3vg0a1nfhdv";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    zarith
+  ];
+
+  checkInputs = [
+    alcotest
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/dannywillems/ocaml-ff";
+    description = "OCaml implementation of Finite Field operations";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fiat-p256/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fiat-p256/default.nix
new file mode 100644
index 000000000000..c979fe682d3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fiat-p256/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchurl, alcotest, asn1-combinators, benchmark
+, bigarray-compat, cstruct, eqaf, hex, ppx_deriving_yojson, rresult
+, stdlib-shims, yojson, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "fiat-p256";
+  version = "0.2.1";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/fiat/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0086h9qkvnqfm8acrxqbki54z619nj73x7f0d01v5vg2naznx7w9";
+  };
+
+  # Make tests compatible with alcotest 1.4.0
+  postPatch = ''
+    substituteInPlace test/wycheproof/test.ml --replace \
+      'Printf.ksprintf Alcotest.fail' 'Printf.ksprintf (fun s -> Alcotest.fail s)'
+  '';
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ bigarray-compat cstruct eqaf hex ];
+  checkInputs = [ alcotest asn1-combinators benchmark
+                  ppx_deriving_yojson rresult stdlib-shims yojson ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Primitives for Elliptic Curve Cryptography taken from Fiat";
+    homepage = "https://github.com/mirage/fiat";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/fieldslib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/fieldslib/default.nix
new file mode 100644
index 000000000000..4adddbfe54d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fieldslib/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, type_conv, camlp4 }:
+
+assert lib.versionOlder "4.00" (lib.getVersion ocaml);
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "fieldslib-109.20.03 is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-fieldslib-109.20.03";
+
+  src = fetchurl {
+    url = "https://ocaml.janestreet.com/ocaml-core/109.20.00/individual/fieldslib-109.20.03.tar.gz";
+    sha256 = "1dkzk0wf26rhvji80dz1r56dp6x9zqrnp87wldd4pj56jli94vir";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ type_conv camlp4 ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "OCaml 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";
+    license = licenses.asl20;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..819298ac8cf1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fileutils/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage, stdlib-shims, ounit }:
+
+buildDunePackage rec {
+  pname = "fileutils";
+  version = "0.6.3";
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ocaml-fileutils/releases/download/v${version}/fileutils-v${version}.tbz";
+    sha256 = "0qhlhc7fzcq0yfg1wyszsi0gyc4w9hyzmfv84aq9wc79i3283xgg";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  checkInputs = [
+    ounit
+  ];
+  doCheck = true;
+
+  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..ffd0b5003ce4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fix/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "fix";
+  version = "20201120";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = "fix";
+    rev = "${version}";
+    sha256 = "sha256-RO+JCG6R2i5uZfwTYEnQBCVq963fjv5lA2wA/8KrgMg=";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = true;
+
+  meta = with lib; {
+    homepage = "https://gitlab.inria.fr/fpottier/fix/";
+    description = "A simple OCaml module for computing the least solution of a system of monotone equations";
+    license = licenses.cecill-c;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
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..a66976b4a2b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fmt/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner, seq, stdlib-shims }:
+
+if !lib.versionAtLeast ocaml.version "4.05"
+then throw "fmt is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "0.8.9";
+  pname = "ocaml${ocaml.version}-fmt";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/fmt/releases/fmt-${version}.tbz";
+    sha256 = "0gkkkj4x678vxdda4xaw2dd44qjacavsvn5nx8gydfwah6pjbkxk";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg cmdliner ];
+  propagatedBuildInputs = [ seq stdlib-shims ];
+
+  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..55e8e9418955
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fontconfig/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, fontconfig, ocaml }:
+
+stdenv.mkDerivation {
+  name = "ocaml-fontconfig-20131103";
+  src = fetchFromGitHub {
+    owner = "flh";
+    repo = "ocaml-fontconfig";
+    rev = "42daf1697ffcee9c89ee4be3103b6427f7a7b7e5";
+    sha256 = "1fw6bzydmnyh2g4x35mcbg0hypnxqhynivk4nakcsx7prr8zr3yh";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ocaml fontconfig ];
+  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 or [];
+    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..785a71e13a7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/fpath/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, astring }:
+
+if !lib.versionAtLeast ocaml.version "4.03"
+then throw "fpath is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-fpath-0.7.3";
+  src = fetchurl {
+    url = "https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz";
+    sha256 = "03z7mj0sqdz465rc4drj1gr88l9q3nfs374yssvdjdyhjbqqzc0j";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ astring ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "An 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/frontc/default.nix b/nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix
new file mode 100644
index 000000000000..e68f6a28cb47
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/frontc/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchurl, fetchpatch, fetchFromGitHub, ocaml, findlib }:
+
+let
+  meta_file = fetchurl {
+    url = "https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/META";
+    sha256 = "0s2wsinycldk8y5p09xd0hsgbhckhy7bkghzl63bph6mwv64kq2d";
+  };
+in
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-FrontC-${version}";
+  version = "3.4.1";
+
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = "FrontC";
+    rev = "V_3_4_1";
+    sha256 = "1dq5nks0c9gsbr1m8k39m1bniawr5hqcy1r8x5px7naa95ch06ak";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+    description = "C Parsing Library";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.maurer ];
+  };
+
+  patches = [ (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/opam.patch";
+      sha256 = "0v4f6740jbj1kxg1y03dzfa3x3gsrhv06wpzdj30gl4ki5fvj4hs";
+    })
+  ];
+
+  makeFlags = [ "PREFIX=$(out)" "OCAML_SITE=$(OCAMLFIND_DESTDIR)" ];
+
+  postInstall = "cp ${meta_file} $OCAMLFIND_DESTDIR/FrontC/META";
+}
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..4f1083203997
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functoria/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage, alcotest, cmdliner
+, rresult, astring, fmt, ocamlgraph, logs, bos, fpath, ptime
+}:
+
+buildDunePackage rec {
+  pname   = "functoria";
+  version = "3.1.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0bihxbq16zwsi7frk4b8wz8993mvy2ym3n6288jhv0n0gb7c2f7m";
+  };
+
+  propagatedBuildInputs = [ cmdliner rresult astring fmt ocamlgraph logs bos fpath ptime ];
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A 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..2ba13ce87389
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functoria/runtime.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, functoria, cmdliner, fmt, alcotest }:
+
+buildDunePackage {
+  pname = "functoria-runtime";
+
+  inherit (functoria) version useDune2 src;
+
+  propagatedBuildInputs = [ cmdliner fmt ];
+  checkInputs = [ alcotest functoria];
+  doCheck = true;
+
+  meta = with lib; {
+    inherit (functoria.meta) homepage license;
+    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..2f11001874f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/functory/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, ocaml, findlib }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "3.11";
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.02" then {
+    version = "0.6";
+    sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y";
+  } else {
+    version = "0.5";
+    sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3";
+  };
+in
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-functory-${param.version}";
+
+  src = fetchurl {
+    url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz";
+    inherit (param) sha256;
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  installTargets = [ "ocamlfind-install" ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://www.lri.fr/~filliatr/functory/";
+    description = "A distributed computing library for Objective Caml which facilitates distributed execution of parallelizable computations in a seamless fashion";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..348a70a0da9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gapi-ocaml/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml
+, cryptokit, ocamlnet, ocurl, yojson
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "gapi-ocaml";
+  version = "0.4.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "astrada";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0riax23grjnq9pczmp1yv02ji0svvs2kbiqskj6f6yjviamnpa31";
+  };
+
+  propagatedBuildInputs = [ cryptokit ocamlnet ocurl yojson ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.04";
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "OCaml client for google services";
+    homepage = "http://gapi-ocaml.forge.ocamlcore.org";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bennofs ];
+  };
+}
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..77fc0b63c55e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gen/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, ounit }:
+
+let version = "0.5"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-gen-${version}";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "gen";
+    rev = version;
+    sha256 = "14b8vg914nb0yp1hgxzm29bg692m0gqncjj43b599s98s1cwl92h";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ qtest ounit ];
+  strictDeps = true;
+
+  configureFlags = [
+    "--enable-tests"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "https://github.com/c-cube/gen";
+    description = "Simple, efficient iterators for OCaml";
+    license = lib.licenses.bsd3;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..7e7b3a0b9aee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/genspio/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, nonstd, sosa
+}:
+
+buildDunePackage rec {
+  pname = "genspio";
+  version = "0.0.2";
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = pname;
+    rev = "${pname}.${version}";
+    sha256 = "0cp6p1f713sfv4p2r03bzvjvakzn4ili7hf3a952b3w1k39hv37x";
+  };
+
+  minimumOCamlVersion = "4.03";
+
+  propagatedBuildInputs = [ nonstd sosa ];
+
+  configurePhase = ''
+    ocaml please.mlt configure
+  '';
+
+  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/gg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gg/default.nix
new file mode 100644
index 000000000000..58e2b67eacc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gg/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }:
+
+let
+  inherit (lib) getVersion versionAtLeast;
+
+  pname = "gg";
+  version = "0.9.1";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+assert versionAtLeast (getVersion ocaml) "4.01.0";
+
+stdenv.mkDerivation {
+
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "0czj41sr8jsivl3z8wyblf9k971j3kx2wc3s0c1nhzcc8allg9i2";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild opaline ];
+
+  createFindlibDestdir = true;
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
+
+  installPhase = "opaline -libdir $OCAMLFIND_DESTDIR";
+
+  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.
+    '';
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/cohttp-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/git/cohttp-unix.nix
new file mode 100644
index 000000000000..ac6d423d58ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/cohttp-unix.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, git, git-cohttp
+, cohttp-lwt-unix, cohttp-lwt, fmt, lwt, result, rresult, uri
+}:
+
+buildDunePackage {
+  pname = "git-cohttp-unix";
+
+  inherit (git) version src minimumOCamlVersion useDune2;
+
+  propagatedBuildInputs = [
+    git git-cohttp cohttp-lwt-unix cohttp-lwt fmt lwt result rresult uri
+  ];
+
+  meta = git.meta // {
+    description = "A package to use HTTP-based ocaml-git with Unix backend";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/git/cohttp.nix b/nixpkgs/pkgs/development/ocaml-modules/git/cohttp.nix
new file mode 100644
index 000000000000..e9126ba4bece
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/cohttp.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, git
+, cohttp, cohttp-lwt, fmt, lwt, result, rresult, uri
+, alcotest, alcotest-lwt, bigstringaf, cstruct, logs
+, mirage-flow, ke
+}:
+
+buildDunePackage rec {
+  pname = "git-cohttp";
+
+  inherit (git) version minimumOCamlVersion src useDune2;
+
+  propagatedBuildInputs = [
+    git cohttp cohttp-lwt fmt lwt result rresult uri
+  ];
+
+  meta = git.meta // {
+    description = "A package to use HTTP-based ocaml-git with Unix backend";
+  };
+}
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..954e4956c816
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchurl, buildDunePackage
+, alcotest, mtime, mirage-crypto-rng, tls, git-binary
+, angstrom, astring, cstruct, decompress, digestif, encore, duff, 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
+}:
+
+buildDunePackage rec {
+  pname = "git";
+  version = "3.4.0";
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-git/releases/download/${version}/git-${version}.tbz";
+    sha256 = "6eef1240c7c85a8e495b82ef863c509ad41d75e0c45cf73c34ed1bdafd03413f";
+  };
+
+  # remove changelog for the carton package
+  postPatch = ''
+    rm CHANGES.carton.md
+  '';
+
+  buildInputs = [
+    base64
+  ];
+  propagatedBuildInputs = [
+    angstrom astring checkseum cstruct decompress digestif encore duff 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
+  ];
+  checkInputs = [
+    alcotest alcotest-lwt mtime mirage-crypto-rng tls git-binary crowbar
+  ];
+  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/paf.nix b/nixpkgs/pkgs/development/ocaml-modules/git/paf.nix
new file mode 100644
index 000000000000..cf0272ddf3b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/paf.nix
@@ -0,0 +1,49 @@
+{ lib, buildDunePackage
+, git
+, mimic
+, paf
+, ca-certs-nss
+, cohttp
+, cohttp-lwt
+, fmt
+, ipaddr
+, logs
+, lwt
+, mirage-clock
+, mirage-stack
+, mirage-time
+, result
+, rresult
+, tls
+, uri
+}:
+
+buildDunePackage {
+  pname = "git-paf";
+
+  inherit (git) version src minimumOCamlVersion useDune2;
+
+  propagatedBuildInputs = [
+    git
+    mimic
+    paf
+    ca-certs-nss
+    cohttp
+    cohttp-lwt
+    fmt
+    lwt
+    result
+    rresult
+    ipaddr
+    logs
+    mirage-clock
+    mirage-stack
+    mirage-time
+    tls
+    uri
+  ];
+
+  meta = git.meta // {
+    description = "A 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..3e5f464cea06
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/git/unix.nix
@@ -0,0 +1,43 @@
+{ buildDunePackage, git
+, mmap, rresult, result, bigstringaf
+, fmt, bos, fpath, uri, digestif, logs, lwt, git-cohttp-unix
+, mirage-clock, mirage-clock-unix, astring, awa, cmdliner
+, cohttp-lwt-unix, decompress, domain-name, ipaddr, mtime
+, tcpip, awa-mirage, mirage-flow
+, alcotest, alcotest-lwt, base64, cstruct
+, ke, mirage-crypto-rng, ocurl, git-binary
+, ptime, mimic, ca-certs-nss, tls, tls-mirage
+, cacert
+}:
+
+buildDunePackage {
+  pname = "git-unix";
+  inherit (git) version src minimumOCamlVersion;
+
+  useDune2 = true;
+
+  buildInputs = [
+    awa awa-mirage cmdliner git-cohttp-unix
+    mirage-clock mirage-clock-unix tcpip
+  ];
+  propagatedBuildInputs = [
+    mmap rresult result bigstringaf
+    fmt bos fpath uri digestif logs lwt
+    astring cohttp-lwt-unix decompress
+    domain-name ipaddr mtime mirage-flow
+    cstruct ptime mimic ca-certs-nss
+    tls tls-mirage
+  ];
+  checkInputs = [
+    alcotest alcotest-lwt base64 ke
+    mirage-crypto-rng git-binary
+    cohttp-lwt-unix
+    cacert # sets up NIX_SSL_CERT_FILE
+  ];
+  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/gmap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix
new file mode 100644
index 000000000000..407919f91bc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gmap/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, ocaml, fetchurl, alcotest }:
+
+buildDunePackage rec {
+  pname = "gmap";
+  version = "0.3.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/gmap/releases/download/${version}/gmap-${version}.tbz";
+    sha256 = "073wa0lrb0jj706j87cwzf1a8d1ff14100mnrjs8z3xc4ri9xp84";
+  };
+
+  minimumOCamlVersion = "4.03";
+
+  checkInputs = [ alcotest ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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/gmetadom/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gmetadom/default.nix
new file mode 100644
index 000000000000..29df5ce8f4e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gmetadom/default.nix
@@ -0,0 +1,35 @@
+{stdenv, lib, fetchurl, ocaml, findlib, gdome2, libxslt, pkg-config}:
+
+let
+  pname = "gmetadom";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "0.2.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/${pname}/${pname}/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0skmlv0pnqvg99wzzzi1h4zhwzd82xg7xpkj1kwpfy7bzinjh7ig";
+  };
+
+  patches = [ ./gcc-4.3.patch ];
+
+  dontDisableStatic = true;
+
+  preConfigure=''
+    configureFlags="--with-ocaml-lib-prefix=$out/lib/ocaml/${ocaml.version}/site-lib"
+  '';
+
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ocaml findlib gdome2 libxslt];
+  propagatedBuildInputs = [gdome2];
+
+  meta = {
+    homepage = "http://gmetadom.sourceforge.net/";
+    description = "A collection of librares, each library providing a DOM implementation";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.roconnor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch b/nixpkgs/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch
new file mode 100644
index 000000000000..d8d1d4631632
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## gcc-4.3.dpatch by Stefano Zacchiroli <zack@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: ensure sources build with gcc-4.3
+
+@DPATCH@
+diff -urNad trunk~/src/shared/Traits.hh.in trunk/src/shared/Traits.hh.in
+--- trunk~/src/shared/Traits.hh.in	2003-01-14 12:41:55.000000000 +0100
++++ trunk/src/shared/Traits.hh.in	2008-05-01 15:45:39.000000000 +0200
+@@ -26,6 +26,7 @@
+  */
+ 
+ #include <string>
++#include <cstring>
+ 
+ #include "@DOM_NAMESPACE@Char.hh"
+ 
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..10d0b4ea6fc7
--- /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.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/graphics/releases/download/${version}/graphics-${version}.tbz";
+    sha256 = "sha256-KGyD497ZKHA2xeXHezmh3P1zoSlre1h5N9zjkAFmMo4=";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ libX11 ];
+
+  meta = {
+    homepage = "https://github.com/ocaml/graphics";
+    description = "A 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..09f4757041af
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/cohttp.nix
@@ -0,0 +1,26 @@
+{ 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;
+
+  useDune2 = true;
+
+  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..f3adfdc87a9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/default.nix
@@ -0,0 +1,18 @@
+{ buildDunePackage, alcotest, graphql_parser, rresult, yojson }:
+
+buildDunePackage rec {
+  pname = "graphql";
+
+  inherit (graphql_parser) version useDune2 src;
+
+  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..187856da0d61
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/lwt.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, alcotest, graphql, ocaml_lwt }:
+
+buildDunePackage rec {
+  pname = "graphql-lwt";
+
+  inherit (graphql) version useDune2 src;
+
+  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..62f8ca1ef129
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql/parser.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchurl, alcotest, fmt, menhir, re }:
+
+buildDunePackage rec {
+  pname = "graphql_parser";
+  version = "0.13.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/andreas/ocaml-graphql-server/releases/download/${version}/graphql-${version}.tbz";
+    sha256 = "0gb5y99ph0nz5y3pc1gxq1py4wji2hyf2ydbp0hv23v00n50hpsm";
+  };
+
+  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..aa149d60e4d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/graphql_ppx/default.nix
@@ -0,0 +1,37 @@
+{ lib, buildDunePackage, fetchFromGitHub, alcotest, reason
+, ppxlib
+, yojson }:
+
+buildDunePackage rec {
+  pname = "graphql_ppx";
+  version = "1.2.0";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "reasonml-community";
+    repo = "graphql-ppx";
+    rev = "v${version}";
+    sha256 = "1fymmvk616wv5xkwfdmqibdgfl47ry6idc5wfh20a3mz9mpaa13s";
+  };
+
+  buildInputs = [ ppxlib ];
+
+  propagatedBuildInputs = [
+    reason
+    yojson
+  ];
+
+  checkInputs = [ alcotest ];
+
+  doCheck = true;
+
+  useDune2 = 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..eacdda27f435
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gsl/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, buildDunePackage, pkg-config, gsl, darwin, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "gsl";
+  version = "1.24.3";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/gsl-ocaml/releases/download/${version}/gsl-${version}.tbz";
+    sha256 = "1mpzcgbrha2l8iikqbmn32668v2mnnsykxg5n5jgs0qnskn2nvrn";
+  };
+
+  buildInputs = [ dune-configurator gsl pkg-config ];
+  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/gtktop/default.nix b/nixpkgs/pkgs/development/ocaml-modules/gtktop/default.nix
new file mode 100644
index 000000000000..e1afefc6a79f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/gtktop/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchurl, ocaml, camlp4, findlib, lablgtk-extras }:
+
+let pname = "gtktop-2.0"; in
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "${pname} is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-${pname}";
+
+  src = fetchurl {
+    url = "http://zoggy.github.io/gtktop/${pname}.tar.gz";
+    sha256 = "0cpmnavvham9mwxknm6df90g9qxabcvn2kfwlf9mncqa0z3rknz6";
+  };
+
+  buildInputs = [ ocaml camlp4 findlib ];
+  propagatedBuildInputs = [ lablgtk-extras ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://zoggy.github.io/gtktop/";
+    description = "A small OCaml library to ease the creation of graphical toplevels";
+    license = lib.licenses.lgpl3;
+    maintainers = with lib.maintainers; [ vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..dd96e0ecc441
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/h2/default.nix
@@ -0,0 +1,59 @@
+{ 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
+    useDune2
+    ;
+
+  minimumOCamlVersion = "4.06";
+
+  propagatedBuildInputs = [
+    angstrom
+    faraday
+    base64
+    psq
+    hpack
+    httpaf
+  ];
+
+  # Tests fail with 4.06
+  doCheck = lib.versionAtLeast ocaml.version "4.07";
+  preCheck = ''
+    ln -s "${http2-frame-test-case}" lib_test/http2-frame-test-case
+  '';
+  checkInputs = [
+    alcotest
+    yojson
+    hex
+  ];
+
+  meta = hpack.meta // {
+    description = "A 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..f9bc67772125
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hack_parallel/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, core, core_kernel, pkg-config, sqlite
+}:
+buildDunePackage rec {
+  pname = "hack_parallel";
+  version = "1.0.1";
+  useDune2 = true;
+  minimumOcamlVersion = "4.04.1";
+
+  src = fetchFromGitHub {
+    owner = "rvantonder";
+    repo = "hack_parallel";
+    rev = version;
+    sha256 = "0qjlkw35r4q2cm0n2x0i73zvx1xgrp6axaia2nm8zxpm49mid629";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ core core_kernel 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/hacl-star/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix
new file mode 100644
index 000000000000..8a29439c7a59
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, hacl-star-raw, zarith, cppo }:
+
+buildDunePackage {
+  pname = "hacl-star";
+
+  inherit (hacl-star-raw) version src meta doCheck minimalOCamlVersion;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    hacl-star-raw
+    zarith
+  ];
+
+  buildInputs = [
+    cppo
+  ];
+}
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..aa787c9a91a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl-star/raw.nix
@@ -0,0 +1,53 @@
+{ lib, which, stdenv, fetchzip, ocaml, findlib, hacl-star, ctypes, cppo }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-hacl-star-raw";
+  version = "0.3.2";
+
+  src = fetchzip {
+    url = "https://github.com/project-everest/hacl-star/releases/download/ocaml-v${version}/hacl-star.${version}.tar.gz";
+    sha256 = "1wp27vf0g43ggs7cv85hpa62jjvzkwzzg5rfznbwac6j6yr17zc7";
+    stripRoot = false;
+  };
+
+  sourceRoot = "./source/raw";
+
+  minimalOCamlVersion = "4.05";
+
+  postPatch = ''
+    patchShebangs ./
+  '';
+
+  preInstall = ''
+    mkdir -p $OCAMLFIND_DESTDIR/stublibs
+  '';
+
+  installTargets = "install-hacl-star-raw";
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  buildInputs = [
+    which
+    ocaml
+    findlib
+  ];
+
+  propagatedBuildInputs = [
+    ctypes
+  ];
+
+  checkInputs = [
+    cppo
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Auto-generated low-level OCaml bindings for EverCrypt/HACL*";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+    platforms = ocaml.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/hacl_x25519/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hacl_x25519/default.nix
new file mode 100644
index 000000000000..46a04a51fcab
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hacl_x25519/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, benchmark, cstruct
+, alcotest , eqaf, hex, ppx_blob, ppx_deriving_yojson, stdlib-shims, yojson }:
+
+buildDunePackage rec {
+  pname = "hacl_x25519";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/hacl/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0ppq56i2yhxzz38w120aynnkx10kncl86zvqip9zx0v4974k3k4x";
+  };
+
+  useDune2 = true;
+  propagatedBuildInputs = [ eqaf cstruct ];
+  checkInputs = [ alcotest benchmark hex ppx_blob ppx_deriving_yojson stdlib-shims yojson ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Primitives for Elliptic Curve Cryptography taken from Project Everest";
+    homepage = "https://github.com/mirage/hacl";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/herelib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/herelib/default.nix
new file mode 100644
index 000000000000..c5223637a158
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/herelib/default.nix
@@ -0,0 +1,20 @@
+{lib, buildOcaml, fetchurl}:
+
+buildOcaml rec {
+  version = "112.35.00";
+  name = "herelib";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/herelib/archive/${version}.tar.gz";
+    sha256 = "03rrlpjmnd8d1rzzmd112355m7a5bwn3vf90xkbc6gkxlad9cxbs";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/herelib";
+    description = "Syntax extension for inserting the current location";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
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..4a6123ebd3a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hex/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, bigarray-compat, cstruct }:
+
+buildDunePackage rec {
+  pname = "hex";
+  version = "1.4.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/hex-v${version}.tbz";
+    sha256 = "07b9y0lmnflsslkrm6xilkj40n8sf2hjqkyqghnk7sw5l0plkqsp";
+  };
+
+  propagatedBuildInputs = [ bigarray-compat 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..0de997881c2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hidapi/default.nix
@@ -0,0 +1,29 @@
+{ pkgs, lib, fetchurl, buildDunePackage, pkg-config, dune-configurator
+, bigstring,
+}:
+
+buildDunePackage rec {
+  pname = "hidapi";
+  version = "1.1.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/vbmithr/ocaml-hidapi/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "1j7rd7ajrzla76r3sxljx6fb18f4f4s3jd7vhv59l2ilxyxycai2";
+  };
+
+  minimumOCamlVersion = "4.03";
+
+  buildInputs = [ pkgs.hidapi pkg-config dune-configurator ];
+  propagatedBuildInputs = [ bigstring ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = https://github.com/vbmithr/ocaml-hidapi;
+    description = "Bindings to Signal11's hidapi library";
+    license = licenses.isc;
+    maintainers = [ maintainers.alexfmpe ];
+  };
+}
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..3c4b7a37f99e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/higlo/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, xtmpl, ulex }:
+
+stdenv.mkDerivation rec {
+  pname = "higlo";
+  version = "0.6";
+  src = fetchFromGitHub {
+    owner = "zoggy";
+    repo = "higlo";
+    rev = "release-${version}";
+    sha256 = "0m0qyk2ydivai54502s45sdw9w4xr0j3jpwyc4vqk62a7iz9ihxh";
+  };
+
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ xtmpl ulex ];
+
+  createFindlibDestdir = true;
+
+  patches = ./install.patch;
+
+  meta = with lib; {
+    description = "OCaml library for syntax highlighting";
+    homepage = "https://zoggy.github.io/higlo/";
+    license = licenses.lgpl3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ regnat ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/higlo/install.patch b/nixpkgs/pkgs/development/ocaml-modules/higlo/install.patch
new file mode 100644
index 000000000000..bbdaace293bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/higlo/install.patch
@@ -0,0 +1,14 @@
+diff --git a/Makefile b/Makefile
+index b8c2e01..fcd07ed 100644
+--- a/Makefile
++++ b/Makefile
+@@ -149,7 +149,8 @@ webdoc:
+ install: install-lib install-bin
+ 
+ install-bin:
+-	$(CP) $(HIGLO) $(HIGLO_BYTE) $(MK_HIGLO) `dirname \`which ocamlfind\``/
++	mkdir -p $(out)/bin
++	$(CP) $(HIGLO) $(HIGLO_BYTE) $(MK_HIGLO) $(out)/bin
+ 
+ install-lib: higlo.cmo higlo.cmx higlo.cmxs $(HIGLO) $(HIGLO_BYTE)
+ 	ocamlfind install higlo META LICENSE \
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..9832a5f4c41b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hkdf/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchurl, cstruct, mirage-crypto, alcotest }:
+
+buildDunePackage rec {
+  pname = "hkdf";
+  version = "1.0.4";
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0nzx6vzbc1hh6vx1ly8df4b16lgps6zjpp9mjycsnnn49bddc9mr";
+  };
+
+  useDune2 = true;
+
+  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..67622a8ef6a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hmap/default.nix
@@ -0,0 +1,41 @@
+{ 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";
+  };
+
+  buildInputs = [ ocaml ocamlbuild findlib topkg ];
+
+  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..ec967312b874
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hpack/default.nix
@@ -0,0 +1,37 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, angstrom
+, faraday
+}:
+
+buildDunePackage rec {
+  pname = "hpack";
+  version = "0.8.0";
+
+  src = fetchurl {
+    url = "https://github.com/anmonteiro/ocaml-h2/releases/download/${version}/h2-${version}.tbz";
+    sha256 = "0qcn3yvyz0h419fjg9nb20csfmwmh3ihz0zb0jfzdycf5w4mlry6";
+  };
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.04";
+
+  propagatedBuildInputs = [
+    angstrom
+    faraday
+  ];
+
+  # circular dependency
+  doCheck = false;
+
+  meta = {
+    license = lib.licenses.bsd3;
+    description = "An 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/httpaf/default.nix b/nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix
new file mode 100644
index 000000000000..fbc21108bd02
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/httpaf/default.nix
@@ -0,0 +1,36 @@
+{ lib, fetchFromGitHub, fetchpatch, buildDunePackage
+, angstrom, faraday, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "httpaf";
+  version = "0.6.6";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = pname;
+    rev = version;
+    sha256 = "065ikryv8zw9cbk6ddcjcind88ckk0inz9m3sqj9nwyfw4v4scm6";
+  };
+
+  patches = [
+    # Fix tests with angstrom ≥ 0.14
+    (fetchpatch {
+      url = "https://github.com/inhabitedtype/httpaf/commit/fc0de5f2f1bd8df953ae4d4c9a61032392436c84.patch";
+      sha256 = "1a8ca76ifbgyaq1bqfyq18mmxinjjparzkrr7ljbj0y1z1rl748z";
+    })
+  ];
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ angstrom faraday ];
+  doCheck = true;
+
+  meta = {
+    description = "A 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/hxd/default.nix b/nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix
new file mode 100644
index 000000000000..0775e21b1f8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/hxd/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildDunePackage, fetchurl
+, ocaml, dune-configurator, cmdliner
+, lwt, withLwt ? lib.versionAtLeast ocaml.version "4.07"
+}:
+
+buildDunePackage rec {
+  pname = "hxd";
+  version = "0.3.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.06";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/hxd/releases/download/v${version}/hxd-v${version}.tbz";
+    sha256 = "1c226c91e17cd329dec0c287bfd20f36302aa533069ff9c6ced32721f96b29bc";
+  };
+
+  # ignore yes stderr output due to trapped SIGPIPE
+  postPatch = ''
+    sed -i 's|yes ".\+"|& 2> /dev/null|' test/*.t
+  '';
+
+  nativeBuildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = lib.optional withLwt lwt;
+
+  buildInputs = [
+    cmdliner
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Hexdump in OCaml";
+    homepage = "https://github.com/dinosaure/hxd";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
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..580db48769ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/imagelib/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, decompress, stdlib-shims, alcotest
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.07";
+  version = "20210511";
+  pname = "imagelib";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/rlepigre/ocaml-imagelib/releases/download/${version}/imagelib-${version}.tbz";
+    sha256 = "1cb94ea3731dc994c205940c9434543ce3f2470cdcb2e93a3e02ed793e80d480";
+  };
+
+  propagatedBuildInputs = [ decompress stdlib-shims ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "Image formats such as PNG and PPM in OCaml";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/rlepigre/ocaml-imagelib";
+  };
+}
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..8e503f5ddd25
--- /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
+}:
+
+buildDunePackage rec {
+  pname = "index";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/index/releases/download/${version}/index-${version}.tbz";
+    sha256 = "13xd858c50fs651p1y8x70323ff0gzbf6zgc0a25f6xh3rsmkn4c";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  buildInputs = [
+    stdlib-shims
+  ];
+  propagatedBuildInputs = [
+    cmdliner
+    fmt
+    logs
+    mtime
+    ppx_repr
+    progress
+    repr
+    semaphore-compat
+    optint
+  ];
+
+  checkInputs = [
+    alcotest
+    crowbar
+    re
+  ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A 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..ad9bd3e2dc71
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/inifiles/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocaml_pcre }:
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-inifiles-1.2";
+
+  src = fetchurl {
+    url = "http://archive.ubuntu.com/ubuntu/pool/universe/o/ocaml-inifiles/ocaml-inifiles_1.2.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";
+  })];
+
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ ocaml_pcre ];
+
+  buildFlags = [ "all" "opt" ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "A 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..8910b720a847
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/inotify/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, ocamlbuild
+, ocaml_lwt # optional lwt support
+, ounit, fileutils # only for tests
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.3";
+  name = "ocaml${ocaml.version}-inotify-${version}";
+
+  src = fetchFromGitHub {
+    owner = "whitequark";
+    repo = "ocaml-inotify";
+    rev = "v${version}";
+    sha256 = "1s6vmqpx19hxzsi30jvp3h7p56rqnxfhfddpcls4nz8sqca1cz5y";
+  };
+
+  patches = [ (fetchpatch {
+    url = "https://github.com/whitequark/ocaml-inotify/commit/716c8002cc1652f58eb0c400ae92e04003cba8c9.patch";
+    sha256 = "04lfxrrsmk2mc704kaln8jqx93jc4bkxhijmfy2d4cmk1cim7r6k";
+  }) ];
+
+  buildInputs = [ ocaml findlib ocamlbuild ocaml_lwt ];
+  checkInputs = [ ounit fileutils ];
+
+  configureFlags = [ "--enable-lwt"
+    (lib.optionalString doCheck "--enable-tests") ];
+
+  postConfigure = lib.optionalString doCheck ''
+    echo '<lib_test/test_inotify_lwt.*>: pkg_threads' | tee -a _tags
+  '';
+
+  doCheck = true;
+  checkTarget = "test";
+
+  createFindlibDestdir = 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..ed5ccbedb64d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/integers/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+
+buildDunePackage rec {
+  pname = "integers";
+  version = "0.5.1";
+
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  src = fetchFromGitHub {
+    owner = "ocamllabs";
+    repo = "ocaml-integers";
+    rev = version;
+    sha256 = "0by5pc851fk7ccxqy1w2qc5jwn9z8whyqhs5gxlm5986vr9msnyi";
+  };
+
+  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/io-page/default.nix b/nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix
new file mode 100644
index 000000000000..9685e27d0b8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/io-page/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, cstruct, bigarray-compat, ounit }:
+
+buildDunePackage rec {
+  pname = "io-page";
+  version = "2.3.0";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.02.3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "1hx27pwf419hrhwaw9cphbnl8akz8yy73hqj49l15g2k7shah1cn";
+  };
+
+  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/io-page/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/io-page/unix.nix
new file mode 100644
index 000000000000..843451b30866
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/io-page/unix.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, io-page, cstruct, ounit }:
+
+buildDunePackage {
+  pname = "io-page-unix";
+
+  inherit (io-page) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [ cstruct io-page ];
+  checkInputs = [ ounit ];
+  doCheck = true;
+
+  meta = with lib; {
+    inherit (io-page.meta) homepage license;
+    description = "Support for efficient handling of I/O memory pages on Unix";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
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..d1386230452c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/cstruct.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage
+, ipaddr, cstruct
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr-cstruct";
+
+  inherit (ipaddr) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [ ipaddr cstruct ];
+
+  doCheck = true;
+
+  meta = ipaddr.meta // {
+    description = "A 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..3090066c2f4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage
+, macaddr, domain-name, stdlib-shims
+, ounit, ppx_sexp_conv
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr";
+
+  inherit (macaddr) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [ macaddr domain-name stdlib-shims ];
+
+  checkInputs = [ ppx_sexp_conv ounit ];
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "A 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..1ede3c064ada
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ipaddr/sexp.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage
+, ipaddr, ipaddr-cstruct, ounit, ppx_sexp_conv
+}:
+
+buildDunePackage rec {
+  pname = "ipaddr-sexp";
+
+  inherit (ipaddr) version src useDune2 minimumOCamlVersion;
+
+  propagatedBuildInputs = [ ipaddr ];
+
+  checkInputs = [ ipaddr-cstruct ounit ppx_sexp_conv ];
+  doCheck = true;
+
+  meta = ipaddr.meta // {
+    description = "A 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..0845e4c1841e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iri/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitLab, ocaml, findlib
+, sedlex, uunf, uutf
+}:
+
+if !lib.versionAtLeast ocaml.version "4.03"
+then throw "iri is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  version = "0.4.0";
+  name = "ocaml${ocaml.version}-iri-${version}";
+
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "ocaml-iri";
+    rev = version;
+    sha256 = "0fsmfmzmyggm0h77a7mb0n41vqi6q4ln1xzsv72zbvysa7l8w84q";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  propagatedBuildInputs = [ sedlex uunf uutf ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "IRI (RFC3987) native OCaml implementation";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+    inherit (ocaml.meta) platforms;
+  };
+}
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..82818b39492d
--- /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.4.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/irmin-watcher/releases/download/${version}/irmin-watcher-${version}.tbz";
+    sha256 = "00d4ph4jbsw6adp3zqdrwi099hfcf7p1xzi0685qr7bgcmandjfv";
+  };
+
+  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..0014bbbcfcb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/chunk.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, irmin, irmin-test, alcotest }:
+
+buildDunePackage rec {
+
+  pname = "irmin-chunk";
+  inherit (irmin) version src useDune2;
+
+  propagatedBuildInputs = [ irmin ];
+
+  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..76383099a41d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/containers.nix
@@ -0,0 +1,27 @@
+{ buildDunePackage
+, irmin, irmin-unix, irmin-git, ppx_irmin, lwt, mtime
+, alcotest, alcotest-lwt, cacert
+}:
+
+buildDunePackage {
+  pname = "irmin-containers";
+
+  inherit (ppx_irmin) src version useDune2;
+
+  nativeBuildInputs = [
+    ppx_irmin
+  ];
+
+  propagatedBuildInputs = [
+    irmin irmin-unix irmin-git 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..fe13377b3c2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildDunePackage
+, astring, digestif, fmt, jsonm, logs, ocaml_lwt, ocamlgraph, uri
+, repr, ppx_irmin, bheap
+}:
+
+buildDunePackage {
+  pname = "irmin";
+
+  inherit (ppx_irmin) src version;
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.07";
+
+  propagatedBuildInputs = [
+    astring
+    digestif
+    fmt
+    jsonm
+    logs
+    ocaml_lwt
+    ocamlgraph
+    uri
+    repr
+    bheap
+    ppx_irmin
+  ];
+
+  # circular dependency on irmin-mem
+  doCheck = false;
+
+  meta = ppx_irmin.meta // {
+    description = "A 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..0e9596751b82
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/fs.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, irmin, irmin-test }:
+
+buildDunePackage rec {
+
+  pname = "irmin-fs";
+
+  inherit (irmin) version src;
+
+  propagatedBuildInputs = [ irmin ];
+
+  useDune2 = true;
+
+  checkInputs = lib.optional doCheck irmin-test;
+
+  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..d477c932928e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/git.nix
@@ -0,0 +1,38 @@
+{ lib, buildDunePackage
+, git, irmin, irmin-test, ppx_irmin, git-cohttp-unix, git-unix
+, digestif, cstruct, fmt, astring, fpath, logs, lwt, uri
+, mtime, alcotest, cacert
+}:
+
+buildDunePackage {
+
+  pname = "irmin-git";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    git
+    irmin
+    ppx_irmin
+    digestif
+    cstruct
+    fmt
+    astring
+    fpath
+    logs
+    lwt
+    uri
+  ];
+
+  checkInputs = [ mtime alcotest git-cohttp-unix git-unix 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..03c8f1eca291
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/graphql.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage, cohttp-lwt, graphql-cohttp, graphql-lwt, irmin
+, alcotest, alcotest-lwt, logs, yojson, cohttp-lwt-unix, cacert
+}:
+
+buildDunePackage rec {
+
+  pname = "irmin-graphql";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ cohttp-lwt graphql-cohttp graphql-lwt irmin ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    logs
+    cohttp-lwt-unix
+    yojson
+    cacert
+  ];
+
+  meta = irmin.meta // {
+    description = "GraphQL server for Irmin";
+  };
+
+}
+
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/http.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/http.nix
new file mode 100644
index 000000000000..7bfae9982021
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/http.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, cohttp-lwt, irmin, webmachine
+, checkseum, git-unix, irmin-git, irmin-test, digestif, git-cohttp-unix
+, cacert
+}:
+
+buildDunePackage rec {
+
+  pname = "irmin-http";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ cohttp-lwt irmin webmachine ];
+
+  checkInputs = [
+    digestif checkseum git-cohttp-unix git-unix irmin-git irmin-test cacert
+  ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "HTTP client and server for Irmin";
+  };
+
+}
+
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/layers.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/layers.nix
new file mode 100644
index 000000000000..40410b004ae7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/layers.nix
@@ -0,0 +1,18 @@
+{ buildDunePackage, irmin, mtime, logs, lwt }:
+
+buildDunePackage {
+  pname = "irmin-layers";
+
+  inherit (irmin) version src useDune2;
+
+  propagatedBuildInputs = [
+    irmin
+    mtime
+    logs
+    lwt
+  ];
+
+  meta = irmin.meta // {
+    description = "Combine different Irmin stores into a single, layered store";
+  };
+}
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..e33b766bd4cb
--- /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 useDune2;
+
+  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..d550b9c924b1
--- /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 useDune2;
+
+  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..675c8a3fdd28
--- /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 useDune2;
+
+  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..5955dda8ed99
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/pack.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage
+, alcotest-lwt, index, irmin, irmin-layers, irmin-test, ocaml_lwt, fpath, optint
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.02.3";
+
+  pname = "irmin-pack";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  buildInputs = [ fpath ];
+  propagatedBuildInputs = [ index irmin irmin-layers ocaml_lwt optint ];
+
+  checkInputs = [ alcotest-lwt irmin-test ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Irmin backend which stores values in a pack file";
+  };
+
+}
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..8d57e18dc814
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/ppx.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, ppxlib, ppx_repr }:
+
+buildDunePackage rec {
+  pname = "ppx_irmin";
+  version = "2.7.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/irmin/releases/download/${version}/irmin-${version}.tbz";
+    sha256 = "29c68c5001a727aaa7a6842d6204ffa3e24b3544fa4f6af2234cdbfa032f7fdf";
+  };
+
+  minimumOCamlVersion = "4.08";
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    ppx_repr
+    ppxlib
+  ];
+
+  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..90141d925e6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/test.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage
+, alcotest, cmdliner, irmin, metrics-unix, mtime, irmin-layers
+}:
+
+buildDunePackage {
+
+  pname = "irmin-test";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    alcotest cmdliner irmin metrics-unix mtime irmin-layers
+  ];
+
+  meta = irmin.meta // {
+    description = "Irmin test suite";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/irmin/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/irmin/unix.nix
new file mode 100644
index 000000000000..89cf36979bde
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/irmin/unix.nix
@@ -0,0 +1,32 @@
+{ lib, buildDunePackage
+, checkseum, cmdliner, git-unix, git-cohttp-unix, yaml, fpath
+, irmin, irmin-fs, irmin-git, irmin-graphql, irmin-http
+, irmin-pack, irmin-watcher, irmin-test, cacert
+}:
+
+buildDunePackage rec {
+
+  pname = "irmin-unix";
+
+  inherit (irmin) version src;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    checkseum cmdliner git-unix yaml fpath
+    irmin irmin-fs irmin-git irmin-graphql irmin-http
+    irmin-pack irmin-watcher git-cohttp-unix
+  ];
+
+  checkInputs = [
+    irmin-test cacert
+  ];
+
+  doCheck = true;
+
+  meta = irmin.meta // {
+    description = "Unix backends for Irmin";
+  };
+
+}
+
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..d1b55609bc4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iso8601/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild }:
+
+let version = "0.2.4"; in
+
+stdenv.mkDerivation {
+  pname = "ocaml-iso8601";
+  inherit version;
+  src = fetchzip {
+    url = "https://github.com/sagotch/ISO8601.ml/archive/${version}.tar.gz";
+    sha256 = "0ypdd1p04xdjxxx3b61wp7abswfrq3vcvwwaxvywxwqljw0dhydi";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  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..d7b3ff64d30f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/iter/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, dune-configurator
+, mdx, qtest, result
+}:
+
+buildDunePackage rec {
+  pname = "iter";
+  version = "1.2.1";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = version;
+    sha256 = "0j2sg50byn0ppmf6l36ksip7zx1d3gv7sc4hbbxs2rmx39jr7vxh";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ result ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.07";
+  checkInputs = [ mdx.bin qtest ];
+
+  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..10d8886d9947
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.12.nix
@@ -0,0 +1,508 @@
+{ 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 ];
+  };
+
+  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 {
+    pname = "base_quickcheck";
+    hash = "1la6qgq1zwmfyq1hqy6i337w435ym5yqgx2ygk86qip6nws0s6r3";
+    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 = [ 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.2";
+    hash = "0c85bjvadrb4pmjcg0gjk3bkkgka62r90pjm690mjvcbbv5zjxzj";
+    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_ssl = janePackage {
+    pname = "async_ssl";
+    hash = "02ard8x5q5c42d9jdqmyzfx624yjq8cxxmvq3zb82hf6p8cc57ml";
+    meta = {
+      description = "An Async-pipe-based interface with OpenSSL";
+      # ctypes no longer works with dune 1
+      # dune 2 no longer supports jbuild
+      broken = true;
+    };
+    propagatedBuildInputs = [ async ctypes openssl ];
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673";
+    meta.description = "Directory traversal with Async";
+    propagatedBuildInputs = [ async ];
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "1sw32lb0y501y971ij7287796lvfhs0nfgla895r74ymfks2rcjb";
+    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 ];
+  };
+
+  ### Packages at version 0.11, with dependencies at version 0.12
+
+  configurator = janePackage {
+    pname = "configurator";
+    version = "0.11.0";
+    hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk";
+    propagatedBuildInputs = [ stdio ];
+    meta.description = "Helper library for gathering system configuration";
+  };
+
+  ppx_core = janePackage {
+    pname = "ppx_core";
+    version = "0.11.0";
+    hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_driver = janePackage {
+    pname = "ppx_driver";
+    version = "0.11.0";
+    hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_type_conv = janePackage {
+    pname = "ppx_type_conv";
+    version = "0.11.0";
+    hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+}
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..8f7262b47760
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/0.14.nix
@@ -0,0 +1,863 @@
+{ self
+, lib
+, openssl
+, zstd
+}:
+
+with self;
+
+{
+
+  accessor = janePackage {
+    pname = "accessor";
+    version = "0.14.1";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.09";
+    hash = "1xjbvvijkyw4dlys47x4896y3kqm2zn0yg60cqrp57i2dwxg0nsj";
+    meta.description = "Accessors for Base types, for use with the Accessor library";
+    propagatedBuildInputs = [ ppx_accessor ];
+  };
+
+  accessor_core = janePackage {
+    minimumOCamlVersion = "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 = lib.versionAtLeast ocaml.version "4.12";
+    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 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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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
+  };
+
+  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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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 ];
+  };
+
+  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";
+    minimumOCamlVersion = "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.3";
+    minimumOCamlVersion = "4.04.1";
+    hash = "00nrar7h2pyflbdiq6wwwrb4k5jh9iff0jllihzm6ms8d5pspsg5";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    version = "0.14.1";
+    hash = "1nr0ncb8l2mkk8pqzknr7fsqw5kpz8y102kyv5bc0x7c36v0d4zy";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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.2";
+    minimumOCamlVersion = "4.09";
+    hash = "01nifsh7gap28cpvff6i569lqr1gmyhrklkisgri538cp4pf1wq1";
+    meta.description = "[@@deriving] plugin to generate accessors for use with the Accessor libraries";
+    propagatedBuildInputs = [ accessor ];
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "03mzgm4smrczp5dg3mpr6zc2v6a54n0r01k4ww820yrr25hcf8ip";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Base set of ppx rewriters";
+    propagatedBuildInputs = [ ppx_cold ppx_enumerate ppx_hash ppx_js_style ];
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    version = "0.14.1";
+    hash = "12r7jgqgpb4i4cry3rgyl2nmxcscs5w7mmk06diz7i49r27p96im";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Expands [@cold] into [@inline never][@specialise never][@local never]";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "11pj76dimx2f7l8m85myzp6yzx9xcg0bqi97s7ayssvkckm57390";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Simpler notation for fixed point literals";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "1zf03xdrg4jig7pdcrdpbabyjkdpifb31z2z1bf9wfdawybdhwkq";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Standard Jane Street ppx rewriters";
+    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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Code style checker for Jane Street Packages";
+    propagatedBuildInputs = [ octavius ppxlib ];
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "1jq3g88xv9g6y9im67hiig3cfn5anwwnq09mp7yn7a86ha5r9w3i";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Monadic let-bindings";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_log = janePackage {
+    pname = "ppx_log";
+    hash = "10hnr5lpww3fw0bnidzngalbgy0j1wvz1g5ki9c9h558pnpvsazr";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Optional compilation for OCaml";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "1d7rsdqiccxp2w4ykb9klarddm2qrrym3brbnhzx2hm78iyj3hzv";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Pattern matching on flat options";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_pattern_bind = janePackage {
+    pname = "ppx_pattern_bind";
+    hash = "0yxkwnn30nxgrspi191zma95bgrh134aqh2bnpj3wg0245ki55zv";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    version = "0.14.3";
+    minimumOCamlVersion = "4.04.2";
+    hash = "0dbri9d00ydi0dw1cavswnqdmhjaaz80vap29ns2lr6mhhlvyjmj";
+    meta.description = "[@@deriving] plugin to generate S-expression conversion functions";
+    propagatedBuildInputs = [ ppxlib sexplib0 base ];
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    version = "0.14.1";
+    hash = "1lvsr0d68kakih1ll33hy6dxbjkly6lmky4q6z0h0hrcbd6z48k4";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Stable types conversions generator";
+    propagatedBuildInputs = [ ppxlib ];
+  };
+
+  ppx_string = janePackage {
+    pname = "ppx_string";
+    version = "0.14.1";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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.1";
+    minimumOCamlVersion = "4.04.2";
+    hash = "0q6a43zrwqzdz7aja0k44a2llyjjj5xzi2kigwhsnww3g0r5ig84";
+    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 ];
+  };
+
+  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";
+    minimumOCamlVersion = "4.07";
+    meta.description = "S-expression pretty-printer";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+  };
+
+  sexp_select = janePackage {
+    pname = "sexp_select";
+    hash = "1lchhfqw4afw38fnarwylqc2qp7k6xwx3j7m9gy8ygjgd0vgd729";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    hash = "03c3j1ihx4pjbb0x3arrcif3wvp3iva2ivnywhiak4mbbslgsnzr";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.07";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    version = "0.13.0";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "4.04.2";
+    meta.description = "Typerep is a library for runtime types";
+    propagatedBuildInputs = [ base ];
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "0vy0hpiaawmydh08nqlwjx52pasp74383yi0pshwbdxin99n9mxd";
+    minimumOCamlVersion = "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";
+    minimumOCamlVersion = "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/async-rpc-kernel.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix
new file mode 100644
index 000000000000..15f391342bdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix
@@ -0,0 +1,18 @@
+{lib, buildOcamlJane, async_kernel, bin_prot, core_kernel,
+ fieldslib, ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test,
+ ppx_jane, sexplib, typerep, variantslib}:
+
+buildOcamlJane {
+  name = "async_rpc_kernel";
+  hash = "0pvys7giqix1nfidw1f4i3r94cf03ba1mvhadpm2zpdir3av91sw";
+  propagatedBuildInputs = [ async_kernel bin_prot core_kernel fieldslib
+    ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane
+    sexplib typerep variantslib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/async_rpc_kernel";
+    description = "Platform-independent core of Async RPC library";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/bin_prot.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/bin_prot.nix
new file mode 100644
index 000000000000..5f3c2ab83ff4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/bin_prot.nix
@@ -0,0 +1,17 @@
+{lib, buildOcamlJane, type_conv}:
+
+buildOcamlJane {
+  name = "bin_prot";
+  version = "113.33.03";
+  minimumSupportedOcamlVersion = "4.02";
+  hash = "0jlarpfby755j0kikz6vnl1l6q0ga09b9zrlw6i84r22zchnqdsh";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/bin_prot";
+    description = "Binary protocol generator ";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
new file mode 100644
index 000000000000..62876e5eaf94
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
@@ -0,0 +1,29 @@
+{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } :
+
+{ name, version ? "113.33.03", buildInputs ? [],
+  hash ? "",
+  minimumSupportedOcamlVersion ? "4.02", ...
+}@args:
+
+buildOcaml (args // {
+  inherit name version minimumSupportedOcamlVersion;
+  src = fetchurl {
+    url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz";
+    sha256 = hash;
+  };
+
+  hasSharedObjects = true;
+
+  buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs;
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  configurePhase = "./configure --prefix $out";
+
+  buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make";
+
+  installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install";
+
+})
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/core_bench.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/core_bench.nix
new file mode 100644
index 000000000000..52a9350eeeac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/core_bench.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildOcamlJane
+, core
+, core_extended
+, textutils
+}:
+
+buildOcamlJane {
+  name = "core_bench";
+  hash = "1d1ainpakgsf5rg8dvar12ksgilqcc4465jr8gf7fz5mmn0mlifj";
+  propagatedBuildInputs =
+    [ core core_extended textutils ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/core_bench";
+    description = "Micro-benchmarking library for OCaml";
+    license = licenses.asl20;
+    maintainers = [ maintainers.pmahoney ];
+  };
+}
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..679ef4a58e48
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/default.nix
@@ -0,0 +1,601 @@
+{ self
+, openssl
+}:
+
+with self;
+
+{
+
+  ocaml-compiler-libs = janePackage {
+    pname = "ocaml-compiler-libs";
+    hash = "03jds7bszh8wwpfwxb3dg0gyr1j1872wxwx1xqhry5ir0i84bg0s";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  sexplib0 = janePackage {
+    pname = "sexplib0";
+    meta.description = "Library containing the definition of S-expressions and some base converters";
+    hash = "07v3ggyss7xhfv14bjk1n87sr42iqwj4cgjiv2lcdfkqk49i2bmi";
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    hash = "1nyq23s5igd8cf3n4qxprjvhbmb6ighb3fy5mw7hxl0mdgsw5fvz";
+    propagatedBuildInputs = [ sexplib0 ];
+    meta.description = "S-expression parsing library";
+  };
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    meta.description = "Library for serializing OCaml values to and from S-expressions";
+    hash = "1qfl0m04rpcjvc4yw1hzh6r16jpwmap0sa9ax6zjji67dz4szpyb";
+    propagatedBuildInputs = [ num parsexp ];
+  };
+
+  base = janePackage {
+    version = "0.11.1";
+    pname = "base";
+    hash = "0j6xb4265jr41vw4fjzak6yr8s30qrnzapnc6rl1dxy8bjai0nir";
+    propagatedBuildInputs = [ sexplib0 ];
+    meta.description = "Full standard library replacement for OCaml";
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    hash = "1facajqhvq34g2wrg368y0ajxd6lrj5b3lyzyj0jhdmraxajjcwn";
+    propagatedBuildInputs = [ base ];
+    meta.description = "Standard IO library for OCaml";
+  };
+
+  configurator = janePackage {
+    pname = "configurator";
+    hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk";
+    propagatedBuildInputs = [ stdio ];
+    meta.description = "Helper library for gathering system configuration";
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    version = "0.11.1";
+    hash = "06bq4m1bsm4jlx4g7wh5m99qky7xm4c2g52kaz6pv25hdn5agi2m";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ base ppx_deriving ];
+    meta.description = "Generation of comparison functions from types";
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    version = "0.11.2";
+    hash = "0pqwnqy1xp309wvdcaax4lg02yk64lq2w03mbgfvf6ps5ry4gis9";
+    propagatedBuildInputs = [ sexplib0 ppxlib ppx_deriving ];
+    meta.description = "Generation of S-expression conversion functions from type definitions";
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "0hbsk34ghc28h8pzbma923ma2bgnz8lzrgcqqx9bzg161jl4s4r3";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ base ];
+    meta.description = "OCaml variants as first class values";
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    version = "0.11.1";
+    hash = "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ ppx_deriving variantslib ];
+    meta.description = "Generation of accessor and iteration functions for OCaml variant types";
+  };
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "1yvjvfax56lmn2lxbykcmhgmxypws1vp9lhnyb8bhbavsv8yc6da";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "OCaml record fields as first class values";
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    hash = "1bb9cmn4js7p3qh8skzyik1pcz6sj1k4xkhf12fg1bjmb5fd0jx1";
+    propagatedBuildInputs = [ fieldslib ];
+    meta.description = "Generation of accessor and iteration functions for OCaml records";
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    hash = "1dvjzvaxhx53jqwrrlxdckwl1azrhs9kvwb48mhgd0jnz65ny726";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    hash = "1mgbyzsr8h0y4s4j9dv7hsdrxyzhhjww5khwg2spi2my7ia95m0l";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ];
+    meta.description = "Binary protocol generator";
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "0kij4c7qxrja787f3sm3z6mzr322486h2djrlyhnl66vp8hrv8si";
+    meta.description = "Jane Street header files";
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "04njv8s4n54x9rg0012ymd6y6lrnqprnh0f0f6s0jcp79q7mv43i";
+    buildInputs = [ ppxlib ];
+    meta.description = "Expands [%here] into its location";
+  };
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "0qbdrl0rj0midnb6sdyaz00s0d4nb8zrrdf565lcdsi1rbnyrzan";
+    buildInputs = [ ppx_here ];
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+  };
+
+  ppx_hash = janePackage {
+    version = "0.11.1";
+    pname = "ppx_hash";
+    hash = "1p0ic6aijxlrdggpmycj12q3cy9xksbq2vq727215maz4snvlf5p";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    hash = "11n94fz1asjf5vqdgriv0pvsa5lbfpqcyk525c7816w23vskcvq6";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ base ];
+    meta.description = "Syntax extension for writing in-line tests in OCaml code";
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    hash = "0d94pf0mrmyp905ncgj4w6cc6zpm4nlib6nclslhgs89pxpzg6a0";
+    buildInputs = [ ppx_here ];
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "00j4by75fl9niqvlpiyw6ymlmlmgfzysm8w25cj5wsfsh4yrgr74";
+    propagatedBuildInputs = [ base ];
+    meta.description = "Runtime types for OCaml";
+  };
+
+  ppx_typerep_conv = janePackage {
+    version = "0.11.1";
+    pname = "ppx_typerep_conv";
+    hash = "0a13dpfrrg0rsm8qni1bh7pqcda30l70z8r6yzi5a64bmwk7g5ah";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ ppx_deriving typerep ];
+    meta.description = "Generation of runtime types from type declarations";
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    hash = "1cwqyrkykc8wi60grbid1w072fcvf7k0hd387jz7mxfw44qyb85g";
+    propagatedBuildInputs = [ ppxlib octavius ];
+    meta.description = "Code style checker for Jane Street Packages";
+  };
+
+  ppx_enumerate = janePackage {
+    version = "0.11.1";
+    pname = "ppx_enumerate";
+    hash = "0spx9k1v7vjjb6sigbfs69yndgq76v114jhxvzjmffw7q989cyhr";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ ppx_deriving ];
+    meta.description = "Generate a list containing all values of a finite type";
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "079caqjbxk1d33hy69017n3dwslqy52alvzjddwpdjb04vjadlk6";
+    propagatedBuildInputs = [ ppx_compare ppx_enumerate ppx_hash ppx_js_style ];
+    meta.description = "Base set of ppx rewriters";
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    hash = "0z98r6y4lpj6dy265m771ylx126hq3v1zjsk74yqvpwwd63gx3jz";
+    buildInputs = [ ppxlib ppx_inline_test ];
+    meta.description = "Syntax extension for writing in-line benchmarks in OCaml code";
+  };
+
+  ppx_bin_prot = janePackage {
+    version = "0.11.1";
+    pname = "ppx_bin_prot";
+    hash = "1h60i75bzvhna1axyn662gyrzhh441l79vl142d235i5x31dmnkz";
+    buildInputs = [ ppxlib ppx_here ];
+    propagatedBuildInputs = [ bin_prot ];
+    meta.description = "Generation of bin_prot readers and writers from types";
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    hash = "1g0r67vfw9jr75pybiw4ysfiswlzyfpbj0gl91rx62gqdhjh1pga";
+    buildInputs = [ ppx_assert ppx_custom_printf ppx_fields_conv ppx_here ppx_variants_conv re ];
+    propagatedBuildInputs = [ fieldslib ppx_compare ppx_inline_test ppx_sexp_conv ];
+    meta.description = "Cram like framework for OCaml";
+  };
+
+  ppx_fail = janePackage {
+    pname = "ppx_fail";
+    hash = "0d0xadcl7mhp81kspcd2b0nh75h34w5a6s6j9qskjjbjif87wiix";
+    buildInputs = [ ppxlib ppx_here ];
+    meta.description = "Add location to calls to failwiths";
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "1ckzwljlb78cdf6xxd24nddnmsihvjrnq75r1b255aj3xgkzsygx";
+    propagatedBuildInputs = [ base ppxlib ];
+    meta.description = "Monadic let-bindings";
+  };
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    hash = "1rahkjq6vpffs7wdz1crgbxkdnlfkj1i3j12c2andy4fhj49glcm";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ ppx_deriving ];
+    meta.description = "Optional compilation for OCaml";
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "0aw3hvrsdjpw4ik7rf15ghak31vhdr1lgpphr18mj76rnlrhirmx";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Pattern matching on flat options";
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "0smgq587amlr3hivbbg153p83dj37w30cssp9cffc0v8kg84lfhr";
+    buildInputs = [ ppxlib ];
+    meta.description = "A ppx rewriter that inlines reverse application operators |> and |!";
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "107zwb580nrmc0l03dl3y3hf12s3c1vv8b8mz6sa4k5afp3s9nkl";
+    buildInputs = [ ppx_here ];
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+    meta.description = "A ppx rewriter that simplifies building s-expressions from OCaml values";
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "0l1p6llaa60mrc5p9400cqv9yy6h76x5wfq3z1cx5xawy0yz4vlb";
+    buildInputs = [ ppxlib ];
+    propagatedBuildInputs = [ ppx_assert ppx_base ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_here ppx_let ppx_optcomp ppx_optional ppx_pipebang ppx_sexp_message ppx_sexp_value ppx_typerep_conv ];
+    meta.description = "Standard Jane Street ppx rewriters";
+  };
+
+  splittable_random = janePackage {
+    pname = "splittable_random";
+    hash = "1yrvpm6g62f8k6ihccxhfxpvmxbqxhi7p790a8jkdmyfdd1l6z73";
+    propagatedBuildInputs = [ ppx_jane ];
+    meta.description = "PRNG that can be split into independent streams";
+  };
+
+  core_kernel = janePackage {
+    version = "0.11.1";
+    pname = "core_kernel";
+    hash = "1dg7ygy7i64c5gaakb1cp1b26p9ks81vbxmb8fd7jff2q60j2z2g";
+    propagatedBuildInputs = [ configurator jane-street-headers sexplib splittable_random ];
+    meta.description = "Jane Street's standard library overlay (kernel)";
+  };
+
+  spawn = janePackage {
+    version = "0.12.0";
+    pname = "spawn";
+    hash = "0amgj7g9sjlbjivn1mg7yjdmxd21hgp4a0ak2zrm95dmm4gi846i";
+    meta.description = "Spawning sub-processes";
+  };
+
+  core = janePackage {
+    version = "0.11.2";
+    pname = "core";
+    hash = "0vpsvd75lxb09il2rnzyib9mlr51v1hzqdc9fdxgx353pb5agh8a";
+    propagatedBuildInputs = [ core_kernel spawn ];
+    meta.description = "Jane Street's standard library overlay";
+  };
+
+  textutils_kernel = janePackage {
+    pname = "textutils_kernel";
+    hash = "0s1ps7h54vgl76pll3y5qa1bw8f4h8wxc8mg8jq6bz8vxvl0dfv4";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "The subset of textutils using only core_kernel and working in javascript";
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "1jmhpaihnndf4pr8xsk7ws70n4mvv34ry0ggqqpfs3wb2vkcdg6j";
+    propagatedBuildInputs = [ core textutils_kernel ];
+    meta.description = "Text output utilities";
+  };
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "0bl65d0nmvr7k1mkkcc4aai86l5qzgn1xxwmszshpwhaz87cqghd";
+    propagatedBuildInputs = [ core_kernel ];
+    prePatch = ''
+      substituteInPlace src/re2_c/jbuild --replace 'CXX=g++' 'CXX=c++'
+      substituteInPlace src/jbuild --replace '(cxx_flags ((:standard \ -pedantic) (-I re2_c/libre2)))' '(cxx_flags ((:standard \ -pedantic) (-I re2_c/libre2) (-x c++)))'
+    '';
+    meta.description = "OCaml bindings for RE2";
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "1fvnr6zkpbl48dl7nn3j1dpsrr6bi00iqh282wg5lgdhcsjbc0dy";
+    propagatedBuildInputs = [ core re re2 textutils ];
+    postPatch = ''
+      patchShebangs src/discover.sh
+    '';
+    meta.description = "Jane Street Capital's standard library overlay";
+  };
+
+  async_kernel = janePackage {
+    version = "0.11.1";
+    pname = "async_kernel";
+    hash = "1ssv0gqbdns6by1wdjrrs35cj1c1n1qcfkxs8hj04b7x89wzvf1q";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Jane Street Capital's asynchronous execution library (core)";
+  };
+
+  protocol_version_header = janePackage {
+    pname = "protocol_version_header";
+    hash = "159qmkb0dsfmr1lv2ly50aqszpm24bvrm3sw07n2zhkxgy6q613z";
+    propagatedBuildInputs = [ core_kernel ocaml-migrate-parsetree ];
+    meta.description = "Protocol aware version negotiation";
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "0wl7kp30qxkalk91q5pja9agsvvmdjvb2q7s3m79dlvwwi11l33y";
+    propagatedBuildInputs = [ core_kernel async_kernel protocol_version_header ];
+    meta.description = "Platform-independent core of Async RPC library";
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "1y5za5fdh0x82zdjigxci9zm9jnpfd2lfgpjcq4rih3s28f16sf7";
+    propagatedBuildInputs = [ core async_kernel ];
+    meta.description = "Jane Street Capital's asynchronous execution library (unix)";
+  };
+
+  async_extra = janePackage {
+    version = "0.11.1";
+    pname = "async_extra";
+    hash = "0dmplvqf41820rm5i0l9bx1xmmdlq8zsszi36y2rkjna8991f7s2";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix ];
+    meta.description = "Jane Street's asynchronous execution library (extra)";
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "1i05hzk4mhzj1mw98b2bdbxhnq03jvhkkkw4d948i6265jzrrbv5";
+    propagatedBuildInputs = [ async_extra ];
+    meta.description = "Jane Street Capital's asynchronous execution library";
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "0s0qafx74ri1vr2vv3iy1j7s3p6gp7vyg0mw5g17iafk0w6lv2iq";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Directory traversal with Async";
+  };
+
+  async_interactive = janePackage {
+    pname = "async_interactive";
+    hash = "01rlfcylpiak6a2n6q3chp73cvkhvb65n906dj0flmxmagn7dxd1";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Utilities for building simple command-line based user interfaces";
+  };
+
+  async_parallel = janePackage {
+    pname = "async_parallel";
+    hash = "0hak8ba3rfzqhz5hz2annqmsv5bkqzdihhafp0f58ryrlskafwag";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Distributed computing library";
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "1jb01ygfnhabsy72xlcg11vp7rr37sg555sm0k3yxl4r5az3y2ay";
+    propagatedBuildInputs = [ core_extended async ];
+    meta.description = "Shell helpers for Async";
+  };
+
+  async_ssl = janePackage {
+    pname = "async_ssl";
+    hash = "1p83fzfla4rb820irdrz3f2hp8kq5zrhw47rqmfv6qydlca1bq64";
+    propagatedBuildInputs = [ async ctypes openssl ];
+    meta = {
+      description = "Async wrappers for SSL";
+      # ctypes no longer works with dune 1
+      # dune 2 no longer supports jbuild
+      broken = true;
+    };
+  };
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    hash = "0xskahjggbwvvb82fn0jp1didxbgpmgks76xhwp9s3vqkhgz6918";
+    propagatedBuildInputs = [ ppx_base re sexplib ];
+    meta.description = "S-expression pretty-printer";
+  };
+
+  expect_test_helpers_kernel = janePackage {
+    pname = "expect_test_helpers_kernel";
+    hash = "0m113vq4m1xm3wmwa08r6qjc7p5f0y3ss8s4i2z591ycgs2fxzlj";
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+    meta.description = "Helpers for writing expectation tests";
+  };
+
+  expect_test_helpers = janePackage {
+    pname = "expect_test_helpers";
+    hash = "13n6h7mimwkbsjdix96ghfrmxjd036m4h4zgl8qag00aacqclvpi";
+    propagatedBuildInputs = [ async expect_test_helpers_kernel ];
+    meta.description = "Async helpers for writing expectation tests";
+  };
+
+  cinaps = janePackage {
+    pname = "cinaps";
+    hash = "0f8cx4xkkk4wqpcbvva8kxdndbgawljp17dwppc6zpjpkjl8s84j";
+    propagatedBuildInputs = [ re ];
+    meta.description = "Trivial Metaprogramming tool using the OCaml toplevel";
+  };
+
+  command_rpc = janePackage {
+    pname = "command_rpc";
+    hash = "111v4km0ds8ixmpmwg9ck36ap97400mqzhijf57kj6wfwgzcmr2g";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Utilities for Versioned RPC communication with a child process over stdin and stdout";
+  };
+
+  # Deprecated libraries
+
+  ppx_ast = janePackage {
+    pname = "ppx_ast";
+    hash = "125bzswcwr3nb26ss8ydh8z4218c8fi3s2kvgqp1j1fhc5wwzqgj";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_core = janePackage {
+    pname = "ppx_core";
+    hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_driver = janePackage {
+    pname = "ppx_driver";
+    hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_metaquot = janePackage {
+    pname = "ppx_metaquot";
+    hash = "1vz8bi56jsz8w0894vgbfsfvmdyh5k1dgv45l8vhkks0s7d3ldji";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_traverse = janePackage {
+    pname = "ppx_traverse";
+    hash = "1p2n5da4mxh9fk4gvxlibc706bs5xwkbppxd1x0ip1vln5pabbq5";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_traverse_builtins = janePackage {
+    pname = "ppx_traverse_builtins";
+    hash = "0qlf7i8h8k3a9h8nhb0ki3y1knr6wgbm24f1qaqni53fpvzv0pfb";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  ppx_type_conv = janePackage {
+    pname = "ppx_type_conv";
+    hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf";
+    propagatedBuildInputs = [ ppxlib ];
+    meta.description = "Deprecated (see ppxlib)";
+  };
+
+  # Miscellaneous Jane Street packages
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "10i28ssfdqxxhq0rvnlp581lr1cq2apkhmm8j83fksjkmbxcrasc";
+    propagatedBuildInputs = [ core_extended ];
+    meta.description = "Micro-benchmarking library for OCaml";
+  };
+
+  csvfields = janePackage {
+    pname = "csvfields";
+    hash = "10zw4fjlniivfdzzz79lnbvcjnhk5y16m1p8mn4xbs23n6mbix0f";
+    propagatedBuildInputs = [ core expect_test_helpers ];
+    meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv";
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "1is5156q59s427x3q5nh9wsi8h1x77670bmyilqxasy39yway7g8";
+    propagatedBuildInputs = [ async expect_test_helpers_kernel ];
+    meta.description = "Writing Emacs plugin in OCaml";
+  };
+
+  incremental_kernel = janePackage {
+    version = "0.11.1";
+    pname = "incremental_kernel";
+    hash = "1qp9dqncx2h0np0rndqaic4dna8f1dlkqnbjfcdhcim5dp2vg4x6";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Library for incremental computations depending only on core_kernel";
+  };
+
+  incremental = janePackage {
+    pname = "incremental";
+    hash = "1xchd3v4kj56wixjrsnj7m7l0374cgkzybihs2b62mn65xf6n7ki";
+    propagatedBuildInputs = [ core incremental_kernel ];
+    meta.description = "Library for incremental computations";
+  };
+
+  incr_map = janePackage {
+    pname = "incr_map";
+    hash = "01vx9aldxpigz5ah9h337xcw73a7r8449v8l2xbralljhs0zglx9";
+    propagatedBuildInputs = [ incremental_kernel ];
+    meta.description = "Helpers for incremental operations on map like data structures";
+  };
+
+  parsexp_io = janePackage {
+    pname = "parsexp_io";
+    hash = "0rhdl40jiirvv6fhgjk50n8wzs3jly5d8dyyyfgpjgl39mwkjjnb";
+    propagatedBuildInputs = [ parsexp ppx_js_style ];
+    meta.description = "S-expression parsing library (IO functions)";
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "0q7a64fgg97qcd6d8c45gyz63x5vq004axxqvvfg92b8f3x2plx4";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Tool and library implementing patience diff";
+  };
+
+  posixat = janePackage {
+    pname = "posixat";
+    hash = "04rs4sl0r4rg9m6l9kkqkmc4n87sv4a4w9ibq4zsjk9j4n6r2df8";
+    propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv sexplib ];
+    meta.description = "Binding to the posix *at functions";
+  };
+
+  rpc_parallel = janePackage {
+    pname = "rpc_parallel";
+    hash = "13dx59x73i8mkwv2qkh8gx6kk8arlvghj57k1jdscdmzmyqc9gvn";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Type-safe library for building parallel applications";
+  };
+
+  shexp = janePackage {
+    version = "0.11.1";
+    pname = "shexp";
+    hash = "06yssp7bsmabaxvw9bqxyrsji1gkvl7if5adba3v6h4kilqy7rqg";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  topological_sort = janePackage {
+    pname = "topological_sort";
+    hash = "1qnz5b1rs45lsl1ycxd1lglpmh8444gy5khhdp5fvxy987zkzklz";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Topological sort algorithm";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/fieldslib.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/fieldslib.nix
new file mode 100644
index 000000000000..6ed34f2a28c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/fieldslib.nix
@@ -0,0 +1,19 @@
+{ lib, type_conv, buildOcamlJane }:
+
+buildOcamlJane {
+  name = "fieldslib";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.02";
+
+  hash = "0mkbix32f8sq32q81hb10z2q31bw5f431jxv0jafbdrif0vr6xqd";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "OCaml 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";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage.nix
new file mode 100644
index 000000000000..9a67db4966ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage.nix
@@ -0,0 +1,21 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.11.0" }:
+
+{ pname, version ? defaultVersion, hash, ...}@args:
+
+buildDunePackage (args // {
+  inherit version;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = hash;
+  };
+
+  meta = {
+    license = lib.licenses.asl20;
+    homepage = "https://github.com/janestreet/${pname}";
+  } // args.meta;
+})
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..6c7d746e9481
--- /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, hash, ...}@args:
+
+buildDunePackage (args // {
+  inherit version;
+
+  minimumOCamlVersion = "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..1ed2e6bc4f20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.14.0" }:
+
+{ pname
+, version ? defaultVersion
+, hash
+, minimumOCamlVersion ? "4.08"
+, doCheck ? true
+, ...}@args:
+
+buildDunePackage (args // {
+  useDune2 = true;
+  inherit version;
+
+  inherit minimumOCamlVersion;
+
+  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/js-build-tools-darwin.patch b/nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch
new file mode 100644
index 000000000000..8878b4be68b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch
@@ -0,0 +1,11 @@
+--- a/ocamlbuild_goodies/jane_street_ocamlbuild_goodies.ml
++++ b/ocamlbuild_goodies/jane_street_ocamlbuild_goodies.ml
+@@ -65,7 +65,7 @@ let track_external_deps = function
+
+     let stat, md5sum =
+       match run_and_read "uname" |> String.trim with
+-      | "Darwin" ->
++      | "FreeBSD" | "NetBSD" ->
+         (S [A "stat"; A "-f"; A "%d:%i:%m"],
+          A "md5")
+       | _ ->
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
new file mode 100644
index 000000000000..2f68ee8230e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
@@ -0,0 +1,31 @@
+{ lib, buildOcaml, fetchurl, ocaml_oasis, opaline }:
+
+buildOcaml rec {
+  name = "js-build-tools";
+  version = "113.33.06";
+
+  minimumSupportedOcamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz";
+    sha256 = "1nvgyp4gsnlnpix3li6kr90b12iin5ihichv298p03i6h2809dia";
+  };
+
+  hasSharedObjects = true;
+
+  buildInputs = [ ocaml_oasis opaline ];
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+  configurePhase = "./configure --prefix $prefix";
+  installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install";
+
+  patches = [ ./js-build-tools-darwin.patch ];
+
+  meta = with lib; {
+    description = "Jane Street Build Tools";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/old.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/old.nix
new file mode 100644
index 000000000000..8b4a6ed52962
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/old.nix
@@ -0,0 +1,639 @@
+{ self
+, super
+, lib
+, stdenv
+, openssl
+}:
+
+let
+  inherit (super)
+    janePackage
+    ocaml
+    ocamlbuild
+    cryptokit
+    ctypes
+    magic-mime
+    ocaml-migrate-parsetree
+    octavius
+    ounit
+    ppx_deriving
+    re
+    zarith
+    num
+    ;
+
+in
+
+with self;
+
+{
+
+  # Jane Street packages, up to ppx_core
+
+  sexplib = janePackage {
+    pname = "sexplib";
+    meta.description = "Automated S-expression conversion";
+    version = "0.10.0";
+    hash = "1agw649n0rnf6h4y2dr1zs1970nncxgjmf90848vbxv8y9im4yy2";
+    buildInputs = [ num ];
+  };
+
+  base = janePackage {
+    pname = "base";
+    version = "0.9.4";
+    hash = "0x85xi66b4zwlbdwmyc99zcmawgpp75gxqbl55rr67awavw162rw";
+    propagatedBuildInputs = [ sexplib ];
+    meta.description = "Full standard library replacement for OCaml";
+  };
+
+  ocaml-compiler-libs = janePackage {
+    pname = "ocaml-compiler-libs";
+    hash = "1jz3nfrb6295sj4xj1j0zld8mhfj0xy2k4vlp9yf9sh3748n090l";
+    meta.description = "OCaml compiler libraries repackaged";
+  };
+
+  ppx_ast = janePackage ({
+    pname = "ppx_ast";
+    propagatedBuildInputs = [ ocaml-compiler-libs ocaml-migrate-parsetree ];
+    meta.description = "OCaml AST used by Jane Street ppx rewriters";
+  } // (if lib.versionAtLeast ocaml.version "4.06"
+    then {
+      version = "0.9.2";
+      hash = "1h4qf26rg23z21rrw83fakiavw9km7174p3830pg0gg4bwakvba0";
+    } else {
+      version = "0.9.1";
+      hash = "0a9rxwavy2748k0yd4db3hg1ypq7mpqnwq9si5a5qdiclgkhcggw";
+    }
+  ));
+
+  ppx_traverse_builtins = janePackage {
+    pname = "ppx_traverse_builtins";
+    hash = "10ajvz02ka6qimlfrq7py4ljhk8awqkga6240kn8j046b4xfyxzi";
+    meta.description = "Builtins for Ppx_traverse";
+  };
+
+  stdio = janePackage {
+    pname = "stdio";
+    version = "0.9.1";
+    hash = "13rj3ii0rvmklfim9ild0ib44ssdadig7a9ccjbz22m0pw84a1sx";
+    propagatedBuildInputs = [ base ];
+    meta.description = "Standard IO library for OCaml";
+  };
+
+  ppx_core = janePackage {
+    pname = "ppx_core";
+    hash = "15400zxxkqdimmjpdjcs36gcbxbrhylmaczlzwd6x65v1h9aydz3";
+    propagatedBuildInputs = [ ppx_ast ppx_traverse_builtins stdio ];
+    meta.description = "Jane Street's standard library for ppx rewriters";
+  };
+
+  # Jane Street packages, up to ppx_base
+
+  ppx_optcomp = janePackage {
+    pname = "ppx_optcomp";
+    hash = "1wfj6fnh92s81yncq7yyhmax7j6zpjj1sg1f3qa1f9c5kf4kkzrd";
+    propagatedBuildInputs = [ ppx_core ];
+    meta.description = "Optional compilation for OCaml";
+  };
+
+  ppx_driver = janePackage {
+    pname = "ppx_driver";
+    version = "0.9.1";
+    hash = "1amz49x6v4sh1v2my6618cah0zv5i7jmsapbk9ydps6419g5asay";
+    buildInputs = [ ocamlbuild ];
+    propagatedBuildInputs = [ ppx_optcomp ];
+    meta.description = "Feature-full driver for OCaml AST transformers";
+  };
+
+  ppx_metaquot = janePackage {
+    pname = "ppx_metaquot";
+    hash = "15qfd3s4x2pz006nx5316laxd3gqqi472x432qg4rfx4yh3vn31k";
+    propagatedBuildInputs = [ ppx_driver ];
+    meta.description = "Metaquotations for ppx_ast";
+  };
+
+  ppx_type_conv = janePackage {
+    pname = "ppx_type_conv";
+    hash = "0a0gxjvjiql9vg37k0akn8xr5724nv3xb7v37xpidv7ld927ks7p";
+    propagatedBuildInputs = [ ppx_metaquot ppx_deriving ];
+    meta.description = "Support Library for type-driven code generators";
+  };
+
+  ppx_sexp_conv = janePackage {
+    pname = "ppx_sexp_conv";
+    hash = "03cg2sym0wvpd5l7q4w9bclp589z5byygwsmnnq9h1ih56cmd55l";
+    propagatedBuildInputs = [ ppx_type_conv sexplib ];
+    meta.description = "Generation of S-expression conversion functions from type definitions";
+  };
+
+  ppx_compare = janePackage {
+    pname = "ppx_compare";
+    hash = "0wrszpvn1nms5sb5rb29p7z1wmqyd15gfzdj4ax8f843p5ywx3w9";
+    propagatedBuildInputs = [ ppx_type_conv ];
+    meta.description = "Generation of comparison functions from types";
+  };
+
+  ppx_enumerate = janePackage {
+    pname = "ppx_enumerate";
+    hash = "1dfy86j2z12p5n9yrwaakx1ngphs5246vxy279kz6i6j34cwxm46";
+    propagatedBuildInputs = [ ppx_type_conv ];
+    meta.description = "Generate a list containing all values of a finite type";
+  };
+
+  ppx_hash = janePackage {
+    pname = "ppx_hash";
+    hash = "1w1riy2sqd9i611sc5f5z2rqqgjl2gvvkzi5xibpv309nacnl01d";
+    propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ];
+    meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions";
+  };
+
+  ppx_js_style = janePackage {
+    pname = "ppx_js_style";
+    hash = "09k02b1l2r7svf9l3ls69h8xydsyiang2ziigxnny2i7gy7b0w59";
+    propagatedBuildInputs = [ ppx_metaquot octavius ];
+    meta.description = "Code style checker for Jane Street Packages";
+  };
+
+  ppx_base = janePackage {
+    pname = "ppx_base";
+    hash = "0qikfzbkd2wyxfrvizz6rgi6vg4ykvxkivacj4gr178dbgfl5if3";
+    propagatedBuildInputs = [ ppx_enumerate ppx_hash ppx_js_style ];
+    meta.description = "Base set of ppx rewriters";
+  };
+
+  # Jane Street packages, up to ppx_bin_prot
+
+  fieldslib = janePackage {
+    pname = "fieldslib";
+    hash = "1wxh59888l1bfz9ipnbcas58gwg744icaixzdbsg4v8f7wymc501";
+    propagatedBuildInputs = [ ppx_driver ];
+    meta.description = "OCaml record fields as first class values";
+  };
+
+  variantslib = janePackage {
+    pname = "variantslib";
+    hash = "0kj53n62193j58q9vip8lfhhyf6w9d25wyvxzc163hx5m68yw0fz";
+    propagatedBuildInputs = [ ppx_driver ];
+    meta.description = "OCaml variants as first class values";
+  };
+
+  ppx_traverse = janePackage {
+    pname = "ppx_traverse";
+    hash = "1sdqgwyq0w71i03vhc5jq4jk6rsbgwhvain48fnrllpkb5kj2la2";
+    propagatedBuildInputs = [ ppx_type_conv ];
+    meta.description = "Automatic generation of open recursion classes";
+  };
+
+  ppx_custom_printf = janePackage {
+    pname = "ppx_custom_printf";
+    hash = "0cjy2c2c5g3qxqvwx1yb6p7kbmmpnpb1hll55f7a44x215lg8x19";
+    propagatedBuildInputs = [ ppx_sexp_conv ppx_traverse ];
+    meta.description = "Printf-style format-strings for user-defined string conversion";
+  };
+
+  ppx_fields_conv = janePackage {
+    pname = "ppx_fields_conv";
+    hash = "0qp8zgmk58iskzrkf4g06i471kg6lrh3wqpy9klrb8pp9mg0xr9z";
+    propagatedBuildInputs = [ fieldslib ppx_type_conv ];
+    meta.description = "Generation of accessor and iteration functions for OCaml records";
+  };
+
+  ppx_variants_conv = janePackage {
+    pname = "ppx_variants_conv";
+    hash = "1xayhyglgbdjqvb9123kjbwjcv0a3n3302nb0j7g8gmja8w5y834";
+    propagatedBuildInputs = [ ppx_type_conv variantslib ];
+    meta.description = "Generation of accessor and iteration functions for OCaml variant types";
+  };
+
+  bin_prot = janePackage {
+    pname = "bin_prot";
+    version = "0.9.1";
+    hash = "1bgcmkgz6b5i522996x589zsaiy5b3h37887lwbqvpps8by2ayvk";
+    propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ];
+    meta.description = "Binary protocol generator";
+  };
+
+  ppx_here = janePackage {
+    pname = "ppx_here";
+    hash = "0pjscw5ydxgy4fcxakgsazpp09ka057w5n2fp2dpkv2k5gil6rzh";
+    propagatedBuildInputs = [ ppx_driver ];
+    meta.description = "Expands [%here] into its location";
+  };
+
+  ppx_bin_prot = janePackage {
+    pname = "ppx_bin_prot";
+    hash = "0qw9zqrc5yngzrzpk9awnlnd68xrb7wz5lq807c80ibxk0xvnqn3";
+    propagatedBuildInputs = [ ppx_here bin_prot ];
+    meta.description = "Generation of bin_prot readers and writers from types";
+  };
+
+  # Jane Street packages, up to ppx_jane
+
+  ppx_assert = janePackage {
+    pname = "ppx_assert";
+    hash = "1s5c75wkc46nlcwmgic5h7f439s26ssrzrcil501c5kpib2hlv6z";
+    propagatedBuildInputs = [ ppx_sexp_conv ppx_here ppx_compare ];
+    meta.description = "Assert-like extension nodes that raise useful errors on failure";
+  };
+
+  ppx_inline_test = janePackage {
+    pname = "ppx_inline_test";
+    version = "0.9.2";
+    hash = "17j36ihiqprbpa2bk02449k93vaidid2sly5djrk848ccjq8n5aa";
+    propagatedBuildInputs = [ ppx_metaquot ];
+    meta.description = "Syntax extension for writing in-line tests in OCaml code";
+  };
+
+  typerep = janePackage {
+    pname = "typerep";
+    hash = "0hlc0xiznli1k6azv2mhm1s4xghhxqqd957np7828bfp7r8n2jy3";
+    propagatedBuildInputs = [ base ];
+    meta.description = "Runtime types for OCaml";
+  };
+
+  ppx_bench = janePackage {
+    pname = "ppx_bench";
+    hash = "1qk4y6c2mpw7bqjppi2nam74vs2sc89wzq162j92wsqxyqsv4p93";
+    propagatedBuildInputs = [ ppx_inline_test ];
+    meta.description = "Syntax extension for writing in-line benchmarks in OCaml code";
+  };
+
+  ppx_expect = janePackage {
+    pname = "ppx_expect";
+    hash = "1bik53k51wcqv088f0h10n3ms9h51yvg6ha3g1s903i2bxr3xs6b";
+    propagatedBuildInputs = [ ppx_inline_test ppx_fields_conv ppx_custom_printf ppx_assert ppx_variants_conv re ];
+    meta.description = "Cram like framework for OCaml";
+  };
+
+  ppx_fail = janePackage {
+    pname = "ppx_fail";
+    hash = "0qz0vlazasjyg7cv3iwpzxlvsah3zmn9dzd029xxqr1bji067s32";
+    propagatedBuildInputs = [ ppx_here ppx_metaquot ];
+    meta.description = "Add location to calls to failwiths";
+  };
+
+  ppx_let = janePackage {
+    pname = "ppx_let";
+    hash = "1b914a5nynwxjvfx42v61yigvjhnd548m4yqjfchf38dmqi1f4nr";
+    propagatedBuildInputs = [ ppx_driver ];
+    meta.description = "Monadic let-bindings";
+  };
+
+  ppx_optional = janePackage {
+    pname = "ppx_optional";
+    hash = "1vknsarxba0zcp5k2jb31wfpvqrv3bpanxbahfl5s2fwspsfdc82";
+    propagatedBuildInputs = [ ppx_metaquot ];
+    meta.description = "Pattern matching on flat options";
+  };
+
+  ppx_pipebang = janePackage {
+    pname = "ppx_pipebang";
+    hash = "1wyfyyjvyi94ds1p90l60wdr85q2v3fq1qdf3gnv9zjfy6sb0g9h";
+    propagatedBuildInputs = [ ppx_metaquot ];
+    meta.description = "A ppx rewriter that inlines reverse application operators |> and |!";
+  };
+
+  ppx_sexp_message = janePackage {
+    pname = "ppx_sexp_message";
+    hash = "0r0skyr1zf2jh48xrxbs45gzywynhlivkq24xwc0qq435fmc2jqv";
+    propagatedBuildInputs = [ ppx_sexp_conv ppx_here ];
+    meta.description = "A ppx rewriter for easy construction of s-expressions";
+  };
+
+  ppx_sexp_value = janePackage {
+    pname = "ppx_sexp_value";
+    hash = "0hha5mmx700m8fy9g4znb8278l09chgwlpshny83vsmmzgq2jhah";
+    propagatedBuildInputs = [ ppx_sexp_conv ppx_here ];
+    meta.description = "A ppx rewriter that simplifies building s-expressions from OCaml values";
+  };
+
+  ppx_typerep_conv = janePackage {
+    pname = "ppx_typerep_conv";
+    hash = "0bzgfpbqijwxm8x9jq1zb4xi5sbzymk17lw5rylri3hf84p60aq1";
+    propagatedBuildInputs = [ ppx_type_conv typerep ];
+    meta.description = "Generation of runtime types from type declarations";
+  };
+
+  ppx_jane = janePackage {
+    pname = "ppx_jane";
+    hash = "16m5iw0qyp452nqj83kd0g0x3rw40lrz7392hwpd4di1wi6v2qzc";
+    propagatedBuildInputs = [ ppx_base ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_let ppx_optional ppx_pipebang ppx_sexp_message ppx_sexp_value ppx_typerep_conv ];
+    meta.description = "Standard Jane Street ppx rewriters";
+  };
+
+  # Jane Street packages, up to core
+
+  configurator = janePackage {
+    pname = "configurator";
+    version = "0.9.1";
+    hash = "1q0s0ghcrcrxdj6zr9zr27g7sr4qr9l14kizjphwqwwvgbzawdix";
+    propagatedBuildInputs = [ ppx_base ];
+    meta.description = "Helper library for gathering system configuration";
+  };
+
+  jane-street-headers = janePackage {
+    pname = "jane-street-headers";
+    hash = "0cdab6sblsidjbwvyvmspykyhqh44rpsjzi2djbfd5m4vh2h14gy";
+    meta.description = "Jane Street header files";
+  };
+
+  core_kernel = janePackage {
+    pname = "core_kernel";
+    hash = "05iwvggx9m81x7ijgv9gcv5znf5rmsmb76dg909bm9gkr3hbh7wh";
+    propagatedBuildInputs = [ configurator jane-street-headers ppx_jane ];
+    meta.description = "Jane Street's standard library overlay (kernel)";
+  };
+
+  spawn = janePackage {
+    pname = "spawn";
+    hash = "1w53b8ni06ajj62yaqjy0pkbm952l0m5fzr088yk15078qaxsnb5";
+    meta.description = "Spawning sub-processes";
+  };
+
+  core = janePackage {
+    pname = "core";
+    version = "0.9.1";
+    hash = "1643r0namsgj8xwfr9niimcdwyyq4ddiwd02d73ipb4a8710aqi8";
+    propagatedBuildInputs = [ core_kernel spawn ];
+    meta.description = "Jane Street's standard library overlay";
+  };
+
+  # Jane Street packages, up to core_extended
+
+  re2 = janePackage {
+    pname = "re2";
+    hash = "1qmhl3yd6y0lq401rz72b1bsbpglb0wighpxn3x8y1ixq415p4xi";
+    propagatedBuildInputs = [ core_kernel ];
+    meta = {
+      description = "OCaml bindings for RE2";
+      broken = stdenv.isDarwin;
+    };
+  };
+
+  textutils = janePackage {
+    pname = "textutils";
+    hash = "1y6j2qw7rc8d80343lfv1dygnfrhn2qllz57mx28pl5kan743f6d";
+    propagatedBuildInputs = [ core ];
+    meta.description = "Text output utilities";
+  };
+
+  core_extended = janePackage {
+    pname = "core_extended";
+    hash = "05cnzzj0kigz9c9gsmd6mfar82wmkbqm9qzrydb80sy2fz5b30rk";
+    propagatedBuildInputs = [ core re2 textutils ];
+    postPatch = ''
+      patchShebangs src/discover.sh
+    '';
+    meta = {
+      description = "Jane Street Capital's standard library overlay";
+    };
+  };
+
+  # Jane Street async packages
+
+  async_kernel = janePackage {
+    pname = "async_kernel";
+    hash = "1zwxhzy7f9900rcjls2fql9cpfmwrcah3fazzdz4h2i51f41w62x";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Jane Street Capital's asynchronous execution library (core)";
+  };
+
+  async_rpc_kernel = janePackage {
+    pname = "async_rpc_kernel";
+    hash = "1xk3s6s3xkj182p10kig2cqy8md6znif3v661h9cd02n8s57c40b";
+    propagatedBuildInputs = [ core_kernel async_kernel ];
+    meta.description = "Platform-independent core of Async RPC library";
+  };
+
+  async_unix = janePackage {
+    pname = "async_unix";
+    hash = "0yd4z28j5vdj2zxqi0fkgh2ic1s9h740is2dk0raga0zr5a1z03d";
+    propagatedBuildInputs = [ core async_kernel ];
+    meta.description = "Jane Street Capital's asynchronous execution library (unix)";
+  };
+
+  async_extra = janePackage {
+    pname = "async_extra";
+    hash = "0rpy5lc5dh5mir7flq1jrppd8imby8wyw191yg4nmklg28xp5sx0";
+    propagatedBuildInputs = [ async_rpc_kernel async_unix ];
+    meta.description = "Jane Street's asynchronous execution library (extra)";
+  };
+
+  async = janePackage {
+    pname = "async";
+    hash = "10ykzym19srgdiikj0s74dndx5nk15hjq1r2hc61iz48f6caxkb1";
+    propagatedBuildInputs = [ async_extra ];
+    meta.description = "Jane Street Capital's asynchronous execution library";
+  };
+
+  async_find = janePackage {
+    pname = "async_find";
+    hash = "11dmhdzgf5kn4m0cm6zr28wpwhi2kr4lak9nmgxbrxsq28bcncxq";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Directory traversal with Async";
+  };
+
+  async_interactive = janePackage {
+    pname = "async_interactive";
+    hash = "1mmqqp6bi2wg7bmgf0sw34jn3iyl5kbm200dax8yqq6rfprcs49j";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Utilities for building simple command-line based user interfaces";
+  };
+
+  async_parallel = janePackage {
+    pname = "async_parallel";
+    hash = "0mdprhr1pv4g65g10gr3gaifrzknsdgarwfdbjlvhzfs86075kyn";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Distributed computing library";
+  };
+
+  async_shell = janePackage {
+    pname = "async_shell";
+    hash = "02clpz3xv3i5avzifwalylb9gfxzpgnr8bnlfsjixxfk2m7kvsj2";
+    propagatedBuildInputs = [ core_extended async ];
+    meta = {
+      description = "Shell helpers for Async";
+    };
+  };
+
+  async_ssl = janePackage {
+    pname = "async_ssl";
+    hash = "01w3bg38q61lc3hfh8jsr0sy1ylyv0m6g6h9yvsk8ngj6qk70nss";
+    propagatedBuildInputs = [ async ctypes openssl ];
+    meta.description = "Async wrappers for SSL";
+  };
+
+  # Jane Street packages, up to expect_test_helpers
+
+  sexp_pretty = janePackage {
+    pname = "sexp_pretty";
+    hash = "1bx8va468j5b813m0vsh1jzgb6h2qnnjfmjlf2hb82sarv8lllfx";
+    propagatedBuildInputs = [ ppx_base re ];
+    meta.description = "S-expression pretty-printer";
+  };
+
+  expect_test_helpers_kernel = janePackage {
+    pname = "expect_test_helpers_kernel";
+    hash = "1ycqir8sqgq5nialnrfg29nqn0cqg6jjpgv24drdycdhqf5r2zg6";
+    propagatedBuildInputs = [ core_kernel sexp_pretty ];
+    meta.description = "Helpers for writing expectation tests";
+  };
+
+  expect_test_helpers = janePackage {
+    pname = "expect_test_helpers";
+    hash = "0rsh6rwbqfcrqisk8jp7srlnicsadbzrs02ri6zyx0p3lmznw5r2";
+    propagatedBuildInputs = [ async expect_test_helpers_kernel ];
+    meta.description = "Async helpers for writing expectation tests";
+  };
+
+  # Miscellaneous Jane Street packages
+
+  bignum = janePackage {
+    pname = "bignum";
+    hash = "0g80mzsi7vc1kq4mzha8y9nl95h6cd041vix3wjrqgkdvb1qd4f3";
+    propagatedBuildInputs = [ core_kernel zarith ];
+    meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals";
+  };
+
+  cinaps = janePackage {
+    pname = "cinaps";
+    hash = "02fpjiwrygkpx2q4jfldhbqh0mqxmf955wizr8k4vmsq4wsis0p5";
+    propagatedBuildInputs = [ re ];
+    meta.description = "Trivial Metaprogramming tool using the OCaml toplevel";
+  };
+
+  command_rpc = janePackage {
+    pname = "command_rpc";
+    hash = "0w58z9jkz5qzbvf33wrzhfshzdvnrphj6dq8dmi52ykhfvxm7824";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Utilities for Versioned RPC communication with a child process over stdin and stdout";
+  };
+
+  core_bench = janePackage {
+    pname = "core_bench";
+    hash = "1m2q7217nmcsck29i59djkm0h6z3aj0i01niijzr5f6ilbnmyd3h";
+    propagatedBuildInputs = [ core_extended ];
+    meta = {
+      description = "Micro-benchmarking library for OCaml";
+    };
+  };
+
+  core_profiler = janePackage {
+    pname = "core_profiler";
+    hash = "1ir2v3wdfbf5xzqcma16asc73mkx2q6dzq5y1bx6q1rpa7iznx44";
+    propagatedBuildInputs = [ core_extended ];
+    meta = {
+      description = "Profiling library";
+    };
+  };
+
+  csvfields = janePackage {
+    pname = "csvfields";
+    hash = "0lbvs1kwl22ryxhw6s089f6683hj2920bn518mvr22rnv7qijy0v";
+    propagatedBuildInputs = [ core ];
+    meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv";
+  };
+
+  ecaml = janePackage {
+    pname = "ecaml";
+    hash = "1a2534bzbwgpm71aj3sm71sm0lkcjdfjj1mk91p1pg9kxn8c5x4i";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Writing Emacs plugin in OCaml";
+  };
+
+  email_message = janePackage {
+    pname = "email_message";
+    hash = "0cpaf6wn5g883bxdz029bksvrfzih99m7hzbb30fhqglmpmmkniz";
+    propagatedBuildInputs = [ async core_extended cryptokit magic-mime ounit ];
+    meta = {
+      description = "E-mail message parser";
+    };
+  };
+
+  incremental_kernel = janePackage {
+    pname = "incremental_kernel";
+    hash = "0zq48wbgqcflh84n10iygi8aa3f0zzmgc7r0jwvsyg7i8zccgvf5";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Library for incremental computations depending only on core_kernel";
+  };
+
+  incremental = janePackage {
+    pname = "incremental";
+    hash = "05sx8ia46v4dlvzcn7xgjcwxvbd0wmvv9r2bpvniapjnwr1nvcfh";
+    propagatedBuildInputs = [ core incremental_kernel ];
+    meta.description = "Library for incremental computations";
+  };
+
+  incr_map = janePackage {
+    pname = "incr_map";
+    hash = "0358qg9irxbbhn18laqww3mn43mdwvlbr0h2mvg3vdbb2c5jp4fv";
+    propagatedBuildInputs = [ incremental_kernel ];
+    meta.description = "Helpers for incremental operations on map like data structures";
+  };
+
+  ocaml_plugin = janePackage {
+    pname = "ocaml_plugin";
+    hash = "0q33swnlx9p1gcn1aj95501kapb7cnbzbsavid69csczwmzcxr14";
+    buildInputs = [ ocamlbuild ];
+    propagatedBuildInputs = [ async ];
+    meta.description = "Automatically build and dynlink ocaml source files";
+  };
+
+  parsexp = janePackage {
+    pname = "parsexp";
+    hash = "0brrifvnfqbfk873v6y5b2jixs2d73hpispj9r440kca5cfsv23b";
+    propagatedBuildInputs = [ ppx_compare ppx_fields_conv ppx_js_style ppx_sexp_value ];
+    meta.description = "S-expression parsing library";
+  };
+
+  parsexp_io = janePackage {
+    pname = "parsexp_io";
+    hash = "0gcmh4dg48xgszladq92yhk1hf492zf0smz462xrwknzlfdkz6a5";
+    propagatedBuildInputs = [ parsexp ];
+    meta.description = "S-expression parsing library (IO functions)";
+  };
+
+  patience_diff = janePackage {
+    pname = "patience_diff";
+    hash = "0vpx9xj1ich5qmj3m26vlmix3nsdj7pd1xzhqwbc7ad2kqwy3grg";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Tool and library implementing patience diff";
+  };
+
+  posixat = janePackage {
+    pname = "posixat";
+    hash = "0ak93dyzi6sc6gb0j07fj85b24d8bv6g2hm7jj5xwb39kjwh51jl";
+    propagatedBuildInputs = [ ppx_sexp_conv ];
+    meta.description = "Binding to the posix *at functions";
+    meta.broken = lib.versionAtLeast ocaml.version "4.05";
+  };
+
+  rpc_parallel = janePackage {
+    pname = "rpc_parallel";
+    hash = "0s72msl2p27bz0knjlpgy5qwp0w4z76cq801ps0sab35f8jjfs38";
+    propagatedBuildInputs = [ async ];
+    meta.description = "Type-safe library for building parallel applications";
+  };
+
+  shexp = janePackage {
+    pname = "shexp";
+    hash = "1fkz4l9z4i0fz2kccd5blm2j9x2x4z6y1cn29wjmc3spqfxbq37y";
+    propagatedBuildInputs = [ posixat spawn ];
+    meta.description = "Process library and s-expression based shell";
+  };
+
+  topological_sort = janePackage {
+    pname = "topological_sort";
+    hash = "1d64fyq0clsgham9p1f5rk01z8pxalglp92xmqw2iznyw0vxhvsy";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Topological sort algorithm";
+  };
+
+  typerep_extended = janePackage {
+    pname = "typerep_extended";
+    hash = "15gq8mrvlipd616rffr3f0wqw5d0ijnnizix610g2d5viirh0j9p";
+    propagatedBuildInputs = [ core_kernel ];
+    meta.description = "Runtime types for OCaml (Extended)";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix
new file mode 100644
index 000000000000..8f4eb7e41510
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix
@@ -0,0 +1,16 @@
+{lib, buildOcamlJane,
+ ppx_compare, ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools, ppx_type_conv, sexplib}:
+
+buildOcamlJane {
+  name = "ppx_assert";
+  hash = "0n7fa1j79ykbkhp8xz0ksg5096asri5d0msshsaqhw5fz18chvz4";
+  propagatedBuildInputs =
+    [ ppx_compare ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools
+      ppx_type_conv sexplib ];
+
+  meta = with lib; {
+    description = "Assert-like extension nodes that raise useful errors on failure";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix
new file mode 100644
index 000000000000..2aa1b208d503
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix
@@ -0,0 +1,18 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_inline_test, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_bench";
+  minimumSupportedOcamlVersion = "4.02";
+  hash = "1l5jlwy1d1fqz70wa2fkf7izngp6nx3g4s9bmnd6ca4dx1x5bksk";
+
+  hasSharedObjects = true;
+
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_inline_test ppx_tools ];
+
+  meta = with lib; {
+    description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix
new file mode 100644
index 000000000000..2dc64497ca23
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, bin_prot}:
+
+buildOcamlJane {
+  name = "ppx_bin_prot";
+  hash = "0kwmrrrybdkmphqczsr3lg3imsxcjb8iy41syvn44s3kcjfyyzbz";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv bin_prot ];
+
+  meta = with lib; {
+    description = "Generation of bin_prot readers and writers from types";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix
new file mode 100644
index 000000000000..103f17c455ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix
@@ -0,0 +1,15 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane {
+  name = "ppx_compare";
+  hash = "05cnwxfxm8201lpfmcqkcqfy6plh5c2151jbj4qsnxhlvvjli459";
+  propagatedBuildInputs =
+    [ppx_core ppx_driver ppx_tools ppx_type_conv ];
+
+  meta = with lib; {
+    description = "Generation of fast comparison functions from type expressions and definitions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix
new file mode 100644
index 000000000000..785cdbc31c07
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix
@@ -0,0 +1,15 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_custom_printf";
+  hash = "06y85m6ky376byja4w7gdwd339di5ag0xrf0czkylzjsnylhdr85";
+
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_sexp_conv ppx_tools ];
+
+  meta = with lib; {
+    description = "Extensions to printf-style format-strings for user-defined string conversion";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix
new file mode 100644
index 000000000000..edb73814704f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane {
+  name = "ppx_enumerate";
+  hash = "0m11921q2pjzkwckf21fynd2qfy83n9jjsgks23yagdai8a7ym16";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv ];
+
+  meta = with lib; {
+    description = "Generate a list containing all values of a finite type";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix
new file mode 100644
index 000000000000..7506e09e30e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix
@@ -0,0 +1,19 @@
+{lib, buildOcamlJane,
+ ppx_assert, ppx_compare, ppx_core, ppx_custom_printf, ppx_driver,
+ ppx_fields_conv, ppx_here, ppx_inline_test, ppx_sexp_conv, ppx_tools,
+ ppx_variants_conv, re, sexplib, variantslib, fieldslib}:
+
+buildOcamlJane {
+  name = "ppx_expect";
+  hash = "0cwagb4cj3x1vsr19kyfa9pxlvaz9a5v863cahi5glinsh4mzgdx";
+  propagatedBuildInputs =
+    [ ppx_assert ppx_compare ppx_core ppx_custom_printf ppx_driver
+      ppx_fields_conv ppx_here ppx_inline_test ppx_sexp_conv ppx_tools
+      ppx_variants_conv re sexplib variantslib fieldslib ];
+
+  meta = with lib; {
+    description = "Cram-like framework for OCaml";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix
new file mode 100644
index 000000000000..857e85f8f03a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane {
+  name = "ppx_fields_conv";
+  hash = "11w9wfjgkv7yxv3rwlwi6m193zan6rhmi45q7n3ddi2s8ls3gra7";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv ];
+
+  meta = with lib; {
+    description = "Generation of accessor and iteration functions for ocaml records";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-here.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-here.nix
new file mode 100644
index 000000000000..d9c7de65347e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-here.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver}:
+
+buildOcamlJane {
+  name = "ppx_here";
+  hash = "1mzdgn8k171zkwmbizf1a48l525ny0w3363c7gknpnifcinxniiw";
+  propagatedBuildInputs = [ ppx_core ppx_driver ];
+
+  meta = with lib; {
+    description = "A ppx rewriter that defines an extension node whose value is its source position";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix
new file mode 100644
index 000000000000..0b9bb9838947
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_inline_test";
+  hash = "0ygapa54i0wwcj3jcqwiimrc6z0b7aafgjhbk37h6vvclnm5n7f6";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_tools ];
+
+  meta = with lib; {
+    description = "Syntax extension for writing in-line tests in ocaml code";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix
new file mode 100644
index 000000000000..e6c51bebd52c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix
@@ -0,0 +1,22 @@
+{lib, buildOcamlJane,
+ ppx_assert,
+ ppx_bench, ppx_bin_prot, ppx_compare, ppx_custom_printf, ppx_driver,
+ ppx_enumerate, ppx_expect, ppx_fail, ppx_fields_conv, ppx_here,
+ ppx_inline_test, ppx_let, ppx_pipebang, ppx_sexp_conv, ppx_sexp_message,
+ ppx_sexp_value, ppx_typerep_conv, ppx_variants_conv}:
+
+buildOcamlJane {
+  name = "ppx_jane";
+  hash  = "1la0rp8fhzfglwb15gqh1pl1ld8ls4cnidaw9mjc5q1hb0yj1qd9";
+  propagatedBuildInputs =
+    [ ppx_assert ppx_bench ppx_bin_prot ppx_compare ppx_custom_printf
+      ppx_driver ppx_enumerate ppx_expect ppx_fail ppx_fields_conv
+      ppx_here ppx_inline_test ppx_let ppx_pipebang ppx_sexp_conv
+      ppx_sexp_message ppx_sexp_value ppx_typerep_conv ppx_variants_conv ];
+
+  meta = with lib; {
+    description = "A ppx_driver including all standard ppx rewriters";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-let.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-let.nix
new file mode 100644
index 000000000000..49333fb0e865
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-let.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver}:
+
+buildOcamlJane {
+  name = "ppx_let";
+  hash = "0whnfq4rgkq4apfqnvc100wlk25pmqdyvy6s21dsn3fcm9hff467";
+  propagatedBuildInputs = [ ppx_core ppx_driver ];
+
+  meta = with lib; {
+    description = "A ppx rewriter for monadic and applicative let bindings and match statements";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix
new file mode 100644
index 000000000000..1ee00ecfa70f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix
@@ -0,0 +1,15 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_optcomp";
+  hash = "09m2x2a5ics4bz1j29n5slhh1rlyhcwdfmf44v1jfxcby3f0riwd";
+  propagatedBuildInputs =
+    [ ppx_core ppx_tools ];
+
+  meta = with lib; {
+    description = "ppx_optcomp stands for Optional Compilation. It is a tool used to handle optional compilations of pieces of code depending of the word size, the version of the compiler, etc.";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix
new file mode 100644
index 000000000000..9afc27e8a5dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_pipebang";
+  hash = "0k25bhj9ziiw89xvs4svz7cgazbbmprba9wbic2llffg55fp7acc";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_tools ];
+
+  meta = with lib; {
+    description = "A ppx rewriter that inlines reverse application operators |> and |!";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix
new file mode 100644
index 000000000000..537a5941a9fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, sexplib}:
+
+buildOcamlJane {
+  name = "ppx_sexp_conv";
+  hash = "1kgbmlc11w5jhbhmy5n0f734l44zwyry48342dm5qydi9sfzcgq2";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv sexplib];
+
+  meta = with lib; {
+    description = "PPX syntax extension that generates code for converting OCaml types to and from s-expressions, as defined in the sexplib library";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix
new file mode 100644
index 000000000000..714c3356ea0c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_sexp_message";
+  hash = "0inbff25qii868p141jb1y8n3vjfyz66jpnsl9nma6nkkyjkp05j";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools ];
+
+  meta = with lib; {
+    description = "Easy construction of S-Expressions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix
new file mode 100644
index 000000000000..5bfbd185cee9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane {
+  name = "ppx_sexp_value";
+  hash = "04602ppqfwx33ghjywam00hlqqzsz4d99r60k9q0v1mynk9pjhj0";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools ];
+
+  meta = with lib; {
+    description = "A ppx rewriter that simplifies building S-Expression from OCaml Values";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix
new file mode 100644
index 000000000000..842e90276b73
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, typerep}:
+
+buildOcamlJane {
+  name = "ppx_typerep_conv";
+  hash = "0dldlx73r07j6w0i7h4hxly0v678naa79na5rafsk2974gs5ih9g";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv typerep ];
+
+  meta = with lib; {
+    description = "Automatic generation of runtime types from type definitions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix
new file mode 100644
index 000000000000..a2c8de8a8deb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix
@@ -0,0 +1,14 @@
+{lib, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, sexplib, variantslib}:
+
+buildOcamlJane {
+  name = "ppx_variants_conv";
+  hash = "0kgal8b9yh7wrd75hllb9fyl6zbksfnr9k7pykpzdm3js98dirhn";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv sexplib variantslib ];
+
+  meta = with lib; {
+    description = "Generation of accessor and iteration functions for ocaml variant types";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
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/sexplib.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/sexplib.nix
new file mode 100644
index 000000000000..b0b2ce3a451e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/sexplib.nix
@@ -0,0 +1,18 @@
+{lib, buildOcamlJane, type_conv}:
+
+buildOcamlJane {
+  minimumSupportedOcamlVersion = "4.02";
+  name = "sexplib";
+  version = "113.33.03";
+
+  hash = "1klar4qw4s7bj47ig7kxz2m4j1q3c60pfppis4vxrxv15r0kfh22";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "Library for serializing OCaml values to and from S-expressions";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/typerep.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/typerep.nix
new file mode 100644
index 000000000000..41e845b362ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/typerep.nix
@@ -0,0 +1,20 @@
+{lib, buildOcamlJane, type_conv}:
+
+buildOcamlJane {
+  name = "typerep";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  hash = "1ss34nq20vfgx8hwi5sswpmn3my9lvrpdy5dkng746xchwi33ar7";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/typerep";
+    description = "Runtime types for OCaml (beta version)";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/janestreet/variantslib.nix b/nixpkgs/pkgs/development/ocaml-modules/janestreet/variantslib.nix
new file mode 100644
index 000000000000..053ab412f88d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/janestreet/variantslib.nix
@@ -0,0 +1,19 @@
+{lib, buildOcamlJane, type_conv}:
+
+buildOcamlJane {
+  name = "variantslib";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  hash = "1hv0f75msrryxsl6wfnbmhc0n8kf7qxs5f82ry3b8ldb44s3wigp";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/variantslib";
+    description = "OCaml variants as first class values";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
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..15678f89da3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchzip, which, ocaml, findlib
+, camlzip, extlib
+}:
+
+if !lib.versionAtLeast ocaml.version "4.04"
+then throw "javalib is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-javalib-${version}";
+  version = "3.2.1";
+
+  src = fetchzip {
+    url = "https://github.com/javalib-team/javalib/archive/v${version}.tar.gz";
+    sha256 = "1fkdaiiza145yv0r1cm0n2hsrr0rbn6b27vs66njgv405zwn3vbn";
+  };
+
+  buildInputs = [ which ocaml findlib ];
+
+  patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
+
+  createFindlibDestdir = true;
+
+  preConfigure = "patchShebangs ./configure.sh";
+
+  configureScript = "./configure.sh";
+  dontAddPrefix = "true";
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  propagatedBuildInputs = [ camlzip extlib ];
+
+  meta = with lib; {
+    description = "A 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..cc2c65009ff3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jingoo/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, menhir, ppxlib, ppx_deriving, re, uutf, uucp, ounit2 }:
+
+buildDunePackage rec {
+  pname = "jingoo";
+  version = "1.4.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner = "tategakibunko";
+    repo = "jingoo";
+    rev = "v${version}";
+    sha256 = "0q947aik4i4z5wjllhwlkxh60qczwgra21yyrrzwhi9y5bnf8346";
+  };
+
+  buildInputs = [ menhir ];
+  propagatedBuildInputs = [ ppxlib ppx_deriving re uutf uucp ];
+  checkInputs = [ ounit2 ];
+  doCheck = true;
+
+
+  meta = with lib; {
+    homepage = "https://github.com/tategakibunko/jingoo";
+    description = "OCaml template engine almost compatible with jinja2";
+    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..5048a8fd06a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/bson.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, json-data-encoding, ocplib-endian, crowbar }:
+
+buildDunePackage {
+  pname = "json-data-encoding-bson";
+
+  inherit (json-data-encoding) version src useDune2 doCheck;
+
+  propagatedBuildInputs = [
+    json-data-encoding
+    ocplib-endian
+  ];
+
+  checkInputs = [
+    crowbar
+  ];
+
+  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..6dfea612b10a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/json-data-encoding/default.nix
@@ -0,0 +1,31 @@
+{ lib, fetchFromGitLab, buildDunePackage, uri, crowbar }:
+
+buildDunePackage rec {
+  pname = "json-data-encoding";
+  version = "0.8";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "json-data-encoding";
+    rev = "v${version}";
+    sha256 = "1c6m2qvi9bm6qjxc38p6cia1f66r0rb9xf6b8svlj3jjymvqw889";
+  };
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    uri
+  ];
+
+  checkInputs = [
+    crowbar
+  ];
+
+  doCheck = true;
+
+  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..78a081619b27
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jsonm/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf }:
+
+let version = "1.0.1"; in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-jsonm-${version}";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/jsonm/releases/jsonm-${version}.tbz";
+    sha256 = "1176dcmxb11fnw49b7yysvkjh0kpzx4s48lmdn5psq9vshp5c29w";
+  };
+
+  buildInputs = [ findlib topkg ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ uutf ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = {
+    description = "An 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 ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..85abaf7f872b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/alcotest.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, junit, alcotest }:
+
+buildDunePackage ({
+  pname = "junit_alcotest";
+
+  inherit (junit) src version meta useDune2;
+
+  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..c91625e823b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/default.nix
@@ -0,0 +1,26 @@
+{ 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
+  ];
+
+  useDune2 = true;
+  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.gpl3;
+    maintainers = with maintainers; [ superherointj ];
+    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..5f261b07236f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/junit/ounit.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, junit, ounit }:
+
+buildDunePackage ({
+  pname = "junit_ounit";
+
+  inherit (junit) src version meta useDune2;
+
+  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..3950c13d3fcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/jwto/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchFromGitHub, alcotest, cryptokit, fmt, yojson
+, ppxlib
+, base64, re, ppx_deriving }:
+
+buildDunePackage rec {
+  pname = "jwto";
+  version = "0.3.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner = "sporto";
+    repo = "jwto";
+    rev = version;
+    sha256 = "1p799zk8j9c0002xzi2x7ndj1bzqf14744ampcqndrjnsi7mq71s";
+  };
+
+  buildInputs = [ ppxlib ];
+
+  propagatedBuildInputs =
+    [ cryptokit 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..7636942033a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kafka/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, rdkafka, zlib }:
+
+buildDunePackage rec {
+  pname = "kafka";
+  version = "0.5";
+
+  useDune2 = true;
+
+  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..a6cef66b2761
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/kafka/lwt.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage
+, kafka
+, lwt
+, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "kafka_lwt";
+
+  inherit (kafka) version useDune2 src;
+
+  buildInputs = [ cmdliner ];
+
+  propagatedBuildInputs = [ kafka lwt ];
+
+  meta = kafka.meta // {
+    description = "OCaml bindings for Kafka, Lwt bindings";
+  };
+}
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..f14383207ea6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ke/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchurl
+, bigarray-compat, fmt
+, alcotest, bigstringaf
+}:
+
+buildDunePackage rec {
+  pname = "ke";
+  version = "0.4";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ke/releases/download/v${version}/ke-v${version}.tbz";
+    sha256 = "13c9xy60vmq29mnwpg3h3zgl6gjbjfwbx1s0crfc6xwvark0zxnx";
+  };
+
+  propagatedBuildInputs = [ bigarray-compat fmt ];
+
+  checkInputs = [ alcotest bigstringaf ];
+  doCheck = true;
+
+  minimumOCamlVersion = "4.03";
+
+  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/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..3d57c4e40ed6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgl/default.nix
@@ -0,0 +1,45 @@
+{lib, stdenv, fetchurl, ocaml, lablgtk, findlib, libGLU, libGL, freeglut, camlp4 } :
+
+let
+  pname = "lablgl";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "1.05";
+
+  src = fetchurl {
+    url = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/dist/lablgl-${version}.tar.gz";
+    sha256 = "0qabydd219i4ak7hxgc67496qnnscpnydya2m4ijn3cpbgih7zyq";
+  };
+
+  buildInputs = [ocaml findlib lablgtk freeglut camlp4];
+  propagatedBuildInputs = [ libGLU libGL ];
+
+  patches = [ ./Makefile.config.patch ./META.patch ];
+
+  preConfigure = ''
+    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/lablgl \
+      --subst-var-by TKINCLUDES "" \
+      --subst-var-by XINCLUDES ""
+  '';
+
+  createFindlibDestdir = true;
+
+  buildFlags = [ "lib" "libopt" "glut" "glutopt" ];
+
+  postInstall = ''
+    cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl
+  '';
+
+  meta = with lib; {
+    homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html";
+    description = "OpenGL bindings for ocaml";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub vbgl ];
+    broken = stdenv.isDarwin;
+  };
+}
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..70cc88d21166
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }:
+
+stdenv.mkDerivation {
+  name = "ocaml-lablgtk-extras-1.4";
+  src = fetchurl {
+    url = "http://forge.ocamlcore.org/frs/download.php/1282/lablgtkextras-1.4.tar.gz";
+    sha256 = "09fqxwdib7r9yxynknc9gv3jw2hnhj5cak7q5jngk6m8rzvmhfcc";
+  };
+
+  buildInputs = [ 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 = "A 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..3cd13b2c4d6c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk-extras/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "4.02";
+
+stdenv.mkDerivation rec {
+  version = "1.6";
+  name = "ocaml${ocaml.version}-lablgtk-extras-${version}";
+  src = fetchFromGitHub {
+    owner = "zoggy";
+    repo = "lablgtk-extras";
+    rev = "release-${version}";
+    sha256 = "1bbdp5j18s582mmyd7qiaq1p08g2ag4gl7x65pmzahbhg719hjda";
+  };
+
+  buildInputs = [ 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 = "A collection of libraries and modules useful when developing OCaml/LablGtk2 applications";
+    license = lib.licenses.lgpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix b/nixpkgs/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix
new file mode 100644
index 000000000000..232621ad83ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, libglade, gtksourceview, camlp4 }:
+
+if lib.versionAtLeast ocaml.version "4.04"
+then throw "lablgtk-2.14 is not available for OCaml ${ocaml.version}" else
+
+let
+  pname = "lablgtk";
+in
+
+stdenv.mkDerivation (rec {
+  name = "${pname}-${version}";
+  version = "2.14.0";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/561/${name}.tar.gz";
+    sha256 = "1fnh0amm7lwgyjdhmlqgsp62gwlar1140425yc1j6inwmgnsp0a9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ocaml findlib gtk2 libgnomecanvas libglade gtksourceview camlp4 ];
+
+  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
+  '';
+
+  meta = {
+    branch = "2.14";
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [
+      lib.maintainers.maggesi
+      lib.maintainers.roconnor
+    ];
+    homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgtk.html";
+    description = "LablGTK is is an Objective Caml interface to GTK";
+    license = lib.licenses.lgpl21Plus;
+  };
+})
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..09487ac9dad7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, libglade, gtksourceview }:
+
+let param =
+  let check = lib.versionAtLeast ocaml.version; in
+  if check "4.06" then rec {
+    version = "2.18.10";
+    src = fetchFromGitHub {
+      owner = "garrigue";
+      repo = "lablgtk";
+      rev = version;
+      sha256 = "0w8cdfcv2wc19sd3qzj3qq77qc6rbnbynsz02gzbl15kgrvgrfxi";
+    };
+  } 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";
+    };
+  } else throw "lablgtk is not available for OCaml ${ocaml.version}";
+in
+
+stdenv.mkDerivation {
+  pname = "lablgtk";
+  inherit (param) version src;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ocaml findlib gtk2 libgnomecanvas libglade gtksourceview ];
+
+  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; {
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [
+      maggesi roconnor vbgl
+    ];
+    homepage = "http://lablgtk.forge.ocamlcore.org/";
+    description = "An OCaml interface to GTK";
+    license = licenses.lgpl21Plus;
+  };
+}
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..b14f5b736b45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lablgtk3/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, pkg-config, buildDunePackage, dune-configurator, gtk3, cairo2 }:
+
+buildDunePackage rec {
+  version = "3.1.1";
+  pname = "lablgtk3";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/garrigue/lablgtk/releases/download/${version}/lablgtk3-${version}.tbz";
+    sha256 = "1ygc1yh99gh44h958yffw1vxdlfpn799d4x1s36c2jfbi8f0dir2";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  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..b037f7d989f4
--- /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 useDune2 meta nativeBuildInputs;
+}
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..a0560029880d
--- /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 useDune2 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..bef06975ac55
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/labltk/default.nix
@@ -0,0 +1,81 @@
+{ stdenv, lib, makeWrapper, fetchzip, 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";
+  };
+ };
+ 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;
+  name = "ocaml${ocaml.version}-labltk-${version}";
+
+  buildInputs = [ ocaml findlib tcl tk makeWrapper ];
+
+  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..fc2327b736e9
--- /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.8";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/lacaml/releases/download/${version}/lacaml-${version}.tbz";
+    sha256 = "1i47wqnd9iy6ndbi9zfahpb592gahp6im26rgpwch13vgzk3kifd";
+  };
+
+  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/lambda-term/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix
new file mode 100644
index 000000000000..0d5babad0428
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lambda-term/default.nix
@@ -0,0 +1,40 @@
+{ lib, fetchFromGitHub, buildDunePackage, zed, lwt_log, lwt_react, mew_vi }:
+
+buildDunePackage rec {
+  pname = "lambda-term";
+  version = "3.1.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    sha256 = "1k0ykiz0vhpyyj9fkss29ajas4fh1xh449j702xkvayqipzj1mkg";
+  };
+
+  propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ];
+
+  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
+    ];
+  };
+}
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..de5fbf63b383
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lambdasoup/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, markup, ounit2 }:
+
+buildDunePackage rec {
+  pname = "lambdasoup";
+  version = "0.7.2";
+
+  minimumOCamlVersion = "4.02";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = pname;
+    rev = version;
+    sha256 = "0php51lyz3ll0psazjd59yw02xb9w84150gkyiwmn3fa0iq8nf7m";
+  };
+
+  propagatedBuildInputs = [ markup ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.04";
+  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/lens/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lens/default.nix
new file mode 100644
index 000000000000..c9cd5572bc7f
--- /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";
+
+  useDune2 = true;
+
+  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/default.nix b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix
new file mode 100644
index 000000000000..0a70bf302428
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/letsencrypt/default.nix
@@ -0,0 +1,84 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, astring
+, asn1-combinators
+, uri
+, rresult
+, base64
+, cmdliner
+, cohttp
+, cohttp-lwt
+, cohttp-lwt-unix
+, zarith
+, logs
+, fmt
+, lwt
+, mirage-crypto
+, mirage-crypto-pk
+, mirage-crypto-rng
+, x509
+, yojson
+, ounit
+, dns
+, dns-tsig
+, ptime
+, bos
+, fpath
+, randomconv
+, domain-name
+}:
+
+buildDunePackage rec {
+  pname = "letsencrypt";
+  version = "0.2.5";
+
+  src = fetchurl {
+    url = "https://github.com/mmaker/ocaml-letsencrypt/releases/download/v${version}/letsencrypt-v${version}.tbz";
+    sha256 = "6e3bbb5f593823d49e83e698c06cf9ed48818695ec8318507b311ae74731e607";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  buildInputs = [
+    cmdliner
+    cohttp
+    cohttp-lwt-unix
+    zarith
+    fmt
+    mirage-crypto-rng
+    ptime
+    bos
+    fpath
+    randomconv
+    domain-name
+  ];
+
+  propagatedBuildInputs = [
+    logs
+    yojson
+    lwt
+    base64
+    mirage-crypto
+    mirage-crypto-pk
+    asn1-combinators
+    x509
+    uri
+    dns
+    dns-tsig
+    rresult
+    astring
+    cohttp-lwt
+  ];
+
+  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/linenoise/default.nix b/nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix
new file mode 100644
index 000000000000..eaeb053239e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/linenoise/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, result }:
+
+buildDunePackage rec {
+  pname = "linenoise";
+  version = "1.3.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "fxfactorial";
+    repo = "ocaml-${pname}";
+    rev = "v${version}";
+    sha256 = "0m9mm1arsawi5w5aqm57z41sy1wfxvhfgbdiw7hzy631i391144g";
+  };
+
+  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/llvm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix
new file mode 100644
index 000000000000..3357b99cebfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, python, cmake, libllvm, ocaml, findlib, ctypes }:
+
+let version = lib.getVersion libllvm; in
+
+stdenv.mkDerivation {
+  pname = "ocaml-llvm";
+  inherit version;
+
+  inherit (libllvm) src;
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ python ocaml findlib ctypes ];
+  propagatedBuildInputs = [ libllvm ];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+    description = "OCaml bindings distributed with LLVM";
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+
+}
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..fedfb1c7637f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/logs/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild
+, topkg, result, lwt, cmdliner, fmt }:
+let
+  pname = "logs";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+if !lib.versionAtLeast 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 ];
+  buildInputs = [ findlib topkg fmt cmdliner lwt ];
+  propagatedBuildInputs = [ result ];
+
+  buildPhase = "${topkg.run} build --with-js_of_ocaml false";
+
+  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..035d612cfe27
--- /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.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/lru/releases/download/v${version}/lru-v${version}.tbz";
+    sha256 = "1ab9rd7cq15ml8x0wjl44wy99h5z7x4g9vkkz4i2d7n84ghy7vw4";
+  };
+
+  propagatedBuildInputs = [ psq ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+  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..8a4f58ccbbd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lua-ml/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }:
+
+if !lib.versionAtLeast 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.1";
+
+  src = fetchFromGitHub {
+    owner = "lindig";
+    repo = pname;
+    rev = version;
+    sha256 = "04lv98nxmzanvyn4c0k6k0ax29f5xfdl8qzpf5hwadslq213a044";
+  };
+
+  nativeBuildInputs = [ opaline ];
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  buildFlags = [ "lib" ];
+
+  installPhase = ''
+    opaline -prefix $out -libdir $OCAMLFIND_DESTDIR
+  '';
+
+  meta = {
+    description = "An 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/luv/default.nix b/nixpkgs/pkgs/development/ocaml-modules/luv/default.nix
new file mode 100644
index 000000000000..fec487aeac20
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/luv/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchurl
+, ctypes, result
+, alcotest
+, file
+}:
+
+buildDunePackage rec {
+  pname = "luv";
+  version = "0.5.10";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/aantron/luv/releases/download/${version}/luv-${version}.tar.gz";
+    sha256 = "0zygir01d6vglfs4b3klnbg90glvyl9agq5xnzn8hmsb6d8z0jqp";
+  };
+
+  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 ];
+  doCheck = true;
+
+  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/lwt-canceler/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-canceler/default.nix
new file mode 100644
index 000000000000..2e4d12082b75
--- /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.2";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "lwt-canceler";
+    rev = "v${version}";
+    sha256 = "07931486vg83sl1c268i0vyw61l8n8xs2krjsj43070zljqi8rf1";
+  };
+  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-watcher/default.nix b/nixpkgs/pkgs/development/ocaml-modules/lwt-watcher/default.nix
new file mode 100644
index 000000000000..23caa894736a
--- /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.1";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0kaf7py02i0dn9rvrbzxh4ljfg059wc8xvm093m9wy7lsa68rax9";
+  };
+
+  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..fbf920d9621d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/camlp4.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, camlp4 }:
+
+buildDunePackage rec {
+  pname = "lwt_camlp4";
+  version = "git-20180325";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = "45f25a081e01071ab566924b48ba5f7553bb33ac";
+    sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9";
+  };
+
+  minimumOCamlVersion = "4.02";
+
+  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..7d6424564d2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchzip, pkg-config, ncurses, libev, buildDunePackage, ocaml
+, cppo, dune-configurator, ocplib-endian, result
+, mmap, seq
+, ocaml-syntax-shims
+}:
+
+let inherit (lib) optional versionAtLeast; in
+
+buildDunePackage rec {
+  pname = "lwt";
+  version = "5.4.1";
+
+  useDune2 = true;
+
+  src = fetchzip {
+    url = "https://github.com/ocsigen/${pname}/archive/${version}.tar.gz";
+    sha256 = "0cq2qy23sa1a5zk6nja3c652mp29i84yfrkcwks6i8sdqwli36jy";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ cppo dune-configurator ]
+   ++ optional (!versionAtLeast ocaml.version "4.08") ocaml-syntax-shims
+   ++ optional (!versionAtLeast ocaml.version "4.07") ncurses;
+  propagatedBuildInputs = [ libev mmap ocplib-endian seq result ];
+
+  meta = {
+    homepage = "https://ocsigen.org/lwt/";
+    description = "A 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..2df17844d1a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt/ppx.nix
@@ -0,0 +1,29 @@
+{ fetchzip, buildDunePackage, lwt, ppxlib }:
+
+buildDunePackage {
+  pname = "lwt_ppx";
+  version = "2.0.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchzip {
+    # `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.
+    url = "https://github.com/ocsigen/lwt/archive/5.4.0.tar.gz";
+    sha256 = "1ay1zgadnw19r9hl2awfjr22n37l7rzxd9v73pjbahavwm2ay65d";
+  };
+
+  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..9213e1af94f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_log/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage, lwt }:
+
+buildDunePackage rec {
+  pname = "lwt_log";
+  version = "1.1.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "aantron";
+    repo = pname;
+    rev = version;
+    sha256 = "1n12i1rmn9cjn6p8yr6qn5dwbrwvym7ckr7bla04a1xnq8qlcyj7";
+  };
+
+  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..5513935133e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_react/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, lwt, react }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.1";
+  name = "ocaml${ocaml.version}-lwt_react-${version}";
+  src = fetchzip {
+    url = "https://github.com/ocsigen/lwt/releases/download/3.0.0/lwt_react-1.0.1.tar.gz";
+    sha256 = "1bbz7brvdskf4angzn3q2s2s6qdnx7x8m8syayysh23gwv4c7v31";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  propagatedBuildInputs = [ lwt react ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "Helpers for using React with Lwt";
+    inherit (lwt.meta) homepage license maintainers;
+    inherit (ocaml.meta) platforms;
+  };
+}
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..173094aacb84
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/lwt_ssl/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchzip, buildDunePackage, ssl, lwt }:
+
+buildDunePackage rec {
+  pname = "lwt_ssl";
+  version = "1.1.3";
+
+  minimumOCamlVersion = "4.02";
+  useDune2 = true;
+
+  src = fetchzip {
+    url = "https://github.com/aantron/${pname}/archive/${version}.tar.gz";
+    sha256 = "0v417ch5zn0yknj156awa5mrq3mal08pbrvsyribbn63ix6f9y3p";
+  };
+
+  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..143230408920
--- /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 minimumOCamlVersion;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ macaddr cstruct ];
+
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "A 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..4f6f2e4287f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaddr/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_sexp_conv, ounit
+}:
+
+buildDunePackage rec {
+  pname = "macaddr";
+  version = "5.1.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-ipaddr/releases/download/v${version}/ipaddr-v${version}.tbz";
+    sha256 = "7e9328222c1a5f39b0751baecd7e27a842bdb0082fd48126eacbbad8816fbf5a";
+  };
+
+  checkInputs = [ ppx_sexp_conv ounit ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/ocaml-ipaddr";
+    description = "A 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..35cc7c6b4401
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaddr/sexp.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage
+, macaddr, ppx_sexp_conv, macaddr-cstruct, ounit
+}:
+
+buildDunePackage {
+  pname = "macaddr-sexp";
+
+  inherit (macaddr) version src minimumOCamlVersion;
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ ppx_sexp_conv ];
+
+  checkInputs = [ macaddr-cstruct ounit ];
+  doCheck = true;
+
+  meta = macaddr.meta // {
+    description = "A library for manipulation of MAC address representations using sexp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/macaque/default.nix b/nixpkgs/pkgs/development/ocaml-modules/macaque/default.nix
new file mode 100644
index 000000000000..61ee7ebfe9c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/macaque/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchzip, ocaml, findlib, ocamlbuild, pgocaml, camlp4 }:
+
+stdenv.mkDerivation {
+  name = "ocaml-macaque-0.7.2";
+  src = fetchzip {
+    url = "https://github.com/ocsigen/macaque/archive/0.7.2.tar.gz";
+    sha256 = "14i0a8cndzndjmlkyhf31r451q99cnkndgxcj0id4qjqhdl4bmjv";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
+  propagatedBuildInputs = [ pgocaml ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    description = "Macros for Caml Queries";
+    homepage = "https://github.com/ocsigen/macaque";
+    license = licenses.lgpl2;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
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..15628bcf26c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/magic-mime/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "magic-mime";
+  version = "1.1.3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-magic-mime/releases/download/v${version}/magic-mime-v${version}.tbz";
+    sha256 = "1xqjs8bba567yzrzgnr88j5ck97d36zw68zr9v29liya37k6rcvz";
+  };
+
+  minimalOCamlVersion = "4.03";
+  useDune2 = true;
+
+  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/magick/default.nix b/nixpkgs/pkgs/development/ocaml-modules/magick/default.nix
new file mode 100644
index 000000000000..016c059573b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/magick/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchurl, which, pkg-config, ocaml, findlib, imagemagick }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "magick is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-magick-0.34";
+  src = fetchurl {
+    url = "http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/ImageMagick/OCaml-ImageMagick-0.34.tgz";
+    sha256 = "0gn9l2qdr8gby2x8c2mb59x1kipb2plr45rbq6ymcxyi0wmzfh3q";
+  };
+
+  nativeBuildInputs = [ which pkg-config ];
+  buildInputs = [ ocaml findlib imagemagick ];
+
+  createFindlibDestdir = true;
+
+  preConfigure = "substituteInPlace Makefile --replace gcc $CC";
+
+  installTargets = [ "find_install" ];
+
+  meta = {
+    homepage = "http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/";
+    description = "ImageMagick Binding for OCaml";
+    license = lib.licenses.mit;
+    platforms = imagemagick.meta.platforms;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
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..2c3c7c423ac0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mariadb/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildOasisPackage
+, ctypes, mariadb, libmysqlclient }:
+
+buildOasisPackage rec {
+  pname = "mariadb";
+  version = "1.1.4";
+
+  minimumOCamlVersion = "4.07.0";
+
+  src = fetchFromGitHub {
+    owner = "andrenth";
+    repo = "ocaml-mariadb";
+    rev = version;
+    sha256 = "1rxqvxr6sv4x2hsi05qm9jz0asaq969m71db4ckl672rcql1kwbr";
+  };
+
+  buildInputs = [ mariadb libmysqlclient ];
+  propagatedBuildInputs = [ ctypes ];
+
+  meta = {
+    description = "OCaml bindings for MariaDB";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ bcc32 ];
+    homepage = "https://github.com/andrenth/ocaml-mariadb";
+  };
+}
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..a8246e1cc7e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/markup/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchzip, ocaml, uchar, uutf, ounit2 }:
+
+buildDunePackage rec {
+  pname = "markup";
+  version = "1.0.0";
+
+  useDune2 = true;
+
+  src = fetchzip {
+    url = "https://github.com/aantron/markup.ml/archive/${version}.tar.gz";
+    sha256 = "09hkrf9pw6hpb9j06p5bddklpnjwdjpqza3bx2179l970yl67an9";
+  };
+
+  propagatedBuildInputs = [ uchar uutf ];
+
+  checkInputs = [ ounit2 ];
+  doCheck = lib.versionAtLeast ocaml.version "4.04";
+
+  meta = with lib; {
+    homepage = "https://github.com/aantron/markup.ml/";
+    description = "A 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..3b396215e575
--- /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;
+
+  buildInputs = [
+    cudf
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A 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; [ superherointj ];
+  };
+}
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..2677f56584e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mdx/default.nix
@@ -0,0 +1,38 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, alcotest
+, astring, cmdliner, cppo, fmt, logs, ocaml-version, odoc-parser, ocaml_lwt, re, result, csexp
+, pandoc}:
+
+buildDunePackage rec {
+  pname = "mdx";
+  version = "1.11.0";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz";
+    sha256 = "1hk8ffh3d9hiibrj6691khnbmjnfs9psmiawnrbgi0577bw030wx";
+  };
+
+  nativeBuildInputs = [ cppo ];
+  buildInputs = [ cmdliner ];
+  propagatedBuildInputs = [ astring fmt logs result csexp ocaml-version odoc-parser re ];
+  checkInputs = [ alcotest ocaml_lwt pandoc ];
+
+  doCheck = true;
+
+  outputs = [ "bin" "lib" "out" ];
+
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib ${pname}
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = "https://github.com/realworldocaml/mdx";
+    description = "Executable OCaml code blocks inside markdown files";
+    changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.romildo ];
+  };
+}
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..686cf9820580
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/default.nix
@@ -0,0 +1,15 @@
+{ lib, fetchFromGitLab, buildDunePackage
+, menhirLib, menhirSdk
+}:
+
+buildDunePackage rec {
+  pname = "menhir";
+
+  inherit (menhirLib) version src useDune2;
+
+  buildInputs = [ menhirLib menhirSdk ];
+
+  meta = menhirSdk.meta // {
+    description = "A LR(1) parser generator for OCaml";
+  };
+}
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..3f6660f23ee9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/lib.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "menhirLib";
+  version = "20210419";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = "menhir";
+    rev = version;
+    sha256 = "0jcbr7s3iwfr7xxfybs3h407g76yfp5yq5r9i0wg2ahvvbqh03ky";
+  };
+
+  useDune2 = true;
+
+  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..0e60849494cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/menhir/sdk.nix
@@ -0,0 +1,15 @@
+{ lib, fetchFromGitLab, buildDunePackage
+, menhirLib
+}:
+
+buildDunePackage rec {
+  pname = "menhirSdk";
+
+  inherit (menhirLib) version src useDune2;
+
+  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..6d4fcad09775
--- /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";
+  };
+
+  buildInputs = [ cppo ];
+
+  meta = with lib; {
+    homepage = "https://github.com/let-def/merlin-extend";
+    description = "SDK to extend Merlin";
+    license = licenses.mit;
+    maintainers = [ maintainers.volth ];
+  };
+}
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..58fcab5313a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage, alcotest, fmt }:
+
+buildDunePackage rec {
+  pname = "metrics";
+  version = "0.2.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/metrics/releases/download/${version}/metrics-${version}.tbz";
+    sha256 = "0j215cji3n78lghzi9m6kgr3r1s91v681hfnn7cgybb31d7gjkqg";
+  };
+
+  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..8394ec0c0f94
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/influx.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, metrics
+, astring, duration, fmt, lwt
+}:
+
+buildDunePackage rec {
+  pname = "metrics-influx";
+  inherit (metrics) version useDune2 src;
+
+  propagatedBuildInputs = [ astring 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..7085ff58148b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/lwt.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, logs, ocaml_lwt, metrics }:
+
+buildDunePackage {
+  pname = "metrics-lwt";
+
+  inherit (metrics) version useDune2 src;
+
+  propagatedBuildInputs = [ logs ocaml_lwt metrics ];
+
+  meta = metrics.meta // {
+    description = "Lwt backend for the Metrics library";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/metrics/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/metrics/mirage.nix
new file mode 100644
index 000000000000..4a891505ac71
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/mirage.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, metrics, metrics-influx
+, cstruct, ipaddr, logs, lwt, mirage-clock, mirage-stack
+}:
+
+buildDunePackage {
+  pname = "metrics-mirage";
+  inherit (metrics) version useDune2 src;
+
+  propagatedBuildInputs = [ cstruct ipaddr logs lwt metrics metrics-influx mirage-clock mirage-stack ];
+
+  meta = metrics.meta // {
+    description = "Mirage backend 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..5a7bae1b29f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/metrics/unix.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, gnuplot, ocaml_lwt, metrics, metrics-lwt, mtime, uuidm }:
+
+buildDunePackage rec {
+
+  pname = "metrics-unix";
+
+  inherit (metrics) version useDune2 src;
+
+  propagatedBuildInputs = [ gnuplot ocaml_lwt metrics mtime uuidm ];
+
+  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/mimic/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix
new file mode 100644
index 000000000000..ea1636427038
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mimic/default.nix
@@ -0,0 +1,43 @@
+{ lib, buildDunePackage, fetchurl
+, fmt, mirage-flow, result, rresult, cstruct, logs, ke, lwt
+, alcotest, alcotest-lwt, bigstringaf, bigarray-compat
+}:
+
+buildDunePackage rec {
+  pname = "mimic";
+  version = "0.0.3";
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/mimic/releases/download/${version}/mimic-${version}.tbz";
+    sha256 = "e4743cd2e4f8242eb1ce9d8086fd2affba0eb6a62131309ffa279108bd3dbbcb";
+  };
+
+  propagatedBuildInputs = [
+    fmt
+    lwt
+    mirage-flow
+    result
+    rresult
+    logs
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    bigstringaf
+    bigarray-compat
+    cstruct
+    ke
+  ];
+
+  meta = with lib; {
+    description = "A simple protocol dispatcher";
+    license = licenses.isc;
+    homepage = "https://github.com/mirage/ocaml-git";
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
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..f9d37d6b4faf
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/minisat/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "minisat";
+  version = "0.3";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.05";
+
+  src = fetchFromGitHub {
+    owner  = "c-cube";
+    repo   = "ocaml-minisat";
+    rev    = "v${version}";
+    sha256 = "01wggbziqz5x6d7mwdl40sbf6qal7fd853b224zjf9n0kzzsnczh";
+  };
+
+  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/mirage-block-ramdisk/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix
new file mode 100644
index 000000000000..7e8ebba73eb5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchurl, buildDunePackage, io-page, io-page-unix, mirage-block, alcotest
+, mirage-block-combinators }:
+
+buildDunePackage rec {
+  pname = "mirage-block-ramdisk";
+  version = "0.5";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/mirage-block-ramdisk/releases/download/${version}/mirage-block-ramdisk-${version}.tbz";
+    sha256 = "cc0e814fd54efe7a5b7a8c5eb1c04e2dece751b7d8dee2d95908a0768896e8af";
+  };
+
+  # Make tests compatible with alcotest 1.4.0
+  postPatch = ''
+    substituteInPlace test/tests.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)'
+  '';
+
+  minimumOCamlVersion = "4.06";
+
+  propagatedBuildInputs = [ io-page mirage-block ];
+
+  doCheck = true;
+  checkInputs = [ alcotest io-page-unix mirage-block-combinators ];
+
+  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..a24c4c9e821f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block-unix/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage, cstruct-lwt, diet, io-page-unix, logs
+, mirage-block, ounit, rresult, uri }:
+
+buildDunePackage rec {
+  pname = "mirage-block-unix";
+  version = "2.12.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url =
+      "https://github.com/mirage/mirage-block-unix/releases/download/v${version}/mirage-block-unix-v${version}.tbz";
+    sha256 = "4fc0ccea3c06c654e149c0f0e1c2a6f19be4e3fe1afd293c6a0dba1b56b3b8c4";
+  };
+
+  minimumOCamlVersion = "4.06";
+
+  propagatedBuildInputs = [ cstruct-lwt logs mirage-block rresult uri ];
+
+  doCheck = true;
+  checkInputs = [ diet io-page-unix ounit ];
+
+  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..9d0cdd435cbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/combinators.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, mirage-block, io-page, logs }:
+
+buildDunePackage rec {
+  pname = "mirage-block-combinators";
+  inherit (mirage-block) version src useDune2;
+
+  propagatedBuildInputs = [ mirage-block io-page 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..28eb4d6b28ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-block/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, lwt, mirage-device
+}:
+
+buildDunePackage rec {
+  pname = "mirage-block";
+  version = "2.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-block/releases/download/v${version}/mirage-block-v${version}.tbz";
+    sha256 = "1wp8wmixaz9i2sbvq6nkx903lbnpdgb2w404pz1wk8kcg9p3ilcc";
+  };
+
+  propagatedBuildInputs = [ cstruct lwt mirage-device ];
+
+  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..c280853488de
--- /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";
+
+  minimumOCamlVersion = "4.08";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-bootvar-xen/releases/download/v${version}/mirage-bootvar-xen-v${version}.tbz";
+    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..227e821e1924
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-channel/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, logs, lwt, mirage-flow
+, alcotest, mirage-flow-combinators
+}:
+
+buildDunePackage rec {
+  pname = "mirage-channel";
+  version = "4.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-channel/releases/download/v${version}/mirage-channel-v${version}.tbz";
+    sha256 = "0wmb2zhiyp8n78xgcspcsyd19bhcml3kyli2caw3778wc1gyvfpc";
+  };
+
+  # Make tests compatible with alcotest 1.4.0
+  postPatch = ''
+    substituteInPlace test/test_channel.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)'
+  '';
+
+  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..de8cfd311e54
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  pname = "mirage-clock";
+  version = "3.1.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.06";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-clock/releases/download/v${version}/mirage-clock-v${version}.tbz";
+    sha256 = "0cqa07aqkamw0dvis1fl46brvk81zvb92iy5076ik62gv9n5a0mn";
+  };
+
+  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/freestanding.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix
new file mode 100644
index 000000000000..ef278f1cd25b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildDunePackage
+, mirage-clock
+}:
+
+buildDunePackage {
+  pname = "mirage-clock-freestanding";
+
+  inherit (mirage-clock)
+    version
+    src
+    useDune2
+    minimumOCamlVersion
+    ;
+
+  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..355cffaaa157
--- /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 useDune2 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..986084c3f54c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage
+, lwt, mirage-device, mirage-flow
+}:
+
+buildDunePackage rec {
+  pname = "mirage-console";
+  version = "4.0.0";
+
+  minimumOCamlVersion = "4.08";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-console/releases/download/v${version}/mirage-console-v${version}.tbz";
+    sha256 = "11nwfd4kmmdzkrkhbakdi3cxhk8vi98l17960rgcf85c602gw6vp";
+  };
+
+  propagatedBuildInputs = [ lwt mirage-device 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..dea613511a29
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-console/unix.nix
@@ -0,0 +1,17 @@
+{ buildDunePackage, mirage-console, lwt, cstruct, cstruct-lwt }:
+
+buildDunePackage {
+  pname = "mirage-console-unix";
+
+  inherit (mirage-console) version src useDune2 minimumOCamlVersion;
+
+  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..f1ca1fef7028
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/default.nix
@@ -0,0 +1,39 @@
+{ lib, fetchurl, buildDunePackage, ounit, cstruct, dune-configurator, eqaf, bigarray-compat, pkg-config
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.08";
+
+  pname = "mirage-crypto";
+  version = "0.10.3";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-crypto/releases/download/v${version}/mirage-crypto-v${version}.tbz";
+    sha256 = "a27910365d59b02c3f0e8a40d93a5b81835acf832e1ffa596ee772b41e8a900b";
+  };
+
+  useDune2 = true;
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  nativeBuildInputs = [ dune-configurator pkg-config ];
+  propagatedBuildInputs = [
+    cstruct eqaf bigarray-compat
+  ] ++ 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..bcd7a1f04f25
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/ec.nix
@@ -0,0 +1,55 @@
+{ lib
+, 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 {
+  pname = "mirage-crypto-ec";
+
+  inherit (mirage-crypto)
+    minimumOCamlVersion
+    src
+    version
+    useDune2
+    ;
+
+  nativeBuildInputs = [
+    pkg-config
+    dune-configurator
+  ];
+  propagatedBuildInputs = [
+    cstruct
+    mirage-crypto
+    mirage-crypto-rng
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  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..d6c4d494510d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/pk.nix
@@ -0,0 +1,19 @@
+{ buildDunePackage, ounit, randomconv, mirage-crypto, mirage-crypto-rng
+, cstruct, sexplib, ppx_sexp_conv, zarith, eqaf, rresult, gmp }:
+
+buildDunePackage {
+  pname = "mirage-crypto-pk";
+
+  inherit (mirage-crypto) version src useDune2 minimumOCamlVersion;
+
+  buildInputs = [ gmp ];
+  propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng
+                            zarith eqaf rresult sexplib ppx_sexp_conv ];
+
+  doCheck = true;
+  checkInputs = [ ounit 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..e8c8dd06eab5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage
+, mirage-crypto, mirage-crypto-rng
+, dune-configurator, async, logs
+}:
+
+buildDunePackage {
+  pname = "mirage-crypto-rng-async";
+
+  inherit (mirage-crypto) useDune2 version minimumOCamlVersion src;
+
+  nativeBuildInputs = [
+    dune-configurator
+  ];
+
+  propagatedBuildInputs = [
+    async
+    logs
+    mirage-crypto
+    mirage-crypto-rng
+  ];
+
+  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-mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix
new file mode 100644
index 000000000000..5152d3c8ecde
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage, mirage-crypto-rng, duration, cstruct, mirage-runtime
+, mirage-time, mirage-clock, mirage-unix, mirage-time-unix, mirage-clock-unix
+, logs, lwt
+}:
+
+buildDunePackage {
+  pname = "mirage-crypto-rng-mirage";
+
+  inherit (mirage-crypto-rng) version src useDune2 minimumOCamlVersion;
+
+  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..b4da06816351
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-crypto/rng.nix
@@ -0,0 +1,18 @@
+{ buildDunePackage, mirage-crypto, ounit, randomconv, dune-configurator
+, cstruct, duration, logs, mtime, ocaml_lwt }:
+
+buildDunePackage {
+  pname = "mirage-crypto-rng";
+
+  inherit (mirage-crypto) version src useDune2 minimumOCamlVersion;
+
+  doCheck = true;
+  checkInputs = [ ounit randomconv ];
+
+  nativeBuildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ cstruct mirage-crypto duration logs mtime ocaml_lwt ];
+
+  meta = mirage-crypto.meta // {
+    description = "A 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..d4904e77430a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/combinators.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, mirage-flow, fmt, ocaml_lwt, logs, cstruct, mirage-clock }:
+
+buildDunePackage {
+  pname = "mirage-flow-combinators";
+
+  inherit (mirage-flow) version useDune2 src;
+
+  propagatedBuildInputs = [ ocaml_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..d6ba6603596a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, cstruct, fmt, ocaml_lwt }:
+
+buildDunePackage rec {
+  pname = "mirage-flow";
+  version = "2.0.1";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-flow/releases/download/v${version}/mirage-flow-v${version}.tbz";
+    sha256 = "13v05x34six0z6bc2is8qhvbxk4knxh80ardi5x4rl738vlq3mn9";
+  };
+
+  propagatedBuildInputs = [ cstruct fmt ocaml_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..0bd3e42ad37a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-flow/unix.nix
@@ -0,0 +1,22 @@
+{ buildDunePackage, fmt, logs, mirage-flow, ocaml_lwt, cstruct
+, alcotest, mirage-flow-combinators }:
+
+buildDunePackage {
+  pname = "mirage-flow-unix";
+
+  inherit (mirage-flow) version useDune2 src;
+
+  # 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-fs/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-fs/default.nix
new file mode 100644
index 000000000000..d8cfddff313c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-fs/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, fmt, lwt, mirage-device, mirage-kv
+}:
+
+buildDunePackage rec {
+  pname = "mirage-fs";
+  version = "3.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-fs/releases/download/v${version}/mirage-fs-v${version}.tbz";
+    sha256 = "0px18bgk528vr7iw78r0j3z4sdcz684sfcj47ibbly2adbvd64yk";
+  };
+
+  propagatedBuildInputs = [ cstruct fmt lwt mirage-device mirage-kv ];
+
+  meta = {
+    description = "MirageOS signatures for filesystem devices";
+    homepage = "https://github.com/mirage/mirage-fs";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..20d83e166418
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-kv/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, fmt, mirage-device
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "mirage-kv";
+  version = "3.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-kv/releases/download/v${version}/mirage-kv-v${version}.tbz";
+    sha256 = "1n736sjvdd8rkbc2b5jm9sn0w6hvhjycma5328r0l03v24vk5cki";
+  };
+
+  propagatedBuildInputs = [ fmt mirage-device ];
+
+  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..2a7670ce3722
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-logs/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, logs, lwt, mirage-clock, mirage-profile, ptime
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "mirage-logs";
+  version = "1.2.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-logs/releases/download/v${version}/mirage-logs-v${version}.tbz";
+    sha256 = "0h0amzjxy067jljscib7fvw5q8k0adqa8m86affha9hq5jsh07a1";
+  };
+
+  propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime ];
+
+  doCheck = true;
+  checkInputs = [ alcotest ];
+
+  meta = {
+    description = "A 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..b04c0bb4a7c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-nat/default.nix
@@ -0,0 +1,51 @@
+{ lib, buildDunePackage, fetchurl
+, ipaddr, cstruct, lwt, rresult, logs, lru
+, tcpip, ethernet, stdlib-shims
+, alcotest, mirage-clock-unix
+, ppxlib, ppx_deriving
+}:
+
+buildDunePackage rec {
+  pname = "mirage-nat";
+  version = "2.2.3";
+
+  minimumOCamlVersion = "4.06";
+
+  # due to cstruct
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0cy95j184hi8fm1h6z6x1brjfrmbq3zjy2mqz99m8ys9vwkb63ma";
+  };
+
+  buildInputs = [
+    ppxlib
+  ];
+
+  propagatedBuildInputs = [
+    ipaddr
+    cstruct
+    lwt
+    rresult
+    logs
+    lru
+    tcpip
+    ethernet
+    stdlib-shims
+    ppx_deriving
+  ];
+
+  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..0d7a7e53fb1a
--- /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
+    useDune2
+    minimumOCamlVersion
+    meta
+    ;
+
+  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..a29727d7ee17
--- /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 = "3.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-net/releases/download/v${version}/mirage-net-v${version}.tbz";
+    sha256 = "0yfvl0fgs7xy5i7kkparaa7a315a2h7kb1z24fmmnwnyaji57dg3";
+  };
+
+  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..c6ca730bf3c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-profile/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_cstruct
+, cstruct, lwt
+}:
+
+buildDunePackage rec {
+  pname = "mirage-profile";
+  version = "0.9.1";
+
+  useDune2 = true;
+
+  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 ];
+
+  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..9f144bd2d7ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-protocols/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, duration, ipaddr, mirage-device, mirage-flow }:
+
+buildDunePackage rec {
+  pname = "mirage-protocols";
+  version = "5.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-protocols/releases/download/v${version}/mirage-protocols-v${version}.tbz";
+    sha256 = "1bd6zgxhq2qliyzzarfvaj3ksr20ryghxq6h24i2hha7rwim63bk";
+  };
+
+  propagatedBuildInputs = [ duration ipaddr mirage-device mirage-flow ];
+
+  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..81d75db77251
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-random-test/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, mirage-random
+}:
+
+buildDunePackage rec {
+  pname = "mirage-random-test";
+  version = "0.1.0";
+
+  minimumOCamlVersion = "4.06";
+
+  # due to cstruct
+  useDune2 = true;
+
+  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..defde0ba89fb
--- /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 = "2.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-random/releases/download/v${version}/mirage-random-v${version}.tbz";
+    sha256 = "0qj41d5smkkkbjwsnz71bhhj94d2cwv53rf3j4rhky0pqbkidnv1";
+  };
+
+  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-stack/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage-stack/default.nix
new file mode 100644
index 000000000000..dbcba59c4790
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-stack/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchurl, mirage-protocols }:
+
+buildDunePackage rec {
+  pname = "mirage-stack";
+  version = "2.2.0";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-stack/releases/download/v${version}/mirage-stack-v${version}.tbz";
+    sha256 = "1qhi0ghcj4j3hw7yqn085ac6n18b6b66z5ih3k8p79m4cvn7cdq0";
+  };
+
+  propagatedBuildInputs = [ mirage-protocols ];
+
+  meta = {
+    description = "MirageOS signatures for network stacks";
+    homepage = "https://github.com/mirage/mirage-stack";
+    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..2e91bda61d6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, ocaml_lwt }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.06";
+
+  pname = "mirage-time";
+  version = "2.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-time/releases/download/v${version}/mirage-time-v${version}.tbz";
+    sha256 = "1w6mm4g7fc19cs0ncs0s9fsnb1k1s04qqzs9bsqvq8ngsb90cbh0";
+  };
+
+  propagatedBuildInputs = [ ocaml_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..c19ca30fe024
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-time/unix.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, fetchurl, mirage-time, ocaml_lwt, duration }:
+
+buildDunePackage {
+  pname = "mirage-time-unix";
+
+  inherit (mirage-time) src useDune2 version minimumOCamlVersion;
+
+  propagatedBuildInputs = [ mirage-time ocaml_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..1e6dc0ef144f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-unix/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, ocaml_lwt, duration, mirage-runtime, io-page-unix }:
+
+buildDunePackage rec {
+  pname = "mirage-unix";
+  version = "4.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0kyd83bkpjhn382b4mw3a4325xr8vms78znxqvifpcyfvfnlx7hj";
+  };
+
+  propagatedBuildInputs = [ ocaml_lwt duration mirage-runtime io-page-unix ];
+  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..876bc1a98177
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-vnetif/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildDunePackage, fetchurl
+, lwt, mirage-time, mirage-clock, mirage-net
+, cstruct, ipaddr, macaddr, mirage-profile
+, duration, logs
+}:
+
+buildDunePackage rec {
+  pname = "mirage-vnetif";
+  version = "0.5.0";
+
+  minimumOCamlVersion = "4.06";
+
+  # due to cstruct
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0cpqwf51v2cpz41dfqxabf3bsabwyl6a0h0v2ncrn33q58i60m5q";
+  };
+
+  propagatedBuildInputs = [
+    lwt
+    mirage-net
+    mirage-time
+    mirage-clock
+    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..0d53d0f9c3b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/default.nix
@@ -0,0 +1,78 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, pkg-config
+, cstruct
+, lwt
+, shared-memory-ring-lwt
+, xenstore
+, lwt-dllist
+, mirage-profile
+, mirage-runtime
+, logs
+, fmt
+, ocaml-freestanding
+, bheap
+, duration
+, io-page
+}:
+
+buildDunePackage rec {
+  pname = "mirage-xen";
+  version = "6.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-xen/releases/download/v${version}/mirage-xen-v${version}.tbz";
+    sha256 = "f991e972059b27993c287ad010d9281fee061efaa1dd475d0955179f93710fbd";
+  };
+
+  patches = [
+    ./makefile-no-opam.patch
+    ./pkg-config.patch
+  ];
+
+  # can't handle OCAMLFIND_DESTDIR with substituteAll
+  postPatch = ''
+    substituteInPlace lib/bindings/mirage-xen.pc \
+      --replace "@out@" "$out" \
+      --replace "@OCAMLFIND_DESTDIR@" "$OCAMLFIND_DESTDIR"
+  '';
+
+  minimumOCamlVersion = "4.08";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+    lwt
+    shared-memory-ring-lwt
+    xenstore
+    lwt-dllist
+    mirage-profile
+    mirage-runtime
+    io-page
+    logs
+    fmt
+    bheap
+    duration
+    (ocaml-freestanding.override { target = "xen"; })
+  ];
+
+  # Move pkg-config files into their well-known location.
+  # This saves us an extra setup hook and causes no issues
+  # since we patch all relative paths out of the .pc file.
+  postInstall = ''
+    mv $OCAMLFIND_DESTDIR/pkgconfig $out/lib/pkgconfig
+  '';
+
+  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-xen/makefile-no-opam.patch b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch
new file mode 100644
index 000000000000..905e6efc3f4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch
@@ -0,0 +1,12 @@
+diff --git a/lib/bindings/Makefile b/lib/bindings/Makefile
+index 4e413c0..67c7bdc 100644
+--- a/lib/bindings/Makefile
++++ b/lib/bindings/Makefile
+@@ -1,4 +1,6 @@
+-PKG_CONFIG_PATH := $(shell opam config var prefix)/lib/pkgconfig
++ifneq (, $(shell command -v opam))
++	PKG_CONFIG_PATH ?= $(shell opam config var prefix)/lib/pkgconfig
++endif
+ 
+ CC ?= cc
+ FREESTANDING_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags ocaml-freestanding)
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch
new file mode 100644
index 000000000000..19205cf7ee4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/bindings/mirage-xen.pc b/lib/bindings/mirage-xen.pc
+index a03a217..8499aa4 100644
+--- a/lib/bindings/mirage-xen.pc
++++ b/lib/bindings/mirage-xen.pc
+@@ -1,6 +1,6 @@
+-prefix=${pcfiledir}/../..
++prefix=@out@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=@OCAMLFIND_DESTDIR@
+ 
+ Name: mirage-xen
+ Version: 6.0.0
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..6b8bcb1fbe94
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildDunePackage, ocaml, alcotest
+, functoria, mirage-runtime, bos
+, ipaddr, astring, logs, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "mirage";
+  inherit (mirage-runtime) version src;
+
+  minimumOCamlVersion = "4.08";
+
+  useDune2 = true;
+
+  outputs = [ "out" "dev" ];
+
+  propagatedBuildInputs = [
+    ipaddr
+    functoria
+    mirage-runtime
+    bos
+    astring
+    logs
+    stdlib-shims
+  ];
+
+  doCheck = true;
+  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 = "The 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..4a876658d181
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/runtime.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, ipaddr, functoria-runtime
+, fmt, logs, ocaml_lwt, alcotest }:
+
+buildDunePackage rec {
+  pname = "mirage-runtime";
+  version = "3.10.4";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage/releases/download/v${version}/mirage-v${version}.tbz";
+    sha256 = "c2ea22b6faf16bed783cac0e0bafd87f321756a91798f56c9a930f0edb5d9116";
+  };
+
+  propagatedBuildInputs = [ ipaddr functoria-runtime fmt logs ocaml_lwt ];
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mirage/mirage";
+    description = "The base MirageOS runtime library, part of every MirageOS unikernel";
+    license = licenses.isc;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage/types-lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage/types-lwt.nix
new file mode 100644
index 000000000000..ac232b0be6e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/types-lwt.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, mirage-types
+}:
+
+buildDunePackage {
+  pname = "mirage-types-lwt";
+  inherit (mirage-types) version src useDune2;
+
+  propagatedBuildInputs = [ mirage-types ];
+
+  meta = mirage-types.meta // {
+    description = "Lwt module type definitions for MirageOS applications";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/mirage/types.nix b/nixpkgs/pkgs/development/ocaml-modules/mirage/types.nix
new file mode 100644
index 000000000000..f30a9e263bbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mirage/types.nix
@@ -0,0 +1,19 @@
+{ lib, buildDunePackage, mirage
+, mirage-block, mirage-channel, mirage-clock, mirage-console, mirage-device
+, mirage-flow, mirage-fs, mirage-kv, mirage-net, mirage-protocols, mirage-random
+, mirage-stack, mirage-time
+}:
+
+buildDunePackage {
+  pname = "mirage-types";
+  inherit (mirage) src version useDune2;
+
+  propagatedBuildInputs = [ mirage-block mirage-channel mirage-clock
+    mirage-console mirage-device mirage-flow mirage-fs mirage-kv mirage-net
+    mirage-protocols mirage-random mirage-stack mirage-time
+  ];
+
+  meta = mirage.meta // {
+    description = "Module type definitions for MirageOS applications";
+  };
+}
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/mlgmp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mlgmp/default.nix
new file mode 100644
index 000000000000..ffd78150689a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mlgmp/default.nix
@@ -0,0 +1,39 @@
+{stdenv, lib, fetchurl, ocaml, findlib, gmp, mpfr, ncurses }:
+
+if lib.versionAtLeast ocaml.version "4.03"
+then throw "mlgmp is not available for OCaml ${ocaml.version}" else
+
+let
+  pname = "mlgmp";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "20120224";
+
+  src = fetchurl {
+    url = "http://www-verimag.imag.fr/~monniaux/download/${pname}_${version}.tar.gz";
+    sha256 = "3ce1a53fa452ff5a9ba618864d3bc46ef32190b57202d1e996ca7df837ad4f24";
+  };
+
+  makeFlags = [
+    "DESTDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/gmp"
+  ];
+
+  preConfigure = "make clean";
+  buildInputs = [ocaml findlib gmp mpfr ncurses];
+
+  createFindlibDestdir = true;
+
+  propagatedbuildInputs = [gmp mpfr ncurses];
+
+  postInstall  = ''
+     cp ${./META} $out/lib/ocaml/${ocaml.version}/site-lib/gmp/META
+  '';
+
+  meta = {
+    homepage = "http://opam.ocamlpro.com/pkg/mlgmp.20120224.html";
+    description = "OCaml bindings to GNU MP library";
+    license = "Free software ?";
+  };
+}
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..a0026e3a8ca8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mlgmpidl/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, perl, ocaml, findlib, camlidl, gmp, mpfr }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-mlgmpidl-${version}";
+  version = "1.2.12";
+  src = fetchFromGitHub {
+    owner = "nberth";
+    repo = "mlgmpidl";
+    rev = version;
+    sha256 = "17xqiclaqs4hmnb92p9z6z9a1xfr31vcn8nlnj8ykk57by31vfza";
+  };
+
+  buildInputs = [ perl gmp mpfr ocaml findlib camlidl ];
+
+  prefixKey = "-prefix ";
+  configureFlags = [
+    "--gmp-prefix ${gmp.dev}"
+    "--mpfr-prefix ${mpfr.dev}"
+  ];
+
+  postConfigure = ''
+    sed -i Makefile \
+      -e 's|^	/bin/rm |	rm |'
+    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/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/mparser/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mparser/default.nix
new file mode 100644
index 000000000000..5f63a98a1309
--- /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 = "A 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..0f26e140ed87
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mparser/pcre.nix
@@ -0,0 +1,12 @@
+{ fetchFromGitHub, 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/mtime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix
new file mode 100644
index 000000000000..9fa302947e92
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, js_of_ocaml
+, jsooSupport ? lib.versionAtLeast ocaml.version "4.03"
+}:
+
+with lib;
+
+let param =
+  if versionAtLeast ocaml.version "4.03"
+  then {
+    version = "1.2.0";
+    sha256 = "0zm1jvqkz3ghznfsm3bbv9q2zinp9grggdf7k9phjazjvny68xb8";
+  } else {
+    version = "0.8.4";
+    sha256 = "1adm8sc3lkjly99hyi5gqnxas748k7h62ljgn8x423nkn8gyp8dh";
+  };
+in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-mtime-${param.version}";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/mtime/releases/mtime-${param.version}.tbz";
+    inherit (param) sha256;
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg ]
+  ++ optional jsooSupport js_of_ocaml;
+
+  buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}";
+
+  inherit (topkg) installPhase;
+
+  meta = {
+    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/mustache/default.nix b/nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix
new file mode 100644
index 000000000000..b16dfd484814
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mustache/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, ezjsonm, menhir, menhirLib, ounit }:
+
+buildDunePackage rec {
+  pname = "mustache";
+  version = "3.1.0";
+  useDune2 = true;
+  src = fetchFromGitHub {
+    owner = "rgrinberg";
+    repo = "ocaml-mustache";
+    rev = "v${version}";
+    sha256 = "19v8rk8d8lkfm2rmhdawfgadji6wa267ir5dprh4w9l1sfj8a1py";
+  };
+
+  buildInputs = [ ezjsonm menhir ];
+  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..6ccdfa9cf81c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/mysql/default.nix
@@ -0,0 +1,44 @@
+{ 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"
+  ];
+
+  buildInputs = [ ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  propagatedBuildInputs = [ libmysqlclient ];
+
+  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..e7b021d6fbe9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/netchannel/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppx_sexp_conv
+, ppx_cstruct
+, lwt
+, mirage-net
+, io-page
+, mirage-xen
+, ipaddr
+, mirage-profile
+, shared-memory-ring
+, sexplib
+, logs
+, rresult
+}:
+
+buildDunePackage rec {
+  pname = "netchannel";
+  version = "2.0.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-net-xen/releases/download/v${version}/mirage-net-xen-v${version}.tbz";
+    sha256 = "ec3906ef1804ef6a9e36b91f4ae73ce4849e9e0d1d36a80fe66b5f905fab93ad";
+  };
+
+  nativeBuildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    ppx_sexp_conv
+    lwt
+    mirage-net
+    io-page
+    mirage-xen
+    ipaddr
+    mirage-profile
+    shared-memory-ring
+    sexplib
+    logs
+    rresult
+  ];
+
+  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/nocrypto/default.nix b/nixpkgs/pkgs/development/ocaml-modules/nocrypto/default.nix
new file mode 100644
index 000000000000..055e6db3a645
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/nocrypto/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, topkg
+, cpuid, ocb-stubblr, sexplib
+, cstruct, zarith, ppx_sexp_conv, ppx_deriving, writeScriptBin
+, cstruct-lwt ? null
+}:
+
+with lib;
+let
+  withLwt = cstruct-lwt != null;
+  # the build system will call 'cc' with no way to override
+  # this is wrong when we're cross-compiling, so insert a wrapper
+  cc-wrapper = writeScriptBin "cc" ''
+    set -e
+    $CC "$@"
+  '';
+in
+
+if !versionAtLeast ocaml.version "4.08"
+then throw "nocrypto is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-nocrypto-${version}";
+  version = "0.5.4";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-nocrypto/releases/download/v${version}/nocrypto-${version}.tbz";
+    sha256 = "0zshi9hlhcz61n5z1k6fx6rsi0pl4xgahsyl2jp0crqkaf3hqwlg";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0001-add-missing-runtime-dependencies-in-_tags.patch";
+      sha256 = "1asybwj3rl07b4q4cxwy80a7j17j0i5vzz77p38hymilhc2ky7xn";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch";
+      sha256 = "0zmp64n5fgkawpkyw0vv0bg0i2c3xbsxqy17vwy92nf5rbardi1r";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch";
+      sha256 = "0lngbg5gyd5gs56lbjh6g86cps1y8x1xsqzi0vi1v28al1gn5dhw";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0004-pack-package-workaround-ocamlbuild-272.patch";
+      sha256 = "16k0w78plvqhl17qiqq1mckxhhcdysqgs94l54a1bn0l6fx3rvb9";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0005-use-modern-cstruct-findlib.patch";
+      sha256 = "021k38zbdidw6g7j4vjxlnbsrnzq07bnavxzdjq23nbwlifs2nq9";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0006-explicit-dependency-on-sexplib.patch";
+      sha256 = "15kd0qgi96yxr3qkmaqny591l0s6qmwpprxd5xdx9qwv72hq813z";
+    })
+  ];
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild cc-wrapper ];
+  buildInputs = [ ocamlbuild findlib topkg cpuid ocb-stubblr ];
+  propagatedBuildInputs = [ cstruct ppx_deriving ppx_sexp_conv sexplib zarith ] ++ optional withLwt cstruct-lwt;
+
+  buildPhase = "${topkg.buildPhase} --accelerate false --with-lwt ${boolToString withLwt}";
+  inherit (topkg) installPhase;
+
+  meta = {
+    homepage = "https://github.com/mirleft/ocaml-nocrypto";
+    description = "Simplest possible crypto to support TLS";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/noise/default.nix b/nixpkgs/pkgs/development/ocaml-modules/noise/default.nix
new file mode 100644
index 000000000000..59ca274c88dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/noise/default.nix
@@ -0,0 +1,60 @@
+{ lib
+, buildDunePackage
+, fetchurl
+
+, callipyge
+, chacha
+, digestif
+, hex
+, lwt
+, lwt_ppx
+, nocrypto
+, ounit
+, ppxlib
+, ppx_let
+, ppx_deriving
+, ppx_deriving_yojson
+}:
+
+buildDunePackage rec {
+  pname = "noise";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/emillon/ocaml-noise/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "sha256-fe3pT7fsuF2hCvXpInsRg6OvARs/eAh1Un454s1osDs=";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  nativeBuildInputs = [
+    ppxlib
+    ppx_deriving
+    ppx_let
+  ];
+
+  propagatedBuildInputs = [
+    callipyge
+    chacha
+    digestif
+    hex
+    nocrypto
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt
+    lwt_ppx
+    ounit
+    ppx_deriving_yojson
+  ];
+
+  meta = {
+    homepage = "https://github.com/emillon/ocaml-noise";
+    description = "OCaml implementation of the Noise Protocol Framework";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ fufexan ];
+  };
+}
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..a584f7bc9ed1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/nonstd/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchzip, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "nonstd";
+  version = "0.0.3";
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchzip {
+    url = "https://bitbucket.org/smondet/${pname}/get/${pname}.${version}.tar.gz";
+    sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46";
+  };
+
+  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/notty/default.nix b/nixpkgs/pkgs/development/ocaml-modules/notty/default.nix
new file mode 100644
index 000000000000..8e1c5f38cb5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/notty/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr
+, result, uucp, uuseg, uutf
+, lwt     ? null }:
+
+with lib;
+
+if !versionAtLeast ocaml.version "4.05"
+then throw "notty is not available for OCaml ${ocaml.version}"
+else
+
+let withLwt = lwt != null; in
+
+stdenv.mkDerivation rec {
+  version = "0.2.2";
+  name = "ocaml${ocaml.version}-notty-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
+    sha256 = "1y3hx8zjri3x50nyiqal5gak1sw54gw3xssrqbj7srinvkdmrz1q";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ocb-stubblr ];
+  propagatedBuildInputs = [ result uucp uuseg uutf ] ++
+                          optional withLwt lwt;
+
+  buildPhase = topkg.buildPhase
+  + " --with-lwt ${boolToString withLwt}";
+
+  inherit (topkg) installPhase;
+
+  meta = {
+    homepage = "https://github.com/pqwy/notty";
+    inherit (ocaml.meta) platforms;
+    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..5ba6cb08cc66
--- /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";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "LaurentMazare";
+    repo   = "${pname}-ocaml";
+    rev    = version;
+    sha256 = "1fryglkm20h6kdqjl55b7065b34bdg3g3p6j0jv33zvd1m5888m1";
+  };
+
+  propagatedBuildInputs = [ camlzip ];
+  checkInputs = [ 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..e2c7b439c69e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/num/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, withStatic ? false }:
+
+stdenv.mkDerivation rec {
+  version = "1.1";
+  name = "ocaml${ocaml.version}-num-${version}";
+  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 ];
+  buildInputs = [ ocaml findlib ];
+
+  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;
+  };
+}
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..7d2960fc5a66
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-cairo/default.nix
@@ -0,0 +1,49 @@
+{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 ];
+
+  nativeBuildInputs = [ pkg-config unzip ];
+  buildInputs = [ ocaml automake gnum4 autoconf
+                  findlib 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;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..cf72397057db
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix
@@ -0,0 +1,87 @@
+{ 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.4";
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0w3x2wfd04qr6mci4cp1gfqw33yysp8gamgkpgbgwslr0skryiq5";
+  };
+
+  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
+  ];
+
+  nativeBuildInputs = [
+    ocaml
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [ solo5 ];
+
+  configurePhase = ''
+    runHook preConfigure
+    env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh
+    runHook postConfigure
+  '';
+
+  preBuild = ''
+    # perform substitutions, so opam isn't needed
+    for flags in flags/cflags.tmp flags/libs.tmp; do
+      substitute "$flags.in" "$flags" \
+        --replace "%{prefix}%" "$out" \
+        --replace "%{ocaml-freestanding:lib}%" "$out/lib"
+    done
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    ./install.sh "$out"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Freestanding OCaml runtime";
+    license = licenses.mit;
+    maintainers = [ maintainers.sternenseemann ];
+    homepage = "https://github.com/mirage/ocaml-freestanding";
+    platforms = builtins.map ({ arch, os }: "${arch}-${os}")
+      (cartesianProductOfSets {
+          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..43141b1472a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch
@@ -0,0 +1,84 @@
+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/Makefile b/Makefile
+index b07b8c6..a68b31d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,6 +2,12 @@
+ 
+ include Makeconf
+ 
++ifneq ($(shell command -v opam),)
++	# only set if opam is available and PKG_CONFIG_PATH isn't
++	# already set in the environment or on the command line
++	PKG_CONFIG_PATH ?= $(shell opam config var prefix)/lib/pkgconfig
++endif
++
+ FREESTANDING_LIBS=openlibm/libopenlibm.a \
+ 		  ocaml/runtime/libasmrun.a \
+ 		  nolibc/libnolibc.a
+@@ -73,8 +79,7 @@ flags/libs.tmp: flags/libs.tmp.in
+ 	opam config subst $@
+ 
+ flags/libs: flags/libs.tmp Makeconf
+-	env PKG_CONFIG_PATH="$(shell opam config var prefix)/lib/pkgconfig" \
+-	    pkg-config $(PKG_CONFIG_DEPS) --libs >> $<
++	pkg-config $(PKG_CONFIG_DEPS) --libs >> $<
+ 	awk -v RS= -- '{ \
+ 	    sub("@@PKG_CONFIG_EXTRA_LIBS@@", "$(PKG_CONFIG_EXTRA_LIBS)", $$0); \
+ 	    print "(", $$0, ")" \
+@@ -84,8 +89,7 @@ flags/cflags.tmp: flags/cflags.tmp.in
+ 	opam config subst $@
+ 
+ flags/cflags: flags/cflags.tmp Makeconf
+-	env PKG_CONFIG_PATH="$(shell opam config var prefix)/lib/pkgconfig" \
+-	    pkg-config $(PKG_CONFIG_DEPS) --cflags >> $<
++	pkg-config $(PKG_CONFIG_DEPS) --cflags >> $<
+ 	awk -v RS= -- '{ \
+ 	    print "(", $$0, ")" \
+ 	    }' $< >$@
+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..012f3b61ff32
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, ocaml_gettext, camomile, ounit, fileutils }:
+
+buildDunePackage {
+  pname = "gettext-camomile";
+  inherit (ocaml_gettext) src version useDune2;
+
+  propagatedBuildInputs = [ camomile ocaml_gettext ];
+
+  doCheck = true;
+  checkInputs = [ ounit fileutils ];
+
+  meta = ocaml_gettext.meta // {
+    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..7525a10030eb
--- /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";
+
+  minimumOCamlVersion = "4.03";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ocaml-gettext/releases/download/v${version}/gettext-v${version}.tbz";
+    sha256 = "19ynsldb21r539fiwz1f43apsdnx7hj2a2d9qr9wg2hva9y2qrwb";
+  };
+
+  buildInputs = [ cppo ];
+
+  propagatedBuildInputs = [ gettext fileutils ];
+
+  doCheck = true;
+
+  checkInputs = [ ounit ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "OCaml Bindings to gettext";
+    homepage = "https://github.com/gildor478/ocaml-gettext";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.volth ];
+  };
+}
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..51e902b91408
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix
@@ -0,0 +1,16 @@
+{ buildDunePackage, ocaml_gettext, dune-configurator, ounit }:
+
+buildDunePackage rec {
+
+  pname = "gettext-stub";
+
+  inherit (ocaml_gettext) src version useDune2 meta;
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ ocaml_gettext ];
+
+  doCheck = true;
+
+  checkInputs = [ ounit ];
+}
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..63056481199f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitLab, libvirt, autoreconfHook, pkg-config, ocaml, findlib, perl }:
+
+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 ];
+
+  buildInputs = [ ocaml ];
+
+  createFindlibDestdir = true;
+
+  buildPhase = "make all opt CPPFLAGS=-Wno-error";
+
+  installPhase = "make install-opt";
+
+  meta = with lib; {
+    description = "OCaml bindings for libvirt";
+    homepage = "https://libvirt.org/ocaml/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.volth ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..13ae64292ec7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/default.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, jsonrpc, lsp, re, makeWrapper, dot-merlin-reader }:
+
+buildDunePackage {
+  pname = "ocaml-lsp-server";
+  inherit (jsonrpc) version src;
+  useDune2 = true;
+
+  inherit (lsp) preBuild;
+
+  buildInputs = lsp.buildInputs ++ [ lsp re ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin
+  '';
+
+  meta = jsonrpc.meta // {
+    description = "OCaml Language Server Protocol implementation";
+  };
+}
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..a6867aac63ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix
@@ -0,0 +1,52 @@
+{ buildDunePackage
+, stdlib-shims
+, ppx_yojson_conv_lib
+, ocaml-syntax-shims
+, yojson
+, result
+, fetchurl
+, lib
+, ocaml
+}:
+
+let params =
+  if lib.versionAtLeast ocaml.version "4.12"
+  then {
+    version = "1.7.0";
+    sha256 = "1va2zj41znsr94bdw485vak96zrcvqwcrqf1sy8zipb6hdhbchya";
+  } else {
+    version = "1.4.1";
+    sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f";
+  }
+; in
+
+buildDunePackage rec {
+  pname = "jsonrpc";
+  inherit (params) version;
+  src = fetchurl {
+    url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz";
+    inherit (params) sha256;
+  };
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.06";
+
+  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; [ symphorien marsam ];
+  };
+}
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..869e9f633540
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix
@@ -0,0 +1,58 @@
+{ buildDunePackage
+, lib
+, cppo
+, stdlib-shims
+, ppx_yojson_conv_lib
+, ocaml-syntax-shims
+, jsonrpc
+, omd
+, octavius
+, dune-build-info
+, uutf
+, re
+, pp
+, csexp
+, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "lsp";
+  inherit (jsonrpc) version src;
+  useDune2 = true;
+  minimumOCamlVersion =
+    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 = ''
+    rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner}
+  '';
+
+  buildInputs =
+    if lib.versionAtLeast version "1.7.0" then
+      [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ]
+    else
+      [ cppo
+        ppx_yojson_conv_lib
+        ocaml-syntax-shims
+        octavius
+        dune-build-info
+        omd
+        cmdliner
+      ];
+
+  propagatedBuildInputs = [
+    csexp
+    jsonrpc
+    uutf
+  ] ++ lib.optional (lib.versionOlder version "1.7.0") stdlib-shims;
+
+  meta = jsonrpc.meta // {
+    description = "LSP protocol implementation in OCaml";
+  };
+}
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..5d8d967bf4fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, result, ppx_derivers }:
+
+buildDunePackage rec {
+   pname = "ocaml-migrate-parsetree";
+   version = "1.8.0";
+
+   useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+   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..dab537df2219
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+   pname = "ocaml-migrate-parsetree";
+   version = "2.2.0";
+
+   useDune2 = true;
+
+   minimalOCamlVersion = "4.02";
+
+   src = fetchurl {
+     url = "https://github.com/ocaml-ppx/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+     sha256 = "188v3z09bg4gyv80c138fa3a3j2w54w5gc4r1ajw7klr70yqz9mj";
+   };
+
+   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..9a6dd1f7cb66
--- /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";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "zepalmer";
+    repo = pname;
+    rev = version;
+    sha256 = "1ynv3yhdqmkhkgnz6c5kv6ryjcc934sdvw9rhh8rjg2dlzlffgbw";
+  };
+
+  buildInputs = [ ppxlib ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "A 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/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix
new file mode 100644
index 000000000000..5abb026032be
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-protoc/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-protoc";
+  version = "2.0.2";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchFromGitHub {
+    owner = "mransan";
+    repo = "ocaml-protoc";
+    rev = version;
+    sha256 = "1vlnjqqpypmjhlyrxfzla79y4ilmc9ggz311giy6vmh4cyzl29h3";
+  };
+
+  buildInputs = [ stdlib-shims ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mransan/ocaml-protoc";
+    description = "A Protobuf Compiler for OCaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
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..d76a98fc05c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-r/default.nix
@@ -0,0 +1,42 @@
+{ lib, fetchFromGitHub, buildDunePackage, pkg-config, dune-configurator, stdio, R
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "ocaml-r";
+  version = "0.4.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "pveber";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "10is2s148kfh3g0pwniyzp5mh48k57ldvn8gm86469zvgxyij1ri";
+  };
+
+  # Without the following patch, stub generation fails with:
+  # > Fatal error: exception (Failure "not supported: osVersion")
+  preConfigure = ''
+    substituteInPlace stubgen/stubgen.ml --replace  \
+    'failwithf "not supported: %s" name ()' \
+    'sprintf "(* not supported: %s *)" name'
+    substituteInPlace lib/config/discover.ml --replace \
+    ' libRmath"' '"'
+  '';
+
+  buildInputs = [ pkg-config R dune-configurator stdio ];
+
+  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..2fda6f1440be
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-result/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchurl, ocaml }:
+
+buildDunePackage rec {
+  pname = "result";
+  version = "1.5";
+
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  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..374efd8b2b97
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix
@@ -0,0 +1,24 @@
+{ 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";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocaml-text/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocaml-text/default.nix
new file mode 100644
index 000000000000..e5dc3dd54d34
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-text/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchzip, libiconv, ocaml, findlib, ocamlbuild, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml-text";
+  version = "0.8";
+
+  src = fetchzip {
+    url = "https://github.com/vbmithr/ocaml-text/archive/${version}.tar.gz";
+    sha256 = "11jamdfn5s19a0yvl012q1xvdk1grkp4rkrn819imqrvdplqkn1y";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ncurses libiconv ];
+
+  configurePhase = "iconv_prefix=${libiconv} ocaml setup.ml -configure";
+
+  createFindlibDestdir = true;
+
+
+  meta = {
+    homepage = "http://ocaml-text.forge.ocamlcore.org/";
+    description = "A library for convenient text manipulation";
+    license = lib.licenses.bsd3;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..a8912c0f5d58
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocaml-version/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "ocaml-version";
+  version = "3.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/ocurrent/ocaml-version/releases/download/v${version}/ocaml-version-v${version}.tbz";
+    sha256 = "sha256-rHuhagnY9yISdC85NpgPv667aYx7v2JRgq99ayw83l8=";
+  };
+
+  minimumOCamlVersion = "4.07";
+  useDune2 = true;
+
+  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/ocamlfuse/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix
new file mode 100644
index 000000000000..c2ca6a2cc8aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlfuse/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub, camlidl, fuse }:
+
+buildDunePackage {
+  pname = "ocamlfuse";
+  version = "2.7.1_cvs6_e35e76b";
+
+  src = fetchFromGitHub {
+    owner = "astrada";
+    repo = "ocamlfuse";
+    rev = "e35e76bee3b06806256b5bfca108b7697267cd5c";
+    sha256 = "1v9g0wh7rnjkrjrnw50145g6ry38plyjs8fq8w0nlzwizhf3qhff";
+  };
+
+  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..a7815d951cd3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlgraph/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, stdlib-shims }:
+
+buildDunePackage rec {
+  pname = "ocamlgraph";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/backtracking/ocamlgraph/releases/download/${version}/ocamlgraph-${version}.tbz";
+    sha256 = "029692bvdz3hxpva9a2jg5w5381fkcw55ysdi8424lyyjxvjdzi0";
+  };
+
+  minimalOCamlVersion = "4.03";
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  meta = with lib; {
+      homepage = "http://ocamlgraph.lri.fr/";
+      downloadPage = "https://github.com/backtracking/ocamlgraph";
+      description = "Graph library for OCaml";
+      license = licenses.gpl2Oss;
+      maintainers = with maintainers; [ kkallio superherointj ];
+  };
+}
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..1aa438ffa448
--- /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 useDune2 meta;
+
+  propagatedBuildInputs = [
+    lablgtk
+    ocamlgraph
+    stdlib-shims
+  ];
+}
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..f8d20b7124bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlnat/default.nix
@@ -0,0 +1,44 @@
+{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";
+  };
+
+  buildInputs = [ocaml findlib ounit];
+
+  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.
+    '';
+    platforms = ocaml.meta.platforms or [];
+    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..5c3ca95bb0d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlnet/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip
+, gnutls, nettle
+}:
+
+if lib.versionOlder ocaml.version "4.02"
+then throw "ocamlnet is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-ocamlnet-${version}";
+  version = "4.1.9";
+
+  src = fetchurl {
+    url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
+    sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr";
+  };
+
+  nativeBuildInputs = [ pkg-config which ];
+  buildInputs = [ ncurses ocaml findlib ocaml_pcre camlzip gnutls nettle ];
+
+  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 = "A 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.";
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [
+      lib.maintainers.maggesi
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlsdl/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlsdl/default.nix
new file mode 100644
index 000000000000..7c782b5268fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlsdl/default.nix
@@ -0,0 +1,31 @@
+{stdenv, lib, fetchurl, ocaml, pkg-config, findlib, SDL, SDL_image, SDL_mixer, SDL_ttf, SDL_gfx, lablgl }:
+
+let
+  pname = "ocamlsdl";
+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 = "0.9.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/ocamlsdl/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz";
+    sha256 = "abfb295b263dc11e97fffdd88ea1a28b46df8cc2b196777093e4fe7f509e4f8f";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ocaml findlib SDL SDL_image SDL_mixer SDL_ttf SDL_gfx lablgl];
+
+  propagatedBuildInputs = [ SDL SDL_image SDL_mixer SDL_ttf SDL_gfx pkg-config ];
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://ocamlsdl.sourceforge.net/";
+    description = "OCaml bindings for SDL 1.2";
+    license = lib.licenses.lgpl21;
+  };
+}
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..d8d19f5e3651
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocb-stubblr/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, topkg, astring }:
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-ocb-stubblr-0.1.0";
+  src = fetchzip {
+    url = "https://github.com/pqwy/ocb-stubblr/releases/download/v0.1.0/ocb-stubblr-0.1.0.tbz";
+    name = "src.tar.bz";
+    sha256 = "0hpds1lkq4j8wgslv7hnirgfrjmqi36h5rarpw9mwf24gfp5ays2";
+  };
+
+  patches = [ ./pkg-config.patch ];
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ astring ];
+
+  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..ee14a83d57ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocf/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, ppx_tools, yojson }:
+
+if lib.versionOlder ocaml.version "4.03"
+|| lib.versionAtLeast ocaml.version "4.08"
+then throw "ocf not supported for ocaml ${ocaml.version}"
+else
+stdenv.mkDerivation rec {
+  pname = "ocf";
+  version = "0.5.0";
+  src = fetchFromGitHub {
+    owner = "zoggy";
+    repo = "ocf";
+    rev = "release-${version}";
+    sha256 = "1fhq9l2nmr39hxzpavc0jssmba71nnmhsncdn4dsbh2ylv29w56y";
+  };
+
+  buildInputs = [ ocaml findlib ppx_tools ];
+  propagatedBuildInputs = [ yojson ];
+
+  createFindlibDestdir = true;
+
+  dontStrip = true;
+
+  patches = [(fetchpatch {
+    url = "https://github.com/zoggy/ocf/commit/3a231c7a6c5e535a77c25e207af8952793436444.patch";
+    sha256 = "0nc8cggc5gxhch9amaz3s71lxs1xbgi7fs9p90cng04dsgr64xk5";
+  })
+  ];
+
+  meta = with lib; {
+    description = "OCaml library to read and write configuration options in JSON syntax";
+    homepage = "https://zoggy.github.io/ocf/";
+    license = licenses.lgpl3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ regnat ];
+  };
+}
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..be217812834f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-ocp-ocamlres-${version}";
+  version = "0.4";
+  src = fetchFromGitHub {
+    owner = "OCamlPro";
+    repo = "ocp-ocamlres";
+    rev = "v${version}";
+    sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn";
+  };
+
+  buildInputs = [ ocaml findlib astring pprint ];
+  createFindlibDestdir = true;
+
+  installFlags = [ "BINDIR=$(out)/bin" ];
+  preInstall = "mkdir -p $out/bin";
+
+  meta = {
+    description = "A simple tool and library to embed files and directories inside OCaml executables";
+    license = lib.licenses.lgpl3Plus;
+    homepage = "https://www.typerex.org/ocp-ocamlres.html";
+    maintainers = [ lib.maintainers.vbgl ];
+    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..2cb066a7c035
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchzip, cppo }:
+
+buildDunePackage rec {
+  version = "1.1";
+  pname = "ocplib-endian";
+
+  src = fetchzip {
+    url = "https://github.com/OCamlPro/ocplib-endian/archive/${version}.tar.gz";
+    sha256 = "sha256-zKsSkhlZBXSqPtw+/WN3pwo9plM9rDZfMbGVfosqb10=";
+  };
+
+  useDune2 = true;
+
+  buildInputs = [ 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-json-typed/browser.nix b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix
new file mode 100644
index 000000000000..8db892f325e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix
@@ -0,0 +1,15 @@
+{ buildDunePackage, ocplib-json-typed, js_of_ocaml }:
+
+buildDunePackage {
+  pname = "ocplib-json-typed-browser";
+  inherit (ocplib-json-typed) version src;
+  useDune2 = true;
+
+  propagatedBuildInputs = [ ocplib-json-typed js_of_ocaml ];
+
+  meta = {
+    description = "A Json_repr interface over JavaScript's objects";
+    inherit (ocplib-json-typed.meta) homepage license maintainers;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix
new file mode 100644
index 000000000000..f95a25d25f2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, ocplib-json-typed, ocplib-endian }:
+
+buildDunePackage {
+  pname = "ocplib-json-typed-bson";
+  inherit (ocplib-json-typed) version useDune2 src;
+
+  propagatedBuildInputs = [ ocplib-json-typed ocplib-endian ];
+
+  meta = {
+    description = "A Json_repr compatible implementation of the JSON compatible subset of BSON";
+    inherit (ocplib-json-typed.meta) homepage license maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix
new file mode 100644
index 000000000000..75554d25bf28
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub, uri }:
+
+buildDunePackage rec {
+  pname = "ocplib-json-typed";
+  version = "0.7.1";
+  useDune2 = true;
+  src = fetchFromGitHub {
+    owner = "OCamlPro";
+    repo = "ocplib-json-typed";
+    rev = "v${version}";
+    sha256 = "1gv0vqqy9lh7isaqg54b3lam2sh7nfjjazi6x7zn6bh5f77g1p5q";
+  };
+
+  propagatedBuildInputs = [ uri ];
+
+  meta = {
+    description = "A collection of type-aware JSON utilities for OCaml";
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
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..8435d1c5e516
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocplib-simplex/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, ocaml, findlib }:
+
+let
+  pname = "ocplib-simplex";
+  version = "0.4";
+in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "OCamlPro-Iguernlala";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "09niyidrjzrj8g1qwx4wgsdf5m6cwrnzg7zsgala36jliic4di60";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ocaml findlib ];
+
+  installFlags = [ "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    description = "An OCaml library implementing a simplex algorithm, in a functional style, for solving systems of linear inequalities";
+    homepage = "https://github.com/OCamlPro-Iguernlala/ocplib-simplex";
+    inherit (ocaml.meta) platforms;
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
new file mode 100644
index 000000000000..1feb3ecae714
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, oasis, ocaml_optcomp, camlp4
+, num
+}:
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.03"
+  then {
+    version = "0.8.1";
+    sha256 = "03vzrybdpjydbpil97zmir71kpsn2yxkjnzysma7fvybk8ll4zh9";
+    buildInputs = [ num ];
+  } else {
+    version = "0.7.1";
+    sha256 = "0gg3nr3iic4rwqrcc0qvfm9x0x57zclvdsnpy0z8rv2fl5isbzms";
+  };
+in
+
+let inherit (param) version; in
+
+stdenv.mkDerivation {
+  pname = "ocsigen-deriving";
+  inherit version;
+  src = fetchzip {
+    url = "https://github.com/ocsigen/deriving/archive/${version}.tar.gz";
+    inherit (param) sha256;
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild oasis ocaml_optcomp camlp4 ]
+  ++ (param.buildInputs or []);
+
+  createFindlibDestdir = true;
+
+  meta =  {
+    homepage = "https://github.com/ocsigen/deriving";
+    description = "Extension to OCaml for deriving functions from type declarations";
+    license = lib.licenses.mit;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with lib.maintainers; [
+      gal_bolle 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..96a66874c759
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-server/default.nix
@@ -0,0 +1,70 @@
+{ lib, buildDunePackage, fetchFromGitHub, which, ocaml, lwt_react, ssl, lwt_ssl
+, bigstringaf, lwt, cstruct, mirage-crypto, zarith, mirage-crypto-ec, ptime, mirage-crypto-rng, mtime, ca-certs
+, cohttp, cohttp-lwt-unix, hmap
+, lwt_log, ocaml_pcre, cryptokit, xml-light, ipaddr
+, pgocaml, camlzip, ocaml_sqlite3
+, 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 ocaml_pcre
+  ]
+; in
+
+buildDunePackage rec {
+  version = "4.0.1";
+  pname = "ocsigenserver";
+
+  useDune2 = true;
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "ocsigenserver";
+    rev = version;
+    sha256 = "0pid4irkmdmx1d6n2rvcvx5mnljl3hazzdqc3bql72by35izfac6";
+  };
+
+  nativeBuildInputs = [ makeWrapper which ];
+  buildInputs = [ lwt_react pgocaml camlzip ocaml_sqlite3 ];
+
+  propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl
+    ocaml_pcre xml-light
+  ];
+
+  configureFlags = [ "--root $(out)" "--prefix /" ];
+
+  dontAddPrefix = true;
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  postConfigure = ''
+    make -C src confs
+  '';
+
+  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 = "A 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;
+    platforms = ocaml.meta.platforms or [];
+    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..ea5609e63b55
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-start/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocsigen-toolkit, pgocaml_ppx, safepass, yojson
+, cohttp-lwt-unix
+, resource-pooling
+, ocamlnet
+}:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-ocsigen-start-${version}";
+  version = "4.3.0";
+
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ pgocaml_ppx safepass ocsigen-toolkit yojson resource-pooling cohttp-lwt-unix ocamlnet ];
+
+  patches = [ ./templates-dir.patch ];
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = "ocsigen-start";
+    rev = version;
+    sha256 = "0lkl59dwzyqq2lyr46fyjr27ms0fp9h59xfsn37faaavdd7v0h98";
+  };
+
+  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..0e430e2ba291
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix
@@ -0,0 +1,38 @@
+{ 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 = "2.12.2";
+
+ propagatedBuildInputs = [ calendar js_of_ocaml-ppx_deriving_json eliom ];
+ buildInputs = [ ocaml findlib opaline ];
+
+ 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;
+    sha256 = "1fqrh7wrzs76qj3nvmxqy76pzqvsja2dwzqxyl8rkh5jg676vmqy";
+  };
+
+  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/octavius/default.nix b/nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix
new file mode 100644
index 000000000000..a4124df66640
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/octavius/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+
+buildDunePackage rec {
+  pname = "octavius";
+  version = "1.2.2";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-doc";
+    repo = "octavius";
+    rev = "v${version}";
+    sha256 = "sha256-/S6WpIo1c5J9uM3xgtAM/elhnsl0XimnIFsKy3ootbA=";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  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..83668b30cecd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocurl/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, pkg-config, ocaml, findlib, fetchurl, curl, ncurses, lwt }:
+
+if lib.versionOlder ocaml.version "4.02"
+then throw "ocurl is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocurl-0.9.1";
+  src = fetchurl {
+    url = "http://ygrek.org.ua/p/release/ocurl/${name}.tar.gz";
+    sha256 = "0n621cxb9012pj280c7821qqsdhypj8qy9qgrah79dkh6a8h2py6";
+  };
+
+  buildInputs = [ pkg-config ocaml findlib ncurses ];
+  propagatedBuildInputs = [ curl lwt ];
+  createFindlibDestdir = true;
+  meta = {
+    description = "OCaml bindings to libcurl";
+    license = lib.licenses.mit;
+    homepage = "http://ygrek.org.ua/p/ocurl/";
+    maintainers = with lib.maintainers; [ 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..aed5e92765f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odate/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, menhir
+}:
+
+buildDunePackage rec {
+  pname = "odate";
+  version = "0.6";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "hhugo";
+    repo = pname;
+    rev = version;
+    sha256 = "1dk33lr0g2jnia2gqsm6nnc7nf256qgkm3v30w477gm6y2ppfm3h";
+  };
+
+  buildInputs = [ 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/odn/default.nix b/nixpkgs/pkgs/development/ocaml-modules/odn/default.nix
new file mode 100644
index 000000000000..edf7d8649551
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odn/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, type_conv, ounit, camlp4 }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "ocaml-data-notation is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-data-notation-0.0.11";
+
+  src = fetchurl {
+    url = "https://forge.ocamlcore.org/frs/download.php/1310/ocaml-data-notation-0.0.11.tar.gz";
+    sha256 = "09a8zdyifpc2nl4hdvg9206142y31cq95ajgij011s1qcg3z93lj";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild type_conv ounit camlp4 ];
+
+  createFindlibDestdir = true;
+
+  configurePhase = "ocaml setup.ml -configure";
+  buildPhase     = "ocaml setup.ml -build";
+  installPhase   = "ocaml setup.ml -install";
+
+  meta = with lib; {
+    description = "Store data using OCaml notation";
+    homepage = "https://forge.ocamlcore.org/projects/odn/";
+    license = licenses.lgpl21;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [
+      vbgl maggesi
+    ];
+  };
+}
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..a8e6bd2599c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odoc-parser/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, buildDunePackage, astring, result }:
+
+buildDunePackage rec {
+  pname = "odoc-parser";
+  version = "0.9.0";
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-doc/odoc-parser/releases/download/0.9.0/odoc-parser-0.9.0.tbz";
+    sha256 = "0ydxy2sj2w9i4vvyjnxplgmp5gbkp5ilnv36pvk4vgrrmldss3fz";
+  };
+
+  useDune2 = true;
+
+  buildInputs = [ astring result ];
+
+  meta = {
+    description = "Parser for Ocaml documentation comments";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.marsam ];
+    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..68c06cc4c6f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/odoc/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, astring, cmdliner, cppo, fpath, result, tyxml
+, markup, alcotest, yojson, sexplib, jq
+}:
+
+buildDunePackage rec {
+  pname = "odoc";
+  version = "1.5.3";
+
+  minimumOCamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/odoc/releases/download/${version}/odoc-${version}.tbz";
+    sha256 = "0idzidmz7y10xkwcf4aih0mdvkipxk1gzi4anhnbbi2q2s0nzdzj";
+  };
+
+  useDune2 = true;
+
+  buildInputs = [ astring cmdliner cppo fpath result tyxml ];
+
+  checkInputs = [ alcotest markup yojson sexplib jq ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  meta = {
+    description = "A documentation generator for OCaml";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    homepage = "https://github.com/ocaml/odoc";
+  };
+}
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..fee2f300eac7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/omd/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-omd-1.3.1";
+  src = fetchurl {
+    url = "https://github.com/Chris00/omd/releases/download/1.3.1/omd-1.3.1.tar.gz";
+    sha256 = "1sgdgzpx96br7npj8mh91cli5mqmzsjpngwm7x4212n3k1d0ivwa";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  createFindlibDestdir = true;
+
+  configurePhase = ''
+    runHook preConfigure
+    ocaml setup.ml -configure --prefix $out
+    runHook postConfigure
+  '';
+
+  meta = {
+    description = "Extensible Markdown library and tool in OCaml";
+    homepage = "https://github.com/ocaml/omd";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
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..d0ec77c4556f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "opam-file-format";
+  version = "2.1.3";
+
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = pname;
+    rev = version;
+    sha256 = "1fxhppdmrysr2nb5z3c448h17np48f3ga9jih33acj78r4rdblcs";
+  };
+
+  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/";
+  };
+}
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..1480a7d5915a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-repository/default.nix
@@ -0,0 +1,26 @@
+{ 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\""
+  '';
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ 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..5db3d1b4a241
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opium/default.nix
@@ -0,0 +1,32 @@
+{ buildDunePackage
+
+, ppx_sexp_conv
+, ppx_fields_conv
+
+, cmdliner
+, cohttp-lwt-unix
+, logs
+, magic-mime
+, opium_kernel
+, stringext
+
+, alcotest
+}:
+
+buildDunePackage {
+  pname = "opium";
+  inherit (opium_kernel) version src meta minimumOCamlVersion;
+
+  useDune2 = true;
+
+  doCheck = true;
+
+  buildInputs = [
+    ppx_sexp_conv ppx_fields_conv
+    alcotest
+  ];
+
+  propagatedBuildInputs = [
+    opium_kernel cmdliner cohttp-lwt-unix magic-mime logs stringext
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opium_kernel/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opium_kernel/default.nix
new file mode 100644
index 000000000000..c7bfe1e7306a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opium_kernel/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildDunePackage
+, fetchurl
+
+, ppx_fields_conv
+, ppx_sexp_conv
+
+, cohttp-lwt
+, ezjsonm
+, hmap
+, sexplib
+}:
+
+buildDunePackage rec {
+  pname = "opium_kernel";
+  version = "0.18.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04.1";
+
+  src = fetchurl {
+    url = "https://github.com/rgrinberg/opium/releases/download/${version}/opium-${version}.tbz";
+    sha256 = "0a2y9gw55psqhqli3a5ps9mfdab8r46fnbj882r2sp366sfcy37q";
+  };
+
+  doCheck = true;
+
+  buildInputs = [
+    ppx_sexp_conv ppx_fields_conv
+  ];
+
+  propagatedBuildInputs = [
+    hmap cohttp-lwt ezjsonm sexplib
+  ];
+
+  meta = {
+    description = "Sinatra like web toolkit for OCaml based on cohttp & lwt";
+    homepage = "https://github.com/rgrinberg/opium";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.pmahoney ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/optcomp/META b/nixpkgs/pkgs/development/ocaml-modules/optcomp/META
new file mode 100644
index 000000000000..8a942288f752
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/optcomp/META
@@ -0,0 +1,12 @@
+# OASIS_START
+# DO NOT EDIT (digest: ec844fa3189acb2a866b89a69d111ba4)
+version = "1.6"
+description = "Optional compilation with cpp-like directives"
+requires = "camlp4"
+archive(syntax, preprocessor) = "optcomp.cma"
+archive(syntax, toploop) = "optcomp.cma"
+archive(syntax, preprocessor, native) = "optcomp.cmxa"
+archive(syntax, preprocessor, native, plugin) = "optcomp.cmxs"
+exists_if = "optcomp.cma"
+# OASIS_STOP
+
diff --git a/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix b/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix
new file mode 100644
index 000000000000..b78d070962e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, camlp4 }:
+
+stdenv.mkDerivation {
+  name = "ocaml-optcomp-1.6";
+  src = fetchurl {
+    url = "https://github.com/diml/optcomp/archive/1.6.tar.gz";
+    sha256 = "0hhhb2gisah1h22zlg5iszbgqxdd7x85cwd57bd4mfkx9l7dh8jh";
+  };
+
+  patches =
+    let inherit (lib) optional versionAtLeast; in
+    optional (versionAtLeast ocaml.version "4.02") (fetchpatch {
+      url = "https://github.com/diml/optcomp/commit/b7f809360c9794b383a4bc0492f6df381276b429.patch";
+      sha256 = "1n095lk94jq1rwi0l24g2wbgms7249wdd31n0ji895dr6755s93y";
+    })
+  ;
+
+  createFindlibDestdir = true;
+
+  buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
+
+  configurePhase = ''
+    cp ${./META} META
+  '';
+
+  buildPhase = ''
+    ocamlbuild src/optcomp.cmxs src/optcomp.cma src/optcomp_o.native src/optcomp_r.native
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp _build/src/optcomp_o.native $out/bin/optcomp-o
+    cp _build/src/optcomp_r.native $out/bin/optcomp-r
+    ocamlfind install optcomp META _build/src/optcomp.{a,cma,cmxa,cmxs} _build/src/pa_optcomp.{cmi,cmx,mli}
+  '';
+
+  meta =  {
+    homepage = "https://github.com/diml/optcomp";
+    description = "Optional compilation for OCaml with cpp-like directives";
+    license = lib.licenses.bsd3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [
+      lib.maintainers.gal_bolle
+    ];
+  };
+
+}
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..2227f6e033ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/optint/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildDunePackage, fetchurl }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.07";
+  version = "0.1.0";
+  pname = "optint";
+  src = fetchurl {
+    url = "https://github.com/mirage/optint/releases/download/v${version}/optint-v${version}.tbz";
+    sha256 = "27847660223c16cc7eaf8fcd9d5589a0b802114330a2529578f8007d3b01185d";
+  };
+
+  useDune2 = true;
+
+  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/otfm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix
new file mode 100644
index 000000000000..0642b30699c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otfm/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf, result }:
+
+let
+  pname = "otfm";
+  version = "0.3.0";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+assert lib.versionAtLeast ocaml.version "4.01.0";
+
+stdenv.mkDerivation {
+
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "054s82539k3kc9na6s47g3scsl04icjahpas7pv5351jmsgqcq3k";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ uutf result ];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
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..17e8fc855ea0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otoml/default.nix
@@ -0,0 +1,32 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, menhir
+, menhirLib
+, uutf
+}:
+
+buildDunePackage rec {
+  pname = "otoml";
+  version = "0.9.0";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "dmbaturin";
+    repo = pname;
+    rev = version;
+    sha256 = "0l0c60rzgk11y8xq05kr8q9hkzb3c8vi995mq84x98ys73wb42j3";
+  };
+
+  buildInputs = [ menhir ];
+
+  propagatedBuildInputs = [ menhirLib uutf ];
+
+  meta = {
+    description = "A TOML parsing and manipulation library for OCaml";
+    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..cec5d2ee0d07
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/otr/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, sexplib0, rresult, mirage-crypto, mirage-crypto-pk, astring, base64
+, mirage-crypto-rng
+}:
+
+buildDunePackage rec {
+  pname = "otr";
+  version = "0.3.8";
+
+  src = fetchurl {
+    url = "https://github.com/hannesm/ocaml-otr/releases/download/v${version}/otr-v${version}.tbz";
+    sha256 = "18hn9l8wznqnlh2jf1hpnp36f1cx80ncwiiivsbj34llhgp3893d";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [ cstruct sexplib0 mirage-crypto mirage-crypto-pk
+                            astring rresult base64 ];
+
+  doCheck = true;
+  checkInputs = [ mirage-crypto-rng ];
+
+  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..fbb75e613309
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ounit/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, ocaml, findlib, ounit2 }:
+
+stdenv.mkDerivation {
+  pname = "ocaml${ocaml.version}-ounit";
+  inherit (ounit2) version src meta;
+
+  buildInputs = [ findlib ];
+  propagatedBuildInputs = [ ounit2 ];
+
+  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..0b68609584d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ounit2/default.nix
@@ -0,0 +1,27 @@
+{ lib, ocaml, buildDunePackage, fetchurl, stdlib-shims, ncurses }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.04";
+
+  pname = "ounit2";
+  version = "2.2.4";
+
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/gildor478/ounit/releases/download/v${version}/ounit-v${version}.tbz";
+    sha256 = "0i9kiqbf2dp12c4qcvbn4abdpdp6h4g5z54ycsh0q8jpv6jnkh5m";
+  };
+
+  propagatedBuildInputs = [ stdlib-shims ];
+
+  doCheck = true;
+  checkInputs = lib.optional (lib.versionOlder ocaml.version "4.07") ncurses;
+
+  meta = with lib; {
+    homepage = "https://github.com/gildor478/ounit";
+    description = "A 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..9eb81003d47a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/owee/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.06";
+  pname = "owee";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "let-def";
+    repo = "owee";
+    rev = "v${version}";
+    sha256 = "0jp8ca57488d7sj2nqy4yxcdpda6sxx51yyi8k6888hbinhyqp0j";
+  };
+
+  meta = {
+    description = "An experimental OCaml library to work with DWARF format";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..b767b1db24c8
--- /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.0.1";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/owlbarn/owl/releases/download/${version}/owl-${version}.tbz";
+    sha256 = "72ca9f6edd302fdfa16c7559cedac7ac2c885466a367e17ea1ea8807b2dd13ef";
+  };
+
+  minimumOCamlVersion = "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..980efd3bf5c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/owl/default.nix
@@ -0,0 +1,26 @@
+{ stdenv
+, buildDunePackage
+, dune-configurator
+, fetchFromGitHub
+, alcotest
+, eigen
+, stdio
+, openblasCompat
+, owl-base
+, npy
+}:
+
+
+buildDunePackage rec {
+  pname = "owl";
+
+  inherit (owl-base) version src meta useDune2;
+
+  checkInputs = [ alcotest ];
+  buildInputs = [ dune-configurator stdio ];
+  propagatedBuildInputs = [
+    eigen openblasCompat owl-base npy
+  ];
+
+  doCheck = !stdenv.isDarwin;  # https://github.com/owlbarn/owl/issues/462
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pa_bench/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pa_bench/default.nix
new file mode 100644
index 000000000000..e5f9ac52067d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pa_bench/default.nix
@@ -0,0 +1,23 @@
+{lib, buildOcaml, fetchurl, type_conv, pa_ounit}:
+
+buildOcaml rec {
+  name = "pa_bench";
+  version = "113.00.00";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/pa_bench/archive/${version}.tar.gz";
+    sha256 = "1cd6291gdnk6h8ziclg6x3if8z5xy67nfz9gx8sx4k2cwv0j29k5";
+  };
+
+  buildInputs = [ pa_ounit ];
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/pa_bench";
+    description = "Syntax extension for inline benchmarks";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pa_ounit/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pa_ounit/default.nix
new file mode 100644
index 000000000000..26d000042227
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pa_ounit/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildOcaml, ocaml, fetchurl, ounit }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "pa_ounit is not available for OCaml ${ocaml.version}"
+else
+
+buildOcaml rec {
+  name = "pa_ounit";
+  version = "113.00.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/pa_ounit/archive/${version}.tar.gz";
+    sha256 = "0vi0p2hxcrdsl0319c9s8mh9hmk2i4ir6c6vrj8axkc37zkgc437";
+  };
+
+  propagatedBuildInputs = [ ounit ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/pa_ounit";
+    description = "OCaml inline testing";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
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..375ba1c125e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/paf/default.nix
@@ -0,0 +1,84 @@
+{ buildDunePackage
+, lib
+, fetchurl
+, fetchpatch
+, mirage-stack
+, mirage-time
+, httpaf
+, h2
+, tls-mirage
+, mimic
+, cohttp-lwt
+, letsencrypt
+, emile
+, ke
+, bigstringaf
+, domain-name
+, duration
+, faraday
+, ipaddr
+, tls
+, x509
+, lwt
+, logs
+, fmt
+, mirage-crypto-rng
+, tcpip
+, mirage-time-unix
+, ptime
+, uri
+, alcotest-lwt
+}:
+
+buildDunePackage rec {
+  pname = "paf";
+  version = "0.0.3";
+
+  src = fetchurl {
+    url = "https://github.com/dinosaure/paf-le-chien/releases/download/${version}/paf-${version}.tbz";
+    sha256 = "a0bbb84b19e1f0255337fc4d7017f3ea3611b241746e391b11c1d8b1f5f30a2b";
+  };
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    mirage-stack
+    mirage-time
+    httpaf
+    h2
+    tls-mirage
+    mimic
+    cohttp-lwt
+    letsencrypt
+    emile
+    ke
+    bigstringaf
+    domain-name
+    ipaddr
+    duration
+    faraday
+    tls
+    x509
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    lwt
+    logs
+    fmt
+    mirage-crypto-rng
+    tcpip
+    mirage-time-unix
+    ptime
+    uri
+    alcotest-lwt
+  ];
+
+  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..29213031f358
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parany/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchFromGitHub, ocamlnet, cpu }:
+
+buildDunePackage rec {
+  pname = "parany";
+  version = "12.1.1";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.03.0";
+
+  src = fetchFromGitHub {
+    owner = "UnixJunkie";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0s2sbmywy4yyh69dcrcqd85hd8jcd7qgfczy79nam4bvn87bjm72";
+  };
+
+  propagatedBuildInputs = [ ocamlnet cpu ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    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..d79999087dd8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parmap/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "parmap";
+  version = "1.2.3";
+
+  src = fetchurl {
+    url = "https://github.com/rdicosmo/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "1wg81slp453jci0gi0rzvdjx74110mlf1n5qpsmxic6fqsyz9d2v";
+  };
+
+  minimalOCamlVersion = "4.03";
+  useDune2 = true;
+
+  buildInputs = [
+    dune-configurator
+  ];
+
+  doCheck = true;
+
+  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..4bc409245eed
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/parse-argv/default.nix
@@ -0,0 +1,30 @@
+{ lib, fetchurl, buildDunePackage, ocaml
+, astring
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "parse-argv";
+  version = "0.2.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "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.04";
+  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..1ecf213f6d36
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pbkdf/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, mirage-crypto
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "pbkdf";
+  version = "1.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/abeaumont/ocaml-pbkdf/releases/download/${version}/pbkdf-${version}.tbz";
+    sha256 = "e53ed1bd9abf490c858a341c10fb548bc9ad50d4479acdf95a9358a73d042264";
+  };
+
+  propagatedBuildInputs = [ 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/pcap-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix
new file mode 100644
index 000000000000..f8bb6f4f6b2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pcap-format/default.nix
@@ -0,0 +1,41 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_cstruct, ppx_tools
+, cstruct, ounit, mmap
+}:
+
+buildDunePackage rec {
+  pname = "pcap-format";
+  version = "0.5.2";
+
+  minimumOCamlVersion = "4.03";
+
+  # due to cstruct
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-pcap/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "14c5rpgglyz41jic0fg0xa22d2w1syb86kva22y9fi7aqj9vm31f";
+  };
+
+  nativeBuildInputs = [
+    ppx_tools
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    cstruct
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    ounit
+    mmap
+  ];
+
+  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..ea853c4648b1
--- /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.4.6";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/pcre-ocaml/releases/download/${version}/pcre-${version}.tbz";
+    sha256 = "17ajl0ra5xkxn5pf0m0zalylp44wsfy6mvcq213djh2pwznh4gya";
+  };
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [ pcre ];
+
+  meta = with lib; {
+    homepage = "https://mmottl.github.io/pcre-ocaml";
+    description = "An 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..22c1913635f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pecu/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, ocaml, fetchurl, fmt, alcotest, crowbar, astring }:
+
+buildDunePackage rec {
+  pname = "pecu";
+  version = "0.6";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/pecu/releases/download/v${version}/pecu-v${version}.tbz";
+    sha256 = "a9d2b7da444c83b20f879f6c3b7fc911d08ac1e6245ad7105437504f9394e5c7";
+  };
+
+  # 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..5c00f2c8991f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, calendar, csv, hex, ppx_deriving, ppx_sexp_conv, re, rresult, sexplib
+}:
+
+buildDunePackage rec {
+  pname = "pgocaml";
+  version = "4.2.2-dev-20210111";
+  src = fetchFromGitHub {
+    owner = "darioteixeira";
+    repo = "pgocaml";
+    rev = "1bb0025deeb3d14029afdcc69aaa7847026e243e";
+    sha256 = "11inbjf87gclc2xmpq56ag4cm4467y9q9hjgbdn69fa1bman2zn2";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  propagatedBuildInputs = [ calendar csv hex ppx_deriving ppx_sexp_conv re rresult sexplib ];
+
+  meta = with lib; {
+    description = "An interface to PostgreSQL databases for OCaml applications";
+    inherit (src.meta) homepage;
+    license = licenses.lgpl2;
+    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..dce2e2b0c99d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgocaml/ppx.nix
@@ -0,0 +1,8 @@
+{ buildDunePackage, pgocaml, ppx_optcomp }:
+
+buildDunePackage {
+  pname = "pgocaml_ppx";
+  inherit (pgocaml) src version useDune2 meta;
+
+  propagatedBuildInputs = [ pgocaml ppx_optcomp ];
+}
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..a1d6fe6486ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pgsolver/default.nix
@@ -0,0 +1,23 @@
+{ 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 = {
+    homepage = "https://github.com/tcsprojects/pgsolver";
+    description = "A collection of tools for generating, manipulating and - most of all - solving parity games";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+  };
+}
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..b284f7ef5eba
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/phylogenetics/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchFromGitHub, ppx_deriving
+, alcotest, angstrom-unix, biocaml, gnuplot, gsl, lacaml, menhir, owl, printbox }:
+
+buildDunePackage rec {
+  pname = "phylogenetics";
+  version = "unstable-2020-11-23";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner  = "biocaml";
+    repo   = pname;
+    rev    = "e6e10efa0a3a8fd61bf4ab69e91a09549cc1ded6";
+    sha256 = "0pmypzp0rvlpzm8zpbcfkphwnhrpyfwfv44kshvx2f8nslmksh8c";
+  };
+
+  minimumOCamlVersion = "4.08";  # e.g., uses Float.min
+
+  checkInputs = [ alcotest ];
+  buildInputs = [ menhir ];
+  propagatedBuildInputs = [ angstrom-unix biocaml gnuplot gsl lacaml owl ppx_deriving printbox ];
+
+  doCheck = false;  # many tests require bppsuite
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Bioinformatics library for Ocaml";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.cecill-b;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/pipebang/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pipebang/default.nix
new file mode 100644
index 000000000000..36eb3fe54bbe
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pipebang/default.nix
@@ -0,0 +1,20 @@
+{lib, buildOcaml, fetchurl}:
+
+buildOcaml rec {
+  name = "pipebang";
+  version = "113.00.00";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/pipebang/archive/${version}.tar.gz";
+    sha256 = "0acm2y8wxvnapa248lkgm0vcc44hlwhrjxqkx1awjxzcmarnxhfk";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/pipebang";
+    description = "Syntax extension to transform x |! f into f x";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
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..7203f3702850
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi-ocaml/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims }:
+
+stdenv.mkDerivation rec {
+  version = "0.7.7";
+  pname = "piqi-ocaml";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "alavrik";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1913jpsb8mvqi8609j4g4sm5jhg50dq0xqxgy8nmvknfryyc89nm";
+  };
+
+  buildInputs = [ ocaml findlib piqi stdlib-shims ];
+
+  createFindlibDestdir = true;
+
+  installPhase = "DESTDIR=$out make install";
+
+  meta = with lib; {
+    homepage = "http://piqi.org";
+    description = "Universal schema language and a collection of tools built around it. These are the ocaml bindings";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+  };
+}
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..d7bc4b55b452
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/piqi/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex_2, easy-format, xmlm, base64 }:
+
+stdenv.mkDerivation rec {
+  version = "0.6.15";
+  pname = "piqi";
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "alavrik";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0v04hs85xv6d4ysqxyv1dik34dx49yab9shpi4x7iv19qlzl7csb";
+  };
+
+  buildInputs = [ ocaml findlib which ];
+  propagatedBuildInputs = [ sedlex_2 xmlm easy-format base64 ];
+
+  patches = [ ./no-ocamlpath-override.patch ];
+
+  createFindlibDestdir = true;
+
+  buildPhase = ''
+    make
+    make -C piqilib piqilib.cma
+  '';
+
+  installPhase = ''
+    make install;
+    make ocaml-install;
+  '';
+
+  meta = with lib; {
+    homepage = "http://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/posix/base.nix b/nixpkgs/pkgs/development/ocaml-modules/posix/base.nix
new file mode 100644
index 000000000000..a6fe690ebcc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/base.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, ctypes, integers
+}:
+
+buildDunePackage rec {
+  pname = "posix-base";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-posix";
+    rev = "v${version}";
+    sha256 = "18px8hfqcfy2lk8105ki3hrxxigs44gs046ba0fqda6wzd0hr82b";
+  };
+
+  useDune2 = true;
+
+  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..69a469bbeced
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/socket.nix
@@ -0,0 +1,16 @@
+{ lib, buildDunePackage, posix-base }:
+
+buildDunePackage {
+  pname = "posix-socket";
+
+  inherit (posix-base) version src useDune2;
+
+  propagatedBuildInputs = [ posix-base ];
+
+  doCheck = true;
+
+  meta = posix-base.meta // {
+    description = "Bindings for posix sockets";
+  };
+
+}
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..2512fe892c13
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/posix/types.nix
@@ -0,0 +1,15 @@
+{ lib, buildDunePackage, posix-base }:
+
+buildDunePackage {
+  pname = "posix-types";
+
+  inherit (posix-base) version src useDune2;
+
+  minimumOCamlVersion = "4.03";
+
+  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..a63876ec5bb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/postgresql/default.nix
@@ -0,0 +1,26 @@
+{ 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";
+  };
+
+  buildInputs = [ dune-configurator 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..70c509ec22ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pp/default.nix
@@ -0,0 +1,28 @@
+{ buildDunePackage
+, fetchzip
+, ppx_expect
+, lib
+}:
+
+buildDunePackage rec {
+  pname = "pp";
+  version = "1.1.2";
+
+  src = fetchzip {
+    url = "https://github.com/ocaml-dune/pp/releases/download/${version}/pp-${version}.tbz";
+    sha256 = "1l1im054pxrkj7zk8m6yj4qfdpxkajpjfvy818ggf0j4nxkaihc5";
+  };
+
+  useDune2 = true;
+  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; [ symphorien ];
+  };
+}
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..0cdde114709c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pprint/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "3.12";
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.02"
+  then {
+    version = "20171003";
+    sha256 = "06zwsskri8kaqjdszj9360nf36zvwh886xwf033aija8c9k4w6cx";
+  } else {
+    version = "20140424";
+    sha256 = "0sc9q89dnyarcg24czyhr6ams0ylqvia3745s6rfwd2nldpygsdk";
+}; in
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-pprint-${param.version}";
+
+  src = fetchurl {
+    url = "http://gallium.inria.fr/~fpottier/pprint/pprint-${param.version}.tar.gz";
+    inherit (param) sha256;
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+
+  createFindlibDestdir = true;
+
+  dontBuild = true;
+  installFlags = [ "-C" "src" ];
+
+  meta = with lib; {
+    homepage = "http://gallium.inria.fr/~fpottier/pprint/";
+    description = "An OCaml adaptation of Wadler’s and Leijen’s prettier printer";
+    license = licenses.cecill-c;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..f0a223c3db75
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_bap/default.nix
@@ -0,0 +1,51 @@
+{ 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";
+  useDune2 = true;
+
+  minimumOCamlVersion = "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 = "The set of ppx rewriters for BAP";
+    license = lib.licenses.mit;
+    inherit (src.meta) homepage;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..ac96e56d04e6
--- /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.7.2";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/johnwhitington/${pname}/releases/download/${version}/ppx_blob-${version}.tbz";
+    sha256 = "00haz1cmplk3j9ysh6j656zrldy60585fmlndmfhpd5332mxrfdw";
+  };
+
+  checkInputs = [ alcotest ];
+  propagatedBuildInputs = [ ppxlib ];
+  doCheck = lib.versionAtLeast ocaml.version "4.05";
+
+  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..6ad6c4cd8985
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_cstubs/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, fetchFromGitHub
+, buildDunePackage
+, bigarray-compat
+, containers
+, cppo
+, ctypes
+, integers
+, num
+, ppxlib
+, re
+}:
+
+buildDunePackage rec {
+  pname = "ppx_cstubs";
+  version = "0.6.1.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "fdopen";
+    repo = "ppx_cstubs";
+    rev = version;
+    sha256 = "15cjb9ygnvp2kv85rrb7ncz7yalifyl7wd2hp2cl8r1qrpgi1d0w";
+  };
+
+  buildInputs = [
+    bigarray-compat
+    containers
+    cppo
+    ctypes
+    integers
+    num
+    ppxlib
+    re
+  ];
+
+  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_derivers/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix
new file mode 100644
index 000000000000..84dda38846fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_derivers/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+
+buildDunePackage rec {
+  pname = "ppx_derivers";
+  version = "1.2.1";
+
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  minimumOCamlVersion = "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..5563e6113462
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, fetchurl
+, buildDunePackage
+, cppo
+, ppxlib
+, ppx_derivers
+, result
+, ounit
+, ocaml-migrate-parsetree
+, ocaml-migrate-parsetree-2
+}:
+
+let params =
+  if lib.versionAtLeast ppxlib.version "0.20" then {
+    version = "5.2.1";
+    sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9";
+    useOMP2 = true;
+  } else if lib.versionAtLeast ppxlib.version "0.15" then {
+    version = "5.1";
+    sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh";
+    useOMP2 = false;
+  } else {
+    version = "5.0";
+    sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3";
+    useOMP2 = false;
+  }
+; in
+
+buildDunePackage rec {
+  pname = "ppx_deriving";
+  inherit (params) version;
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz";
+    inherit (params) sha256;
+  };
+
+  buildInputs = [ ppxlib cppo ];
+  propagatedBuildInputs = [
+    (if params.useOMP2
+    then ocaml-migrate-parsetree-2
+    else ocaml-migrate-parsetree)
+    ppx_derivers
+    result
+  ];
+
+  doCheck = true;
+  checkInputs = [ 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..412ef9568db2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, alcotest
+, cmdliner
+, ppx_deriving
+, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_cmdliner";
+  version = "0.6.0";
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = "ppx_deriving_cmdliner";
+    rev = "v${version}";
+    sha256 = "19l32y2wv64d1c7fvln07dg3bkf7wf5inzjxlff7lbabskdbbras";
+  };
+
+  propagatedBuildInputs = [
+    cmdliner
+    ppx_deriving
+    ppxlib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+  ];
+
+  meta = with lib; {
+    description = "Ppx_deriving plugin for generating command line interfaces from types for OCaml";
+    inherit (src.meta) homepage;
+    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..6f23af44b949
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, buildDunePackage, cppo, ppx_deriving
+, ppxlib
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_protobuf";
+  version = "3.0.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_deriving_protobuf/releases/download/v${version}/ppx_deriving_protobuf-v${version}.tbz";
+    sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj";
+  };
+
+  buildInputs = [ cppo ppxlib ppx_deriving ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf";
+    description = "A 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..b7d1986c30d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, rpclib, alcotest, ppxlib, ppx_deriving, yojson }:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_rpc";
+
+  inherit (rpclib) version useDune2 src;
+
+  minimumOCamlVersion = "4.08";
+
+  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_yojson/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix
new file mode 100644
index 000000000000..bef60b3f381c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildDunePackage, fetchFromGitHub, ppxlib, ounit
+, ppx_deriving, yojson
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_yojson";
+  version = "3.6.1";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.07";
+
+  src = fetchFromGitHub {
+    owner = "ocaml-ppx";
+    repo = "ppx_deriving_yojson";
+    rev = "v${version}";
+    sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk";
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving yojson ];
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  meta = {
+    description = "A 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..ee801f6adfd8
--- /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=";
+  };
+
+  minimumOCamlVersion = "4.07";
+  useDune2 = true;
+
+  buildInputs = [ ppxlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/flowtype/ocaml-ppx_gen_rec";
+    description = "A 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..6588d6db7f45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_import/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, ppx_tools_versioned
+, ocaml-migrate-parsetree
+}:
+
+buildDunePackage rec {
+  pname = "ppx_import";
+  version = "1.8.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_import/releases/download/v${version}/ppx_import-${version}.tbz";
+    sha256 = "0zqcj70yyp4ik4jc6jz3qs2xhb94vxc6yq9ij0d5cyak28klc3gv";
+  };
+
+  propagatedBuildInputs = [
+    ppx_tools_versioned ocaml-migrate-parsetree
+  ];
+
+  meta = {
+    description = "A syntax extension that allows to pull in types or signatures from other compiled interface files";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/ocaml-ppx/ppx_import";
+  };
+}
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..64948c29ae50
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv, fetchFromGitHub, buildDunePackage, ocaml, findlib, cppo }:
+
+let param =
+  let v6_4 = {
+    version = "6.4";
+    sha256 = "15v7yfv6gyp8lzlgwi9garz10wpg34dk4072jdv19n6v20zfg7n1";
+    useDune2 = true;
+    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_4;
+  "4.09" = v6_4;
+  "4.10" = v6_4;
+  "4.11" = v6_4;
+  "4.12" = v6_4;
+  "4.13" = v6_4;
+}.${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 useDune2 buildInputs;
+  }
+else
+  stdenv.mkDerivation {
+    name = "ocaml${ocaml.version}-${pname}-${param.version}";
+
+    inherit src;
+
+    nativeBuildInputs = [ ocaml findlib ];
+    buildInputs = [ ocaml findlib ];
+
+    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..5200c13d89fd
--- /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";
+
+  useDune2 = true;
+
+  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 = [ maintainers.volth ];
+  };
+}
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..07d817d22938
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, fetchFromGitHub, yojson }:
+
+buildDunePackage rec {
+  pname = "ppx_yojson_conv_lib";
+  version = "0.14.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.02.3";
+
+  src = fetchFromGitHub {
+    owner = "janestreet";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "12s3xshayy1f8cp9lk6zqwnw60n7cdap55gkksz5w65gdd8bfxmf";
+  };
+
+  propagatedBuildInputs = [ yojson ];
+
+  meta = with lib; {
+    description = "Runtime lib for ppx_yojson_conv";
+    homepage = "https://github.com/janestreet/ppx_yojson_conv_lib";
+    maintainers = [ maintainers.marsam ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ppxfind/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ppxfind/default.nix
new file mode 100644
index 000000000000..4e135c1b115e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppxfind/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, buildDunePackage, fetchurl, ocaml, ocaml-migrate-parsetree }:
+
+buildDunePackage (rec {
+  pname = "ppxfind";
+  version = "1.4";
+  src = fetchurl {
+    url = "https://github.com/diml/ppxfind/releases/download/${version}/ppxfind-${version}.tbz";
+    sha256 = "0wa9vcrc26kirc2cqqs6kmarbi8gqy3dgdfiv9y7nzsgy1liqacq";
+  };
+
+  minimumOCamlVersion = "4.03";
+  useDune2 = true;
+
+  buildInputs = [ ocaml-migrate-parsetree ];
+
+  # Don't run the native `strip' when cross-compiling.
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  meta = {
+    homepage = "https://github.com/diml/ppxfind";
+    description = "ocamlfind ppx tool";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+} // (
+if lib.versions.majorMinor ocaml.version == "4.04" then {
+  dontStrip = true;
+} else {}
+))
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..c4591927e075
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ppxlib/default.nix
@@ -0,0 +1,77 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml
+, version ?
+  if lib.versionAtLeast ocaml.version "4.07"
+  then if lib.versionAtLeast ocaml.version "4.08"
+  then "0.22.2" 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 = "0vm0jajmg8135scbg0x60ivyy5gzv4abwnl7zls2mrw23ac6kml6";
+    max_version = "4.10";
+    useDune2 = false;
+    useOMP2 = false;
+  };
+  "0.13.0" = {
+    sha256 = "0c54g22pm6lhfh3f7s5wbah8y48lr5lj3cqsbvgi99bly1b5vqvl";
+    useDune2 = false;
+    useOMP2 = false;
+  };
+  "0.15.0" = {
+    sha256 = "1p037kqj5858xrhh0dps6vbf4fnijla6z9fjz5zigvnqp4i2xkrn";
+    min_version = "4.07";
+    max_version = "4.12";
+    useOMP2 = false;
+  };
+  "0.18.0" = {
+    sha256 = "1ciy6va2gjrpjs02kha83pzh0x1gkmfsfsdgabbs1v14a8qgfibm";
+    min_version = "4.07";
+    max_version = "4.12";
+  };
+  "0.22.0" = {
+    sha256 = "0kf7lgcwygf6zlx7rwddqpqvasa6v7xiq0bqal8vxlib6lpg074q";
+    min_version = "4.07";
+  };
+  "0.22.2" = {
+    sha256 = "0fysjqcpv281n52wl3h0dy2lzf9d61wdzk90ldv3p63a4i3mr1j2";
+    min_version = "4.07";
+  };
+}."${version}"; in
+
+if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
+|| param ? min_version && !lib.versionAtLeast ocaml.version param.min_version
+then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage rec {
+  pname = "ppxlib";
+  inherit version;
+
+  useDune2 = param.useDune2 or true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-ppx";
+    repo = pname;
+    rev = version;
+    inherit (param) sha256;
+  };
+
+  propagatedBuildInputs = [
+    ocaml-compiler-libs
+    (if param.useOMP2 or true
+     then ocaml-migrate-parsetree-2
+     else ocaml-migrate-parsetree)
+    ppx_derivers
+    stdio
+    stdlib-shims
+  ];
+
+  meta = {
+    description = "Comprehensive ppx tool set";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (src.meta) homepage;
+  };
+}
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..04361de72221
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/printbox/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, uucp, uutf, mdx }:
+
+buildDunePackage rec {
+  pname = "printbox";
+  version = "0.5";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = version;
+    sha256 = "099yxpp7d9bms6dwzp9im7dv1qb801hg5rx6awpx3rpfl4cvqfn2";
+  };
+
+  checkInputs = [ uucp uutf mdx.bin ];
+
+  # mdx is not available for OCaml < 4.07
+  doCheck = lib.versionAtLeast ocaml.version "4.07";
+
+  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/process/default.nix b/nixpkgs/pkgs/development/ocaml-modules/process/default.nix
new file mode 100644
index 000000000000..aecf03987ab1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/process/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-process-${version}";
+  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/prof_spacetime/default.nix b/nixpkgs/pkgs/development/ocaml-modules/prof_spacetime/default.nix
new file mode 100644
index 000000000000..91e30e155db4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/prof_spacetime/default.nix
@@ -0,0 +1,43 @@
+{ buildDunePackage
+, lib
+, fetchFromGitHub
+, cmdliner
+, spacetime_lib
+, yojson
+, cohttp
+, ocaml_lwt
+, cohttp-lwt-unix
+, lambdaTerm
+, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "prof_spacetime";
+  version = "0.3.0";
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "lpw25";
+    repo = pname;
+    rev = version;
+    sha256 = "1s88gf6x5almmyi58zx4q23w89mvahfjwhvyfg29ya5s1pjbc9hi";
+  };
+
+  buildInputs = [
+    cmdliner
+    spacetime_lib
+    yojson
+    cohttp
+    ocaml_lwt
+    cohttp-lwt-unix
+    lambdaTerm
+    stdlib-shims
+  ];
+
+  meta = {
+    description = "A viewer for OCaml spacetime profiles";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.symphorien ];
+    inherit (src.meta) homepage;
+  };
+}
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..a3c0a5add3d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/progress/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildDunePackage, fetchurl
+, mtime, terminal_size, alcotest, astring, fmt
+}:
+
+buildDunePackage rec {
+  pname = "progress";
+  version = "0.1.1";
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/CraigFe/progress/releases/download/${version}/progress-${version}.tbz";
+    sha256 = "90c6bec19d014a4c6b0b67006f08bdfcf36981d2176769bebe0ccd75d6785a32";
+  };
+
+  propagatedBuildInputs = [ mtime terminal_size ];
+
+  doCheck = true;
+  checkInputs = [ alcotest astring fmt ];
+
+  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/psmt2-frontend/default.nix b/nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix
new file mode 100644
index 000000000000..dbdf3970f636
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/psmt2-frontend/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, menhir }:
+
+buildDunePackage rec {
+  version = "0.3.1";
+  pname = "psmt2-frontend";
+
+  src = fetchFromGitHub {
+    owner = "ACoquereau";
+    repo = pname;
+    rev = version;
+    sha256 = "038jrfsq09nhnzpjiishg4adk09w3aw1bpczgbj66lqqilkd6gci";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  buildInputs = [ menhir ];
+
+  meta = {
+    description = "A 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..f7c2f3497a11
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/psq/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, ocaml, fetchurl, seq, qcheck-alcotest }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.03";
+  pname = "psq";
+  version = "0.2.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/pqwy/psq/releases/download/v${version}/psq-v${version}.tbz";
+    sha256 = "1j4lqkq17rskhgcrpgr4n1m1a2b1x35mlxj6f9g05rhpmgvgvknk";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  doCheck = lib.versionAtLeast ocaml.version "4.07";
+  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..d99ec7ed3208
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ptime/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, result, js_of_ocaml
+, jsooSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.8.5";
+  name = "ocaml${ocaml.version}-ptime-${version}";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/ptime/releases/ptime-${version}.tbz";
+    sha256 = "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg ]
+    ++ lib.optional jsooSupport js_of_ocaml;
+
+  propagatedBuildInputs = [ result ];
+
+  buildPhase = "${topkg.run} build --with-js_of_ocaml ${lib.boolToString jsooSupport}";
+
+  inherit (topkg) installPhase;
+
+  meta = {
+    homepage = "https://erratique.ch/software/ptime";
+    description = "POSIX time for OCaml";
+    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.
+    '';
+    license = lib.licenses.isc;
+    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..018f1e3edf06
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ptmap/default.nix
@@ -0,0 +1,29 @@
+{ 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";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  doCheck = true;
+
+  checkInputs = [ stdlib-shims ];
+
+  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; [ volth ];
+  };
+}
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/pycaml/default.nix b/nixpkgs/pkgs/development/ocaml-modules/pycaml/default.nix
new file mode 100644
index 000000000000..1aa2590f2ae5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/pycaml/default.nix
@@ -0,0 +1,46 @@
+{stdenv, fetchurl, ocaml, findlib, ncurses, python, ocaml_make}:
+
+# This is the original pycaml version with patches from debian.
+
+stdenv.mkDerivation {
+  name = "pycaml-0.82-14";
+
+  srcs = [
+    (fetchurl {
+      url = "mirror://debian/pool/main/p/pycaml/pycaml_0.82.orig.tar.gz";
+      sha256 = "d57be559c8d586c575717d47817986bbdbcebe2ffd16ad6b291525c62868babe";
+    })
+
+    (fetchurl {
+      url = "mirror://debian/pool/main/p/pycaml/pycaml_0.82-14.debian.tar.gz";
+      sha256 = "a763088ec1fa76c769bf586ed6692e7ac035b0a2bfd48a90a8e7a9539ec0c2f1";
+    })
+  ];
+
+  postPatch = ''
+    rm -f Makefile* configure*
+    cp ../debian/META ../debian/Makefile .
+    sed -i "Makefile" -e's|/usr/share/ocamlmakefile/OCamlMakefile|${ocaml_make}/include/OCamlMakefile|g'
+  '';
+
+  sourceRoot = "pycaml";
+  patches = [ "../debian/patches/*.patch" ];
+
+  buildInputs = [ ncurses ocaml findlib python ocaml_make ];
+  createFindlibDestdir = true;
+
+  # the Makefile is not shipped with an install target, hence we do it ourselves.
+  installPhase = ''
+    ocamlfind install pycaml \
+     dllpycaml_stubs.so libpycaml_stubs.a pycaml.a pycaml.cma \
+     pycaml.cmi pycaml.cmo pycaml.cmx pycaml.cmxa \
+     META
+  '';
+
+  meta = {
+    homepage = "https://github.com/chemoelectric/pycaml";
+    description = "Bindings for python and ocaml";
+    license = "LGPL";
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..aebe6bd95a85
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, qcheck-core, alcotest }:
+
+buildDunePackage {
+  pname = "qcheck-alcotest";
+
+  inherit (qcheck-core) version useDune2 src;
+
+  propagatedBuildInputs = [ qcheck-core alcotest ];
+
+  meta = qcheck-core.meta // {
+    description = "Alcotest backend for qcheck";
+  };
+}
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..e1b3503b5418
--- /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.17";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "qcheck";
+    rev = version;
+    sha256 = "0qfyqhfg98spmfci9z6f527a16gwjnx2lrbbgw67p37ys5acrfar";
+  };
+
+  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..dc73f42a13b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, qcheck-ounit }:
+
+buildDunePackage {
+  pname = "qcheck";
+
+  inherit (qcheck-ounit) version useDune2 src;
+
+  propagatedBuildInputs = [ qcheck-ounit ];
+
+  meta = qcheck-ounit.meta // {
+    description = "Compatibility package for qcheck";
+  };
+
+}
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..62b082f48fb2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, qcheck-core, ounit }:
+
+buildDunePackage {
+  pname = "qcheck-ounit";
+
+  inherit (qcheck-core) version useDune2 src;
+
+  propagatedBuildInputs = [ qcheck-core ounit ];
+
+  meta = qcheck-core.meta // {
+    description = "OUnit backend for qcheck";
+  };
+
+}
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..5e9a89a83769
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qtest/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildDunePackage, fetchFromGitHub, qcheck }:
+
+buildDunePackage rec {
+  pname = "qtest";
+  version = "2.11.2";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "vincent-hugot";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-VLY8+Nu6md0szW4RVxTFwlSQ9kyrgUqf7wQEA6GW8BE=";
+  };
+
+  propagatedBuildInputs = [ qcheck ];
+
+  meta = {
+    description = "Inline (Unit) Tests for OCaml";
+    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..078d50da895b
--- /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";
+
+  useDune2 = true;
+
+  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/re/default.nix b/nixpkgs/pkgs/development/ocaml-modules/re/default.nix
new file mode 100644
index 000000000000..4734d4a9bf52
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/re/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchurl, buildDunePackage, ocaml, ounit, seq }:
+
+buildDunePackage rec {
+  pname = "re";
+  version = "1.9.0";
+
+  minimumOCamlVersion = "4.02";
+
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz";
+    sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
+  };
+
+  buildInputs = lib.optional doCheck ounit;
+  propagatedBuildInputs = [ seq ];
+  doCheck = lib.versionAtLeast ocaml.version "4.04";
+
+  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..7ae3e8e66f33
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/react/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild }:
+
+stdenv.mkDerivation {
+  name = "ocaml-react-1.2.1";
+
+  src = fetchurl {
+    url = "https://erratique.ch/software/react/releases/react-1.2.1.tbz";
+    sha256 = "1aj8w79gdd9xnrbz7s5p8glcb4pmimi8jp9f439dqnf6ih3mqb3v";
+  };
+
+  buildInputs = [ ocaml findlib topkg ocamlbuild ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    homepage = "https://erratique.ch/software/react";
+    description = "Applicative events and signals for OCaml";
+    license = licenses.bsd3;
+    platforms = ocaml.meta.platforms or [];
+    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..899547a937be
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reactivedata/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, react, opaline }:
+
+if !lib.versionAtLeast ocaml.version "4.04"
+then throw "reactiveData is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-reactiveData-0.2.2";
+  src = fetchurl {
+    url = "https://github.com/ocsigen/reactiveData/archive/0.2.2.tar.gz";
+    sha256 = "0jzagyp4zla28wykvcgqwd8df71ir0vb4s8akp02cfacd5v86sng";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild opaline ];
+  propagatedBuildInputs = [ react ];
+
+  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
+
+  installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
+
+  meta = with lib; {
+    description = "An OCaml module for functional reactive programming (FRP) based on React";
+    homepage = "https://github.com/ocsigen/reactiveData";
+    license = licenses.lgpl21;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
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..1a4c020dc352
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/cli.nix
@@ -0,0 +1,11 @@
+{ re, reason, pastel, ... }:
+
+{
+  pname = "cli";
+
+  buildInputs = [
+    re
+    reason
+    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..c11c12b46730
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/console.nix
@@ -0,0 +1,21 @@
+{ buildDunePackage, callPackage, reason, console, ... }:
+
+{
+  pname = "console";
+
+  buildInputs = [
+    reason
+  ];
+
+  passthru.tests = {
+    console = callPackage ./tests/console {
+      inherit buildDunePackage reason console;
+    };
+  };
+
+  meta = {
+    description = "A 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..f65aa5159b9d
--- /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 }:
+
+let
+  generic = (somePath:
+    let
+      prepkg = import somePath {
+        inherit callPackage cli buildDunePackage atdgen junit qcheck-core re reason;
+        inherit (reason-native) console file-context-printer fp pastel rely;
+      };
+    in
+      buildDunePackage
+        ({
+          version = "2021-16-16-aec0ac6";
+          src = fetchFromGitHub {
+            owner = "reasonml";
+            repo = "reason-native";
+            rev = "aec0ac681be7211b4d092262281689c46deb63e1";
+            sha256 = "sha256-QoyI50MBY3RJBmM1y90n7oXrLmHe0CQxKojv+7YbegE=";
+          };
+          useDune2 = true;
+          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; [ superherointj ];
+          } // (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..e6eb9c0c403f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/dir.nix
@@ -0,0 +1,18 @@
+{ reason, fp, ... }:
+
+{
+  pname = "dir";
+
+  buildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    fp
+  ];
+
+  meta = {
+    description = "A 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..749e727feeca
--- /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";
+
+  buildInputs = [
+    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..ae6ae50705d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/fp.nix
@@ -0,0 +1,14 @@
+{ reason, ... }:
+
+{
+  pname = "fp";
+
+  buildInputs = [
+    reason
+  ];
+
+  meta = {
+    description = "A 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..f1d2c7cc7264
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel-console.nix
@@ -0,0 +1,20 @@
+{ reason, console, pastel, ... }:
+
+{
+  pname = "pastel-console";
+
+  buildInputs = [
+    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..a5abc4e219c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/pastel.nix
@@ -0,0 +1,20 @@
+{ reason, re, ... }:
+
+{
+  pname = "pastel";
+
+  minimalOCamlVersion = "4.05";
+
+  buildInputs = [
+    reason
+  ];
+  propagatedBuildInputs = [
+    re
+  ];
+
+  meta = {
+    description = "A 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..a3d297b4f5a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix
@@ -0,0 +1,20 @@
+{ qcheck-core, reason, console, rely, ... }:
+
+{
+  pname = "qcheck-rely";
+
+  buildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    qcheck-core
+    console
+    rely
+  ];
+
+  meta = {
+    description = "A 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..9b14d4a8ba31
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/refmterr.nix
@@ -0,0 +1,21 @@
+{ atdgen, re, reason, pastel, ... }:
+
+{
+  pname = "refmterr";
+
+  buildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    atdgen
+    re
+    pastel
+  ];
+
+  meta = {
+    description = "An 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..6e8b41bbd1c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix
@@ -0,0 +1,23 @@
+{ atdgen, junit, re, reason, pastel, rely, ... }:
+
+{
+  pname = "rely-junit-reporter";
+
+  buildInputs = [
+    atdgen
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    junit
+    re
+    pastel
+    rely
+  ];
+
+  meta = {
+    description = "A 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..a2230426bec1
--- /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";
+
+  buildInputs = [
+    reason
+  ];
+
+  propagatedBuildInputs = [
+    re
+    cli
+    file-context-printer
+    pastel
+  ];
+
+  meta = {
+    description = "A 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..e1a995d33c5c
--- /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 = ./.;
+
+  useDune2 = true;
+
+  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/repr/default.nix b/nixpkgs/pkgs/development/ocaml-modules/repr/default.nix
new file mode 100644
index 000000000000..282d24d9b73b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/repr/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl, base64, either, fmt, jsonm, uutf }:
+
+buildDunePackage rec {
+  pname = "repr";
+  version = "0.4.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/${version}/${pname}-fuzz-${version}.tbz";
+    sha256 = "1kpwgncyxcrq90dn7ilja7c5i88whc3fz4fmq1lwr0ar95d7d48p";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    base64
+    either
+    fmt
+    jsonm
+    uutf
+  ];
+
+  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..561015254d75
--- /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 useDune2;
+
+  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/resource-pooling/default.nix b/nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix
new file mode 100644
index 000000000000..51407f6b49df
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resource-pooling/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, lwt_log }:
+
+buildDunePackage rec {
+  version = "1.1";
+  pname = "resource-pooling";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.06";
+
+  src = fetchFromGitHub {
+    owner = "ocsigen";
+    repo = pname;
+    rev = version;
+    sha256 = "0wsbnwszafdv3gsiiaslgf6m6pfx74h7h19i0gp2c4ivdiv3wck9";
+  };
+
+  propagatedBuildInputs = [ lwt_log ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "A 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..7ac05cd62da8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/acl.nix
@@ -0,0 +1,13 @@
+{ lib, buildDunePackage, resto, uri }:
+
+buildDunePackage {
+  pname = "resto-acl";
+  inherit (resto) src version meta useDune2 doCheck;
+
+    minimalOCamlVersion = "4.05";
+
+  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..2dc651045ba5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-client.nix
@@ -0,0 +1,20 @@
+{ buildDunePackage
+, resto
+, resto-directory
+, resto-cohttp
+, uri
+, lwt
+}:
+
+buildDunePackage {
+  pname = "resto-cohttp-client";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  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..88f2ef25e6a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix
@@ -0,0 +1,27 @@
+{ 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 useDune2 doCheck;
+
+  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..61a5d93e9fc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp-server.nix
@@ -0,0 +1,25 @@
+{ 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 useDune2 doCheck;
+
+  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..c29e589057c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/cohttp.nix
@@ -0,0 +1,12 @@
+{ buildDunePackage, resto, resto-directory, cohttp-lwt }:
+
+buildDunePackage {
+  pname = "resto-cohttp";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  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..13d55b1af210
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitLab, buildDunePackage, uri }:
+
+buildDunePackage rec {
+  pname = "resto";
+  version = "0.6.1";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "resto";
+    rev = "v${version}";
+    sha256 = "13h3zga7h2jhgbyda1q53szbpxcz3vvy3c51mlqk3jh9jq2wrn87";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    uri
+  ];
+
+  # resto has infinite recursion in their tests
+  doCheck = false;
+
+  meta = {
+    description = "A 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..7539bf98ffd6
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/directory.nix
@@ -0,0 +1,11 @@
+{ lib, buildDunePackage, resto, resto-json, lwt }:
+
+buildDunePackage {
+  pname = "resto-directory";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  propagatedBuildInputs = [
+    resto
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto-directory.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto-directory.nix
new file mode 100644
index 000000000000..fa208cc3fbb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto-directory.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, resto, resto-directory, ezresto, lwt }:
+
+buildDunePackage {
+  pname = "ezresto-directory";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  propagatedBuildInputs = [
+    ezresto
+    resto-directory
+    resto
+    lwt
+  ];
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto.nix b/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto.nix
new file mode 100644
index 000000000000..8b3b2c6cd71f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/ezresto.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, resto, resto-json, uri }:
+
+buildDunePackage {
+  pname = "ezresto";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  propagatedBuildInputs = [
+    uri
+    resto
+    resto-json
+  ];
+}
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..e861cac6d319
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/resto/json.nix
@@ -0,0 +1,12 @@
+{ lib, buildDunePackage, resto, json-data-encoding, json-data-encoding-bson }:
+
+buildDunePackage {
+  pname = "resto-json";
+  inherit (resto) src version meta useDune2 doCheck;
+
+  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..40356ec9aa5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rfc7748/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildDunePackage
+, fetchFromGitHub
+, ocaml
+
+, ounit
+, zarith
+}:
+
+buildDunePackage rec {
+  pname = "rfc7748";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "burgerdev";
+    repo = "ocaml-rfc7748";
+    rev = "v${version}";
+    sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4=";
+  };
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.05";
+
+  propagatedBuildInputs = [ zarith ];
+
+  # the tests fail for 4.05
+  doCheck = lib.versionAtLeast ocaml.version "4.06";
+  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..7bfd38b869da
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ringo/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "ringo";
+  version = "0.5";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ringo";
+    rev = "v${version}";
+    sha256 = "1zwha0ycv3rm3qnw7nkg2m08ibx39yxnx5fan4lnn82b0pdasjag";
+  };
+
+  minimalOCamlVersion = "4.05";
+
+  useDune2 = true;
+
+  doCheck = true;
+
+  # If we just run the test as is it will try to test ringo-lwt
+  checkPhase = "dune build @test/runtest";
+
+  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/ringo/lwt.nix b/nixpkgs/pkgs/development/ocaml-modules/ringo/lwt.nix
new file mode 100644
index 000000000000..be9f5bbf2b22
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ringo/lwt.nix
@@ -0,0 +1,17 @@
+{ lib, buildDunePackage, ringo, lwt }:
+
+buildDunePackage {
+  pname = "ringo-lwt";
+  inherit (ringo) version src doCheck useDune2;
+
+  minimalOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    ringo
+    lwt
+  ];
+
+  meta = ringo.meta // {
+    description = "Lwt-wrappers for Ringo caches";
+  };
+}
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..f29219e30c24
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rope/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, dune_2, benchmark }:
+
+let param =
+  if lib.versionAtLeast ocaml.version "4.03"
+  then rec {
+    version = "0.6.2";
+    url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
+    sha256 = "15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
+    buildInputs = [ dune_2 ];
+    extra = {
+      buildPhase = "dune build -p rope";
+      installPhase = ''
+        dune install --prefix $out --libdir $OCAMLFIND_DESTDIR rope
+      '';
+    };
+  } else {
+    version = "0.5";
+    url = "https://forge.ocamlcore.org/frs/download.php/1156/rope-0.5.tar.gz";
+    sha256 = "05fr2f5ch2rqhyaj06rv5218sbg99p1m9pq5sklk04hpslxig21f";
+    buildInputs = [ ocamlbuild ];
+    extra = { createFindlibDestdir = true; };
+  };
+in
+
+stdenv.mkDerivation ({
+  name = "ocaml${ocaml.version}-rope-${param.version}";
+
+  src = fetchurl {
+    inherit (param) url sha256;
+  };
+
+  buildInputs = [ ocaml findlib benchmark ] ++ param.buildInputs;
+
+  meta = {
+    homepage = "http://rope.forge.ocamlcore.org/";
+    platforms = ocaml.meta.platforms or [];
+    description = ''Ropes ("heavyweight strings") in OCaml'';
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ volth ];
+  };
+} // param.extra)
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..a83d0db5d84d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/routes/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchurl, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "routes";
+  version = "0.9.1";
+
+  useDune2 = true;
+  minimalOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/anuragsoni/routes/releases/download/${version}/routes-${version}.tbz";
+    sha256 = "0h2c1p5w6237c1lmsl5c8q2dj5dq20gf2cmb12nbmlfn12sfmcrl";
+  };
+
+  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..311c4caaadae
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rpclib/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage
+, alcotest
+, base64, cmdliner, rresult, xmlm, yojson
+}:
+
+buildDunePackage rec {
+  pname = "rpclib";
+  version = "8.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-rpc/releases/download/v${version}/rpclib-v${version}.tbz";
+    sha256 = "0fbajg8wq8hjhkvvfnq68br0m0pa8zf2qzadhfgi2nnr9713rada";
+  };
+
+  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..49f718474980
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rpclib/lwt.nix
@@ -0,0 +1,18 @@
+{ lib, buildDunePackage, rpclib
+, lwt
+, alcotest-lwt, ppx_deriving_rpc, yojson
+}:
+
+buildDunePackage {
+  pname = "rpclib-lwt";
+  inherit (rpclib) version useDune2 src;
+
+  propagatedBuildInputs = [ lwt rpclib ];
+
+  checkInputs = [ alcotest-lwt ppx_deriving_rpc yojson ];
+  doCheck = true;
+
+  meta = rpclib.meta // {
+    description = "A 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..04631cc3b4bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/rresult/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-rresult-${version}";
+  version = "0.6.0";
+  src = fetchurl {
+    url = "https://erratique.ch/software/rresult/releases/rresult-${version}.tbz";
+    sha256 = "1k69a3gvrk7f2cshwjzvk7818f0bwxhacgd14wxy6d4gmrggci86";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ result ];
+
+  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/safepass/default.nix b/nixpkgs/pkgs/development/ocaml-modules/safepass/default.nix
new file mode 100644
index 000000000000..e8a50f45119e
--- /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 = "An 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/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..30ac2cfb22dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sawja/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, which, perl, ocaml, findlib, javalib }:
+
+let
+  pname = "sawja";
+  version = "1.5.8";
+  webpage = "http://sawja.inria.fr/";
+in
+
+if !lib.versionAtLeast ocaml.version "4.07"
+then throw "${pname} is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "javalib-team";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0rawr0jav33rvagm8sxc0arc7ya1fd9w5nng3lhfk8p02f9z8wrp";
+  };
+
+  buildInputs = [ which perl ocaml findlib ];
+
+  patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
+
+  createFindlibDestdir = true;
+
+  preConfigure = "patchShebangs ./configure.sh";
+
+  configureScript = "./configure.sh";
+  dontAddPrefix = "true";
+  dontAddStaticConfigureFlags = true;
+  configurePlatforms = [];
+
+  propagatedBuildInputs = [ javalib ];
+
+  meta = with lib; {
+    description = "A library written in OCaml, relying on Javalib to provide a high level representation of Java bytecode programs";
+    homepage = webpage;
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..f7d3c1e41c56
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/secp256k1-internal/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, gmp
+, dune-configurator
+, cstruct
+, bigstring
+, alcotest
+, hex
+}:
+
+buildDunePackage rec {
+  pname = "secp256k1-internal";
+  version = "0.2";
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ocaml-secp256k1-internal";
+    rev = "v${version}";
+    sha256 = "1g9fyi78nmmm19l2cggwj14m4n80rz7gmnh1gq376zids71s6qxv";
+  };
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  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..7ad18fba81c6
--- /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.1";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "dakk";
+    repo = "secp256k1-ml";
+    rev = version;
+    sha256 = "0jkd7mc5kynhg0b76dfk70pww97qsq2jbd991634i16xf8qja9fj";
+  };
+
+  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/2.nix b/nixpkgs/pkgs/development/ocaml-modules/sedlex/2.nix
new file mode 100644
index 000000000000..9f4badbc7cad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sedlex/2.nix
@@ -0,0 +1,67 @@
+{ lib
+, fetchFromGitHub
+, fetchurl
+, buildDunePackage
+, ocaml
+, gen
+, ppxlib
+, uchar
+}:
+
+if lib.versionOlder ocaml.version "4.08"
+then throw "sedlex is not available for OCaml ${ocaml.version}"
+else
+
+let
+  unicodeVersion = "13.0.0";
+  baseUrl = "https://www.unicode.org/Public/${unicodeVersion}";
+
+  DerivedCoreProperties = fetchurl {
+    url = "${baseUrl}/ucd/DerivedCoreProperties.txt";
+    sha256 = "0j12x112cd8fpgazkc8izxnhhpia44p1m36ff8yapslxndcmzm55";
+  };
+  DerivedGeneralCategory = fetchurl {
+    url = "${baseUrl}/ucd/extracted/DerivedGeneralCategory.txt";
+    sha256 = "0w6mkz4w79k23bnmwgfxc4yqc2ypv8ilrjn6nk25hrafksbg00j5";
+  };
+  PropList = fetchurl {
+    url = "${baseUrl}/ucd/PropList.txt";
+    sha256 = "1ks0585wimygbk2wqi9hqg8gyl25iffvdad5vya1zgsxs8z5lns8";
+  };
+in
+buildDunePackage rec {
+  pname = "sedlex";
+  version = "2.4";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = "sedlex";
+    rev = "v${version}";
+    sha256 = "13g8az4zqg6hrnxmy3qrasslppzlag13dd1dsr8vlpg2vpfmfv6i";
+  };
+
+  propagatedBuildInputs = [
+    gen uchar ppxlib
+  ];
+
+  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
+  '';
+
+  doCheck = true;
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://github.com/ocaml-community/sedlex";
+    changelog = "https://github.com/ocaml-community/sedlex/raw/v${version}/CHANGES";
+    description = "An OCaml lexer generator for Unicode";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.marsam ];
+  };
+}
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..3a9f87bd93ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sedlex/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchzip, ocaml, findlib, gen, ppx_tools_versioned, ocaml-migrate-parsetree }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "sedlex is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-sedlex-${version}";
+  version = "1.99.5";
+
+  src = fetchzip {
+    url = "https://github.com/ocaml-community/sedlex/archive/fb84e1766fc4b29e79ec40029ffee5cdb37b392f.tar.gz";
+    sha256 = "0phnqyn6mpv5byr1kkphl24y9q9fb2k3xg9yb457h5816q6ya72n";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  propagatedBuildInputs = [ gen ocaml-migrate-parsetree ppx_tools_versioned ];
+
+  buildFlags = [ "all" "opt" ];
+
+  createFindlibDestdir = true;
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://github.com/ocaml-community/sedlex";
+    description = "An OCaml lexer generator for Unicode";
+    license = lib.licenses.mit;
+    inherit (ocaml.meta) platforms;
+    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/seq/default.nix b/nixpkgs/pkgs/development/ocaml-modules/seq/default.nix
new file mode 100644
index 000000000000..44503668ff0a
--- /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";
+  name = "ocaml${ocaml.version}-seq-0.1";
+
+  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/sha/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sha/default.nix
new file mode 100644
index 000000000000..80a5205a2301
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sha/default.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, buildDunePackage, stdlib-shims, ounit }:
+
+buildDunePackage rec {
+  pname = "sha";
+  version = "1.14";
+
+  src = fetchurl {
+    url = "https://github.com/djs55/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "114vydrfdp7fayigvgk3ckiby0kh4n49c1j53v8k40gk6nzm3l19";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    stdlib-shims
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    ounit
+  ];
+
+  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..3a96d4adee4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, ppx_cstruct
+, mirage-profile
+, cstruct
+, ounit
+}:
+
+buildDunePackage rec {
+  pname = "shared-memory-ring";
+  version = "3.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/shared-memory-ring/releases/download/v${version}/shared-memory-ring-v${version}.tbz";
+    sha256 = "06350ph3rdfvybi0cgs3h3rdkmjspk3c4375rxvbdg0kza1w22x1";
+  };
+
+  nativeBuildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    mirage-profile
+    cstruct
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    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..8f41253bab8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix
@@ -0,0 +1,37 @@
+{ 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 useDune2;
+
+  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/sodium/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix
new file mode 100644
index 000000000000..dc090e91743f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sodium/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
+
+if lib.versionAtLeast ocaml.version "4.10"
+then throw "sodium is not available for OCaml ${ocaml.version}"
+else
+
+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
+  ];
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ ctypes libsodium ];
+
+  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+";
+    platforms = ocaml.meta.platforms or [];
+    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..3687f2be9974
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sosa/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitHub, stdenv
+, findlib, ocaml, ocamlbuild
+}:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "sosa is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-sosa-${version}";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "hammerlab";
+    repo = "sosa";
+    rev = "sosa.${version}";
+    sha256 = "053hdv6ww0q4mivajj4iyp7krfvgq8zajq9d8x4mia4lid7j0dyk";
+  };
+
+  buildInputs = [ ocaml ocamlbuild findlib ];
+
+  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/spacetime_lib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/default.nix
new file mode 100644
index 000000000000..009b2ce32619
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/spacetime_lib/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, buildDunePackage, owee }:
+
+buildDunePackage rec {
+  pname = "spacetime_lib";
+  version = "0.3.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "lpw25";
+    repo = "spacetime_lib";
+    rev = version;
+    sha256 = "0biisgbycr5v3nm5jp8i0h6vq76vzasdjkcgh8yr7fhxc81jgv3p";
+  };
+
+  propagatedBuildInputs = [ owee ];
+
+  preConfigure = ''
+    bash ./configure.sh
+  '';
+
+  meta = {
+    description = "An OCaml library providing some simple operations for handling OCaml “spacetime” profiles";
+    inherit (src.meta) homepage;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+}
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..9df0779e53a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/spelll/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, buildDunePackage
+, seq
+}:
+
+buildDunePackage rec {
+  pname = "spelll";
+  version = "0.3";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "03adqisgsazsxdkrypp05k3g91hydfgcif2014il63gdbd9nhzlh";
+  };
+
+  propagatedBuildInputs = [ seq ];
+
+  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/sqlite3/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sqlite3/default.nix
new file mode 100644
index 000000000000..90b469288c7f
--- /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.0.2";
+  useDune2 = true;
+  minimumOCamlVersion = "4.05";
+
+  src = fetchurl {
+    url = "https://github.com/mmottl/sqlite3-ocaml/releases/download/${version}/sqlite3-${version}.tbz";
+    sha256 = "0sba74n0jvzxibrclhbpqscil36yfw7i9jj9q562yhza6rax9p82";
+  };
+
+  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/sqlite3EZ/default.nix b/nixpkgs/pkgs/development/ocaml-modules/sqlite3EZ/default.nix
new file mode 100644
index 000000000000..b6a5dc5ecaad
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/sqlite3EZ/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, twt, ocaml_sqlite3 }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "3.12";
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "sqlite3EZ is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation {
+  name = "ocaml-sqlite3EZ-0.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/mlin/ocaml-sqlite3EZ/archive/v0.1.0.tar.gz";
+    sha256 = "8ed2c5d5914a65cbd95589ef11bfb8b38a020eb850cdd49b8adce7ee3a563748";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild twt ];
+
+  propagatedBuildInputs = [ ocaml_sqlite3 ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/mlin/ocaml-sqlite3EZ";
+    description = "A thin wrapper for sqlite3-ocaml with a simplified interface";
+    license = licenses.mit;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..7f0897ae6626
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/srt/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchFromGitHub
+, dune-configurator
+, posix-socket
+, srt
+}:
+
+buildDunePackage rec {
+  pname = "srt";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-srt";
+    rev = "v${version}";
+    sha256 = "0xh89w4j7lljvpy2n08x6m9kw88f82snmzf23kp0gw637sjnrj6f";
+  };
+
+  useDune2 = true;
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ posix-socket srt ];
+
+  meta = {
+    description = "OCaml bindings for the libsrt library";
+    license = lib.licenses.gpl2Only;
+    inherit (src.meta) homepage;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
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..1f4fd7b85805
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ssl/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchFromGitHub, pkg-config, openssl
+, dune-configurator }:
+
+buildDunePackage rec {
+  pname = "ssl";
+  version = "0.5.10";
+
+  src = fetchFromGitHub {
+    owner = "savonet";
+    repo = "ocaml-ssl";
+    rev = "v${version}";
+    sha256 = "1rszqiqayh67xlwd5411k8vib47x9kapdr037z1majd2c14z3kcb";
+  };
+
+  useDune2 = true;
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [openssl];
+
+  meta = {
+    homepage = "http://savonet.rastageeks.org/";
+    description = "OCaml bindings for libssl ";
+    license = "LGPL+link exception";
+    maintainers = [
+      lib.maintainers.maggesi
+      lib.maintainers.anmonteiro
+    ];
+  };
+}
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..df5c1a58b17b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdcompat/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchurl
+, ocaml, findlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-stdcompat";
+  version = "15";
+
+  src = fetchurl {
+    url = "https://github.com/thierry-martinez/stdcompat/releases/download/v${version}/stdcompat-${version}.tar.gz";
+    sha256 = "1xcwb529m4lg9cbnxa9m3x2nnl9nxzz1x5lxpvdfflg4zxl6yx2y";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  configureFlags = "--libdir=$(OCAMLFIND_DESTDIR)";
+
+  meta = {
+    homepage = "https://github.com/thierry-martinez/stdcompat";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
+  };
+}
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..52d97e12998f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix
@@ -0,0 +1,47 @@
+{ lib, fetchurl, fetchpatch, buildDunePackage, qcheck }:
+
+buildDunePackage rec {
+  pname = "stdint";
+  version = "0.7.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
+    sha256 = "4fcc66aef58e2b96e7af3bbca9d910aa239e045ba5fb2400aaef67d0041252dc";
+  };
+
+  patches = [
+    # fix test bug, remove at next release
+    (fetchpatch {
+      url = "https://github.com/andrenth/ocaml-stdint/commit/fc64293f99f597cdfd4470954da6fb323988e2af.patch";
+      sha256 = "0nxck14vfjfzldsf8cdj2jg1cvhnyh37hqnrcxbdkqmpx4rxkbxs";
+    })
+  ];
+
+  # 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"' \
+      --replace 'let pos_int = QCheck.map_same_type abs in_range' \
+                'let pos_int = QCheck.int_range 0 maxi'
+  '';
+
+  doCheck = true;
+  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..470a2a5bd030
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/stdlib-shims/default.nix
@@ -0,0 +1,19 @@
+{ 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";
+  };
+  useDune2 = lib.versionAtLeast ocaml.version "4.08";
+  minimumOCamlVersion = "4.02";
+  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/stringext/default.nix b/nixpkgs/pkgs/development/ocaml-modules/stringext/default.nix
new file mode 100644
index 000000000000..8aaf36baa8b5
--- /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.04"
+}:
+
+let version = "1.6.0"; in
+
+buildDunePackage {
+  pname = "stringext";
+  version = version;
+  useDune2 = true;
+  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..ba967d87446b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/syslog-message/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildDunePackage, fetchurl
+, astring, ptime, rresult, qcheck
+}:
+
+buildDunePackage rec {
+  pname = "syslog-message";
+  version = "1.1.0";
+
+  minimumOCamlVersion = "4.03";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/verbosemode/${pname}/releases/download/${version}/${pname}-${version}.tbz";
+    sha256 = "0vy4dkl2q2fa6rzyfsvjyc9r1b9ymfqd6j35z2kp5vdc4r87053g";
+  };
+
+  propagatedBuildInputs = [
+    astring
+    ptime
+    rresult
+  ];
+
+  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..9614c404c5b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/syslog/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
+
+assert lib.versionAtLeast (lib.getVersion ocaml) "4.03.0";
+
+stdenv.mkDerivation rec {
+  pname = "ocaml${ocaml.version}-syslog";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "rixed";
+    repo = "ocaml-syslog";
+    rev = "v${version}";
+    sha256 = "1kqpc55ppzv9n555qgqpda49n7nvkqimzisyjx2a7338r7q4r5bw";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ];
+  strictDeps = true;
+
+  buildFlags = [ "all" "opt" ];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/rixed/ocaml-syslog";
+    description = "Simple wrapper to access the system logger from OCaml";
+    license = licenses.lgpl21Plus;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ maintainers.rixed ];
+  };
+}
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..635e9aea1171
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tcpip/default.nix
@@ -0,0 +1,75 @@
+{ lib, buildDunePackage, fetchurl
+, bisect_ppx, ppx_cstruct, pkg-config
+, rresult, cstruct, cstruct-lwt, mirage-net, mirage-clock
+, mirage-random, mirage-stack, mirage-protocols, mirage-time
+, ipaddr, macaddr, macaddr-cstruct, mirage-profile, 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
+, withFreestanding ? false
+, ocaml-freestanding
+}:
+
+buildDunePackage rec {
+  pname = "tcpip";
+  version = "6.2.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/mirage-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "d0f6e643ce04da808d5f977c5ab2422cdb4f67e7abdc46dd6776ceada7151e1b";
+  };
+
+  nativeBuildInputs = [
+    bisect_ppx
+    ppx_cstruct
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    rresult
+    cstruct
+    cstruct-lwt
+    mirage-net
+    mirage-clock
+    mirage-random
+    mirage-random-test
+    mirage-stack
+    mirage-protocols
+    mirage-time
+    ipaddr
+    macaddr
+    macaddr-cstruct
+    mirage-profile
+    fmt
+    lwt
+    lwt-dllist
+    logs
+    duration
+    randomconv
+    ethernet
+    lru
+  ] ++ lib.optionals withFreestanding [
+    ocaml-freestanding
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    alcotest
+    mirage-flow
+    mirage-vnetif
+    pcap-format
+    mirage-clock-unix
+    arp
+    ipaddr-cstruct
+  ];
+
+  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..a8ddea79b77f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tcslib/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchFromGitHub, ocamlPackages, buildOasisPackage, ounit, ocaml_extlib, num }:
+
+buildOasisPackage rec {
+  pname = "tcslib";
+  version = "0.3";
+
+  minimumOCamlVersion = "4.03.0";
+
+  src = fetchFromGitHub {
+    owner  = "tcsprojects";
+    repo   = "tcslib";
+    rev    = "v${version}";
+    sha256 = "05g6m82blsccq8wx8knxv6a5fzww7hi624jx91f9h87nk2fsplhi";
+  };
+
+  buildInputs = [ ounit ];
+  propagatedBuildInputs = [ ocaml_extlib num ];
+
+  meta = {
+    homepage = "https://github.com/tcsprojects/tcslib";
+    description = "A multi-purpose library for OCaml";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ mgttlinger ];
+  };
+}
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..9036fc55bef7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/terminal_size/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchurl, alcotest }:
+
+buildDunePackage rec {
+  pname = "terminal_size";
+  version = "0.1.4";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/cryptosense/terminal_size/releases/download/v${version}/terminal_size-v${version}.tbz";
+    sha256 = "fdca1fee7d872c4a8e5ab003d9915b6782b272e2a3661ca877f2d78dd25371a7";
+  };
+
+  checkInputs = [ alcotest ];
+  doCheck = true;
+
+  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/base.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/base.nix
new file mode 100644
index 000000000000..2f5d76581318
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/base.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-crypto
+, tezos-micheline
+, ptime
+, ezjsonm
+, ipaddr
+, qcheck-alcotest
+, crowbar
+}:
+
+buildDunePackage {
+  pname = "tezos-base";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-crypto
+    tezos-micheline
+    ptime
+    ezjsonm
+    ipaddr
+  ];
+
+  checkInputs = [
+    qcheck-alcotest
+    crowbar
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: meta-package and pervasive type definitions for Tezos";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/clic.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/clic.nix
new file mode 100644
index 000000000000..d69174e5f298
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/clic.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-stdlib-unix
+, alcotest
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-clic";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-stdlib-unix
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: library of auto-documented command-line-parsing combinators";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/crypto.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/crypto.nix
new file mode 100644
index 000000000000..9c5bd45f94f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/crypto.nix
@@ -0,0 +1,38 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-clic
+, tezos-rpc
+, bls12-381
+, hacl-star
+, secp256k1-internal
+, uecc
+, ringo
+, ff
+, alcotest
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-crypto";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-clic
+    tezos-rpc
+    bls12-381
+    hacl-star
+    secp256k1-internal
+    uecc
+    ringo
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: library with all the cryptographic primitives used by Tezos";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/error-monad.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/error-monad.nix
new file mode 100644
index 000000000000..70cdff0c0aca
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/error-monad.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, data-encoding
+, lwt
+, lwt-canceler
+, alcotest
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-error-monad";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-stdlib
+    data-encoding
+    lwt
+    lwt-canceler
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: error monad";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/event-logging.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/event-logging.nix
new file mode 100644
index 000000000000..30d6c12087ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/event-logging.nix
@@ -0,0 +1,22 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-lwt-result-stdlib
+, lwt_log
+, alcotest
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-event-logging";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-lwt-result-stdlib
+    lwt_log
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: event logging library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/lmdb.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/lmdb.nix
new file mode 100644
index 000000000000..960b2532c378
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/lmdb.nix
@@ -0,0 +1,51 @@
+{ lib
+, fetchFromGitLab
+, pkg-config
+, buildDunePackage
+, lmdb
+, rresult
+, cstruct
+, alcotest
+}:
+
+buildDunePackage rec {
+  pname = "tezos-lmdb";
+  version = "7.4";
+  src = fetchFromGitLab {
+    owner = "tezos";
+    repo = "tezos";
+    rev = "v${version}";
+    sha256 = "18q02j74aa8mxv233kvyb62xbhjngzpgppp6kgr4m53d7a78wgsm";
+  };
+
+  useDune2 = true;
+
+  preBuild = ''
+    rm dune
+    rm -rf src
+    rm -rf docs
+    ls vendors | grep -v ocaml-lmdb |xargs rm -rf
+  '';
+
+  buildInputs = [
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    rresult
+    lmdb
+  ];
+
+  checkInputs = [
+    cstruct
+    alcotest
+  ];
+
+  doCheck = false;
+
+  meta = {
+    description = "Legacy Tezos OCaml binding to LMDB (Consider ocaml-lmdb instead)";
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix
new file mode 100644
index 000000000000..fe32b7aba74e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildDunePackage
+, ocaml
+, tezos-stdlib
+, tezos-error-monad
+, alcotest
+, alcotest-lwt
+, crowbar
+}:
+
+if lib.versionAtLeast ocaml.version "4.12" then
+  throw "tezos-lwt-result-stdlib-${tezos-stdlib.version} is not available for OCaml > 4.10"
+else
+
+buildDunePackage {
+  pname = "tezos-lwt-result-stdlib";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-error-monad
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    crowbar
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: error-aware stdlib replacement";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/micheline.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/micheline.nix
new file mode 100644
index 000000000000..a729cdef155a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/micheline.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-error-monad
+, uutf
+, alcotest
+, alcotest-lwt
+, ppx_inline_test
+}:
+
+buildDunePackage {
+  pname = "tezos-micheline";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-error-monad
+    uutf
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: internal AST and parser for the Michelson language";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p-services.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p-services.nix
new file mode 100644
index 000000000000..b4243f589f0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p-services.nix
@@ -0,0 +1,18 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+}:
+
+buildDunePackage {
+  pname = "tezos-p2p-services";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-base
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: descriptions of RPCs exported by `tezos-p2p`";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p.nix
new file mode 100644
index 000000000000..b75c03debfa2
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/p2p.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-p2p-services
+, alcotest-lwt
+, lwt-watcher
+}:
+
+buildDunePackage {
+  pname = "tezos-p2p";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-p2p-services
+    lwt-watcher
+  ];
+
+  checkInputs = [
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: library for a pool of P2P connections";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix
new file mode 100644
index 000000000000..5b043eede93d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix
@@ -0,0 +1,19 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-protocol-008-PtEdo2Zk
+, qcheck-alcotest
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-008-PtEdo2Zk-parameters";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-protocol-008-PtEdo2Zk
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos/Protocol: parameters";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix
new file mode 100644
index 000000000000..49a7f0e63801
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-protocol-compiler
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-008-PtEdo2Zk";
+  inherit (tezos-stdlib) version src useDune2 doCheck;
+
+  preBuild = ''
+    rm -rf vendors
+    substituteInPlace src/proto_008_PtEdo2Zk/lib_protocol/dune.inc --replace "-nostdlib" ""
+  '';
+
+  propagatedBuildInputs = [
+    tezos-protocol-compiler
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos/Protocol: economic-protocol definition";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix
new file mode 100644
index 000000000000..a43356d9cbe3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix
@@ -0,0 +1,29 @@
+{ lib
+, buildDunePackage
+, ocaml
+, tezos-stdlib
+, tezos-protocol-environment
+, ocp-ocamlres
+, pprint
+}:
+
+if lib.versionAtLeast ocaml.version "4.12" then
+  throw "tezos-protocol-compiler-${tezos-stdlib.version} is not available for OCaml > 4.10"
+else
+
+buildDunePackage {
+  pname = "tezos-protocol-compiler";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  minimalOCamlVersion = "4.09";
+
+  propagatedBuildInputs = [
+    tezos-protocol-environment
+    ocp-ocamlres
+    pprint
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: economic-protocol compiler";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix
new file mode 100644
index 000000000000..51efe6941840
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix
@@ -0,0 +1,18 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-protocol-compiler
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-demo-noops";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-protocol-compiler
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos/Protocol: demo_noops economic-protocol definition";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix
new file mode 100644
index 000000000000..42662105b95f
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix
@@ -0,0 +1,15 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-environment-packer";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  minimalOCamlVersion = "4.03";
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: sigs/structs packer for economic protocol environment";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix
new file mode 100644
index 000000000000..79b84360a9d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, ocaml
+, tezos-stdlib
+, tezos-protocol-environment-packer
+, zarith
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-environment-sigs";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-protocol-environment-packer
+  ];
+
+  checkInputs = [
+    tezos-stdlib
+  ];
+
+  postPatch = ''
+    cp -f ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith/z.mli ./src/lib_protocol_environment/sigs/v1/z.mli
+    sed -i 's/out_channel/Stdlib.out_channel/g' ./src/lib_protocol_environment/sigs/v1/z.mli
+    sed -i 's/Buffer/Stdlib.Buffer/g' ./src/lib_protocol_environment/sigs/v1/z.mli
+  '';
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: restricted typing environment for the economic protocols";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix
new file mode 100644
index 000000000000..feddca046f8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-crypto
+, tezos-protocol-environment-packer
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-environment-structs";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-crypto
+    tezos-protocol-environment-packer
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: restricted typing environment for the economic protocols";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment.nix
new file mode 100644
index 000000000000..60d9ae29222e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/protocol-environment.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+, tezos-sapling
+, tezos-protocol-environment-sigs
+, tezos-protocol-environment-structs
+, zarith
+, alcotest-lwt
+, crowbar
+}:
+
+buildDunePackage {
+  pname = "tezos-protocol-environment";
+  inherit (tezos-stdlib) version src useDune2 doCheck preBuild;
+
+  propagatedBuildInputs = [
+    tezos-sapling
+    tezos-base
+    tezos-protocol-environment-sigs
+    tezos-protocol-environment-structs
+    zarith # this might break, since they actually want 1.11
+  ];
+
+  checkInputs = [
+    alcotest-lwt
+    crowbar
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: custom economic-protocols environment implementation for `tezos-client` and testing";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/requester.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/requester.nix
new file mode 100644
index 000000000000..d4a2b69eaa8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/requester.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+, tezos-test-services
+, lwt-watcher
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-requester";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-base
+    lwt-watcher
+  ];
+
+  checkInputs = [
+    alcotest-lwt
+    tezos-test-services
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: generic resource fetching service";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/rpc.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/rpc.nix
new file mode 100644
index 000000000000..33450bdf1675
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/rpc.nix
@@ -0,0 +1,22 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-error-monad
+, resto
+, resto-directory
+}:
+
+buildDunePackage {
+  pname = "tezos-rpc";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-error-monad
+    resto
+    resto-directory
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: library of auto-documented RPCs (service and hierarchy descriptions)";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/sapling.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/sapling.nix
new file mode 100644
index 000000000000..40665e380548
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/sapling.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildDunePackage
+, ocaml
+, tezos-stdlib
+, tezos-crypto
+, tezos-rust-libs
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-sapling";
+  inherit (tezos-stdlib) version src useDune2 preBuild;
+
+  propagatedBuildInputs = [
+    tezos-crypto
+    tezos-rust-libs
+  ];
+
+  checkInputs = [
+    alcotest-lwt
+  ];
+
+  doCheck = false;
+
+  # This is a hack to work around the hack used in the dune files
+  OPAM_SWITCH_PREFIX = "${tezos-rust-libs}";
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos/Protocol: economic-protocol definition";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/shell-services.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/shell-services.nix
new file mode 100644
index 000000000000..4e2f40497eb8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/shell-services.nix
@@ -0,0 +1,22 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-workers
+, tezos-p2p-services
+, tezos-version
+}:
+
+buildDunePackage {
+  pname = "tezos-shell-services";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-workers
+    tezos-p2p-services
+    tezos-version
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: descriptions of RPCs exported by `tezos-shell`";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix
new file mode 100644
index 000000000000..2b3a01469a71
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-event-logging
+, lwt
+, ptime
+, mtime
+, ipaddr
+, re
+, alcotest
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-stdlib-unix";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-event-logging
+    lwt
+    ptime
+    mtime
+    ipaddr
+    re
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: yet-another local-extension of the OCaml standard library (unix-specific fragment)";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib.nix
new file mode 100644
index 000000000000..eff403ba808e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/stdlib.nix
@@ -0,0 +1,53 @@
+{ lib
+, fetchFromGitLab
+, buildDunePackage
+, hex
+, lwt
+, zarith
+, alcotest
+, alcotest-lwt
+, crowbar
+, bigstring
+, lwt_log
+}:
+
+buildDunePackage rec {
+  pname = "tezos-stdlib";
+  version = "8.3";
+  src = fetchFromGitLab {
+    owner = "tezos";
+    repo = "tezos";
+    rev = "v${version}";
+    sha256 = "1ykhz5m5sb2hq04nspbsbq8wspkhimagb5g6yi65hpdbn8f4zr6h";
+  };
+
+  minimalOCamlVersion = "4.0.8";
+
+  useDune2 = true;
+
+  preBuild = ''
+    rm -rf vendors
+  '';
+
+  propagatedBuildInputs = [
+    hex
+    lwt
+    zarith
+  ];
+
+  checkInputs = [
+    alcotest
+    alcotest-lwt
+    crowbar
+    bigstring
+    lwt_log
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Tezos: yet-another local-extension of the OCaml standard library";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/test-services.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/test-services.nix
new file mode 100644
index 000000000000..ba30b922d174
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/test-services.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+, alcotest-lwt
+}:
+
+buildDunePackage {
+  pname = "tezos-test-services";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-base
+    alcotest-lwt
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: Alcotest-based test services";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/version.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/version.nix
new file mode 100644
index 000000000000..3b4bdd4bf6f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/version.nix
@@ -0,0 +1,18 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+}:
+
+buildDunePackage {
+  pname = "tezos-version";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-base
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: version information generated from Git";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/tezos/workers.nix b/nixpkgs/pkgs/development/ocaml-modules/tezos/workers.nix
new file mode 100644
index 000000000000..ca659f8adfb3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tezos/workers.nix
@@ -0,0 +1,18 @@
+{ lib
+, buildDunePackage
+, tezos-stdlib
+, tezos-base
+}:
+
+buildDunePackage {
+  pname = "tezos-workers";
+  inherit (tezos-stdlib) version src useDune2 preBuild doCheck;
+
+  propagatedBuildInputs = [
+    tezos-base
+  ];
+
+  meta = tezos-stdlib.meta // {
+    description = "Tezos: worker library";
+  };
+}
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..ceac7a7c0749
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/async.nix
@@ -0,0 +1,21 @@
+{ lib, buildDunePackage, tls, async, cstruct-async, core, cstruct, mirage-crypto-rng-async }:
+
+buildDunePackage rec {
+  pname = "tls-async";
+
+  inherit (tls) src meta version;
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  doCheck = true;
+
+  propagatedBuildInputs = [
+    async
+    core
+    cstruct
+    cstruct-async
+    mirage-crypto-rng-async
+    tls
+  ];
+}
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..5a5479c9fe85
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tls/default.nix
@@ -0,0 +1,52 @@
+{ lib, fetchurl, buildDunePackage
+, cstruct, cstruct-sexp, domain-name, fmt, ppx_cstruct, ppx_sexp_conv, logs, hkdf, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, mirage-crypto-rng, ocaml_lwt, ptime, rresult, sexplib, x509
+, alcotest, cstruct-unix, ounit2, randomconv
+}:
+
+buildDunePackage rec {
+  pname = "tls";
+  version = "0.13.2";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-tls/releases/download/v${version}/tls-v${version}.tbz";
+    sha256 = "sha256-IE6Fuvem8A3lZ/M8GLNYNwCG+v7BbPQ4QdYS+fKT50c=";
+  };
+
+  minimumOCamlVersion = "4.08";
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    cstruct
+    cstruct-sexp
+    domain-name
+    fmt
+    ppx_cstruct
+    ppx_sexp_conv
+    logs
+    hkdf
+    mirage-crypto
+    mirage-crypto-ec
+    mirage-crypto-pk
+    mirage-crypto-rng
+    ocaml_lwt
+    ptime
+    rresult
+    sexplib
+    x509
+  ];
+
+  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/mirage.nix b/nixpkgs/pkgs/development/ocaml-modules/tls/mirage.nix
new file mode 100644
index 000000000000..a0428536b813
--- /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 minimumOCamlVersion useDune2;
+
+  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..6980a148e105
--- /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 = "6.0.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-toml";
+    repo = "to.ml";
+    rev = version;
+    sha256 = "08ywzqckllvwawl1wpgg7qzvx6jhq7d6vysa0d5hj7qdwq213ggm";
+  };
+
+  buildInputs = [ 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..97052115da6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/topkg/default.nix
@@ -0,0 +1,54 @@
+/* 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.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 {
+  name = "ocaml${ocaml.version}-topkg-${version}";
+  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 [];
+
+  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 = "A 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..1cf84dd4938e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/torch/default.nix
@@ -0,0 +1,60 @@
+{ lib
+, stdenv
+, buildDunePackage
+, fetchFromGitHub
+, cmdliner
+, ctypes
+, dune-configurator
+, npy
+, ocaml-compiler-libs
+, ppx_custom_printf
+, ppx_expect
+, ppx_sexp_conv
+, sexplib
+, stdio
+, pytorch
+}:
+
+buildDunePackage rec {
+  pname = "torch";
+  version = "0.13";
+
+  useDune2 = true;
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchFromGitHub {
+    owner = "LaurentMazare";
+    repo   = "ocaml-${pname}";
+    rev    = version;
+    sha256 = "0528h1mkrqbmbf7hy91dsnxcg0k55m3jgharr71c652xyd847yz7";
+  };
+
+  buildInputs = [ dune-configurator ];
+
+  propagatedBuildInputs = [
+    cmdliner
+    ctypes
+    npy
+    ocaml-compiler-libs
+    pytorch
+    pytorch.dev
+    ppx_custom_printf
+    ppx_expect
+    ppx_sexp_conv
+    sexplib
+    stdio
+  ];
+
+  preBuild = "export LIBTORCH=${pytorch.dev}/";
+
+  doCheck = !stdenv.isAarch64;
+  checkPhase = "dune runtest";
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Ocaml bindings to Pytorch";
+    maintainers = [ maintainers.bcdarwin ];
+    license = licenses.asl20;
+  };
+}
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/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix
new file mode 100644
index 000000000000..7c09e8cd9d7a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsdl/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config, ocb-stubblr }:
+
+if !lib.versionAtLeast ocaml.version "4.03"
+then throw "tsdl is not available for OCaml ${ocaml.version}"
+else
+
+let
+  pname = "tsdl";
+  version = "0.9.7";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1zwv0ixkigh1gzk5n49rwvz2f2m62jdkkqg40j7dclg4gri7691f";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+  propagatedBuildInputs = [ SDL2 ctypes ];
+
+  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;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..fdfe7a650e55
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tsort/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildDunePackage, fetchFromGitHub, containers }:
+
+buildDunePackage rec {
+  pname = "tsort";
+  useDune2 = true;
+  version = "2.0.0";
+  src = fetchFromGitHub {
+    owner = "dmbaturin";
+    repo = "ocaml-tsort";
+    rev = version;
+    sha256 = "0i67ys5p5i8q9p0nhkq4pjg9jav8dy0fiy975a365j7m6bhrwgc1";
+  };
+
+  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/tuntap/default.nix b/nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix
new file mode 100644
index 000000000000..981f05b01e38
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tuntap/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildDunePackage, fetchurl
+, ipaddr, macaddr, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "tuntap";
+  version = "2.0.0";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "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";
+    license = lib.licenses.isc;
+    homepage = "https://github.com/mirage/ocaml-tuntap";
+  };
+}
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..77635e8848e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/twt/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchzip, ocaml, findlib }:
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-twt-0.94.0";
+
+  src = fetchzip {
+    url = "https://github.com/mlin/twt/archive/v0.94.0.tar.gz";
+    sha256 = "0298gdgzl4cifxnc1d8sbrvz1lkiq5r5ifkq1fparm6gvqywpf65";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  configurePhase = ''
+    mkdir $out/bin
+  '';
+
+  dontBuild = true;
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/";
+    description = "“The Whitespace Thing” for OCaml";
+    license = licenses.mit;
+    maintainers = [ maintainers.vbgl ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/type_conv/108.08.00.nix b/nixpkgs/pkgs/development/ocaml-modules/type_conv/108.08.00.nix
new file mode 100644
index 000000000000..72e4fcbb35f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/type_conv/108.08.00.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, ocaml, findlib, camlp4}:
+
+if !lib.versionAtLeast ocaml.version "3.12"
+|| lib.versionAtLeast ocaml.version "4.03"
+then throw "type_conv-108.08.00 is not available for OCaml ${ocaml.version}" else
+
+stdenv.mkDerivation {
+  name = "ocaml-type_conv-108.08.00";
+
+  src = fetchurl {
+    url = "https://ocaml.janestreet.com/ocaml-core/108.08.00/individual/type_conv-108.08.00.tar.gz";
+    sha256 = "08ysikwwp69zvc147lzzg79nwlrzrk738rj0ggcfadi8h5il42sl";
+  };
+
+  buildInputs = [ocaml findlib camlp4];
+
+  createFindlibDestdir = true;
+
+  meta = with lib; {
+    homepage = "https://ocaml.janestreet.com/";
+    description = "Support library for OCaml preprocessor type conversions";
+    license = licenses.asl20;
+    branch = "108";
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ maggesi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/type_conv/109.60.01.nix b/nixpkgs/pkgs/development/ocaml-modules/type_conv/109.60.01.nix
new file mode 100644
index 000000000000..e41e9b188fc8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/type_conv/109.60.01.nix
@@ -0,0 +1,26 @@
+{stdenv, lib, fetchurl, ocaml, findlib, camlp4}:
+
+if !lib.versionAtLeast ocaml.version "4.00"
+|| lib.versionAtLeast ocaml.version "4.03"
+then throw "type_conv-109.60.01 is not available for OCaml ${ocaml.version}" else
+
+stdenv.mkDerivation {
+  name = "ocaml-type_conv-109.60.01";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/type_conv/archive/109.60.01.tar.gz";
+    sha256 = "0lpxri68glgq1z2pp02rp45cb909xywbff8d4idljrf6fzzil2zx";
+  };
+
+  buildInputs = [ocaml findlib camlp4];
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = "http://forge.ocamlcore.org/projects/type-conv/";
+    description = "Support library for OCaml preprocessor type conversions";
+    license = lib.licenses.lgpl21;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with lib.maintainers; [ maggesi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/type_conv/112.01.01.nix b/nixpkgs/pkgs/development/ocaml-modules/type_conv/112.01.01.nix
new file mode 100644
index 000000000000..3fa9042b0351
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/type_conv/112.01.01.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildOcaml}:
+
+buildOcaml rec {
+  minimumSupportedOcamlVersion = "4.02";
+
+  name = "type_conv";
+  version = "113.00.02";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/type_conv/archive/${version}.tar.gz";
+    sha256 = "1718yl2q8zandrs4xqffkfmssfld1iz62dzcqdm925735c1x01fk";
+  };
+
+  meta = {
+    homepage = "https://github.com/janestreet/type_conv/";
+    description = "Support library for preprocessor type conversions";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ maggesi ericbmerritt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/typerep/default.nix b/nixpkgs/pkgs/development/ocaml-modules/typerep/default.nix
new file mode 100644
index 000000000000..c851f22aa5b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/typerep/default.nix
@@ -0,0 +1,23 @@
+{lib, buildOcaml, fetchurl, type_conv}:
+
+buildOcaml rec {
+  name = "typerep";
+  version = "112.24.00";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/typerep/archive/${version}.tar.gz";
+    sha256 = "4f1ab611a00aaf774e9774b26b687233e0c70d91f684415a876f094a9969eada";
+  };
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/typerep";
+    description = "Runtime types for OCaml (beta version)";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+
+}
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..c49327d7d338
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/tyxml/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl, re, uutf }:
+
+buildDunePackage rec {
+  pname = "tyxml";
+  version = "4.5.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocsigen/tyxml/releases/download/${version}/tyxml-${version}.tbz";
+    sha256 = "0s30f72m457c3gbdmdwbx7ls9zg806nvm83aiz9qkpglbppwr6n6";
+  };
+
+  propagatedBuildInputs = [ uutf re ];
+
+  meta = with lib; {
+    homepage = "http://ocsigen.org/tyxml/";
+    description = "A 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..7eec01547150
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uchar/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline, withShared ? true, lib }:
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-uchar-0.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/ocaml/uchar/releases/download/v0.0.2/uchar-0.0.2.tbz";
+    sha256 = "1w2saw7zanf9m9ffvz2lvcxvlm118pws2x1wym526xmydhqpyfa7";
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ findlib ocaml ocamlbuild ];
+  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..a9ba880531c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uecc/default.nix
@@ -0,0 +1,34 @@
+{ lib, fetchFromGitLab, buildDunePackage, bigstring, alcotest, cstruct, hex }:
+
+buildDunePackage rec {
+  pname = "uecc";
+  version = "0.3";
+
+  src = fetchFromGitLab {
+    owner = "nomadic-labs";
+    repo = "ocaml-uecc";
+    rev = "v${version}";
+    sha256 = "0m3cw34254baajscrwlrj0jp5n0yad3dhgi4jh3pz89iqykj15fr";
+  };
+
+  useDune2 = true;
+
+  propagatedBuildInputs = [
+    bigstring
+  ];
+
+  checkInputs = [
+    alcotest
+    cstruct
+    hex
+  ];
+
+  doCheck = true;
+
+  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..f1ada5d09981
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix
@@ -0,0 +1,40 @@
+{ 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;
+
+  buildInputs = [ ocaml findlib ocamlbuild ];
+  propagatedBuildInputs = [ camlp4 ];
+
+  buildFlags = [ "all" "all.opt" ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "A lexer generator for Unicode and OCaml";
+    license = lib.licenses.mit;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ lib.maintainers.roconnor ];
+  };
+}
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..f669a98c4def
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uri/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, buildDunePackage, ounit
+, angstrom, stringext
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.03";
+  pname = "uri";
+  version = "4.2.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0szifda6yism5vn5jdizkha3ad0xk6zw4xgfl8g77dnv83ci7h65";
+  };
+
+  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..83be70c36497
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uri/sexp.nix
@@ -0,0 +1,14 @@
+{ lib, ocaml, buildDunePackage, uri, ounit, ppx_sexp_conv, sexplib0 }:
+
+if !lib.versionAtLeast ocaml.version "4.04"
+then throw "uri-sexp is not available for OCaml ${ocaml.version}"
+else
+
+buildDunePackage {
+  pname = "uri-sexp";
+  inherit (uri) version useDune2 src meta;
+
+  checkInputs = [ ounit ];
+  propagatedBuildInputs = [ ppx_sexp_conv sexplib0 uri ];
+  doCheck = lib.versionAtLeast ocaml.version "4.08";
+}
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..f5d932336150
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uucd/default.nix
@@ -0,0 +1,29 @@
+{ 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 = "13.0.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1fg77hg4ibidkv1x8hhzl8z3rzmyymn8m4i35jrdibb8adigi8v2";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  propagatedBuildInputs = [ xmlm ];
+
+  meta = with lib; {
+    description = "An OCaml module to decode the data of the Unicode character database from its XML representation";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    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..bb70ff6a4b7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uucp/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, uunf, uucd }:
+
+let
+  pname = "uucp";
+  version = "13.0.0";
+  webpage = "https://erratique.ch/software/${pname}";
+  minimumOCamlVersion = "4.03";
+  doCheck = true;
+in
+
+if !(lib.versionAtLeast ocaml.version minimumOCamlVersion)
+then builtins.throw "${pname} needs at least OCaml ${minimumOCamlVersion}"
+else
+
+stdenv.mkDerivation {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "sha256-OPpHbCOC/vMFdyHwyhCSisUv2PyO8xbeY2oq1a9HbqY=";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg uutf uunf ];
+
+  propagatedBuildInputs = [ uchar ];
+
+  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 = "An OCaml library providing efficient access to a selection of character properties of the Unicode character database";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    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..b260a05505bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uuidm/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.7";
+  pname = "uuidm";
+  src = fetchurl {
+    url = "https://erratique.ch/software/uuidm/releases/uuidm-${version}.tbz";
+    sha256 = "1ivxb3hxn9bk62rmixx6px4fvn52s4yr1bpla7rgkcn8981v45r8";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  configurePlatforms = [];
+  buildInputs = [ topkg cmdliner ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "An 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;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ maintainers.maurer ];
+  };
+}
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..898bbbba91b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uunf/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl, unzip, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, cmdliner, uucd }:
+let
+  pname = "uunf";
+  webpage = "https://erratique.ch/software/${pname}";
+  version = "13.0.0";
+  ucdxml = fetchurl {
+    url = "http://www.unicode.org/Public/${version}/ucdxml/ucd.all.grouped.zip";
+    sha256 = "04gpl09ggb6fb0kmk6298rd8184dv6vcscn28l1gpdv1yjlw1a8q";
+  };
+  gen = fetchurl {
+    url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen.ml";
+    sha256 = "08j2mpi7j6q3rqc6bcdwspqn1s7pkkphznxfdycqjv4h9yaqsymj";
+  };
+  gen_norm = fetchurl {
+    url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen_norm.ml";
+    sha256 = "11vx5l5bag6bja7qj8jv4s2x9fknj3557n0mj87k2apq5gs5f4m5";
+  };
+  gen_props = fetchurl {
+    url = "https://raw.githubusercontent.com/dbuenzli/uunf/v12.0.0/support/gen_props.ml";
+    sha256 = "0a6lhja498kp9lxql0pbfvkgvajs10wx88wkqc7y5m3lrvw46268";
+  };
+in
+
+assert lib.versionAtLeast ocaml.version "4.03";
+
+stdenv.mkDerivation {
+  name = "ocaml-${pname}-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1qci04nkp24kdls1z4s8kz5dzgky4nwd5r8345nwdrgwmxhw7ksm";
+  };
+
+  postConfigure = ''
+    rm -f src/uunf_data.ml
+    mkdir -p support/
+    cp ${gen} support/gen.ml
+    cp ${gen_norm} support/gen_norm.ml
+    cp ${gen_props} support/gen_props.ml
+    funzip ${ucdxml} > support/ucd.xml
+    ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/build_support.ml
+  '';
+
+  nativeBuildInputs = [ unzip ];
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg uutf cmdliner uucd ];
+
+  propagatedBuildInputs = [ uchar ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "An OCaml module for normalizing Unicode text";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+    # See https://github.com/dbuenzli/uunf/issues/15#issuecomment-903151264
+    broken = lib.versions.majorMinor ocaml.version == "4.08"
+      && stdenv.hostPlatform.isAarch64;
+  };
+}
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..c083f5b68f65
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uuseg/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uucp, uutf, cmdliner }:
+
+let
+  pname = "uuseg";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation rec {
+
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "11.0.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "17mn8p9pn340kmvfgnl1m64zbpy60r6svkwsdn2lcg3yi2jlbrwp";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild cmdliner topkg uutf ];
+  propagatedBuildInputs = [ uucp uchar ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "An OCaml library for segmenting Unicode text";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
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..e8179e369afa
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/uutf/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, cmdliner , topkg, uchar }:
+let
+  pname = "uutf";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1nx1rly3qj23jzn9yk3x6fwqimcxjd84kv5859vvhdg56psq26p6";
+  };
+
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ findlib topkg cmdliner ];
+  propagatedBuildInputs = [ uchar ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "Non-blocking streaming Unicode codec for OCaml";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/variantslib/default.nix b/nixpkgs/pkgs/development/ocaml-modules/variantslib/default.nix
new file mode 100644
index 000000000000..f39336a84231
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/variantslib/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildOcaml, ocaml, fetchurl, type_conv }:
+
+if lib.versionAtLeast ocaml.version "4.06"
+then throw "variantslib-109.15.03 is not available for OCaml ${ocaml.version}"
+else
+
+buildOcaml rec {
+  name = "variantslib";
+  version = "109.15.03";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/variantslib/archive/${version}.tar.gz";
+    sha256 = "a948dcdd4ca54786fe0646386b6e37a9db03bf276c6557ea374d82740bf18055";
+  };
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with lib; {
+    homepage = "https://github.com/janestreet/variantslib";
+    description = "OCaml variants as first class values";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ericbmerritt ];
+  };
+}
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..54bf4e65004b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vchan/default.nix
@@ -0,0 +1,47 @@
+{ lib, buildDunePackage, fetchurl
+, ppx_cstruct, ppx_sexp_conv, ounit, io-page-unix
+, lwt, cstruct, io-page, mirage-flow, xenstore, xenstore_transport
+, sexplib, cmdliner
+}:
+
+buildDunePackage rec {
+  pname = "vchan";
+  version = "6.0.0";
+
+  useDune2 = true;
+  minimumOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-vchan/releases/download/v${version}/vchan-v${version}.tbz";
+    sha256 = "7a6cc89ff8ba7144d6cef3f36722f40deedb3cefff0f7be1b2f3b7b2a2b41747";
+  };
+
+  nativeBuildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    ppx_sexp_conv
+    lwt
+    cstruct
+    io-page
+    mirage-flow
+    xenstore
+    xenstore_transport
+    sexplib
+  ];
+
+  doCheck = true;
+  checkInputs = [
+    cmdliner
+    io-page-unix
+    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/vg/default.nix b/nixpkgs/pkgs/development/ocaml-modules/vg/default.nix
new file mode 100644
index 000000000000..a9a4c0d3d6b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vg/default.nix
@@ -0,0 +1,61 @@
+{ 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
+}:
+
+with lib;
+
+let
+  inherit (lib) optionals versionAtLeast;
+
+  pname = "vg";
+  version = "0.9.4";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+if !versionAtLeast 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";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  propagatedBuildInputs = [ uchar result gg ]
+                          ++ optionals pdfBackend [ uutf otfm ]
+                          ++ optionals htmlcBackend [ js_of_ocaml js_of_ocaml-ppx ];
+
+  buildPhase = topkg.buildPhase
+    + " --with-uutf ${boolToString pdfBackend}"
+    + " --with-otfm ${boolToString pdfBackend}"
+    + " --with-js_of_ocaml ${boolToString htmlcBackend}"
+    + " --with-cairo2 false";
+
+  inherit (topkg) installPhase;
+
+  meta = {
+    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;
+    inherit (ocaml.meta) platforms;
+    license = licenses.isc;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
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..42c077e24a87
--- /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";
+
+  useDune2 = true;
+
+  minimumOCamlVersion = "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 = "An OCaml syntax extension (technically, a ppx_deriving plugin) which generates object-oriented visitors for traversing and transforming data structures";
+    maintainers = [ maintainers.marsam ];
+  };
+}
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..41991cbf7486
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/vlq/default.nix
@@ -0,0 +1,25 @@
+{ lib, buildDunePackage, fetchurl
+, dune-configurator
+}:
+
+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";
+  };
+
+  useDune2 = true;
+
+  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/wasm/default.nix b/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix
new file mode 100644
index 000000000000..4befff2721b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wasm/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "wasm is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-wasm-${version}";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "WebAssembly";
+    repo = "spec";
+    rev = "opam-${version}";
+    sha256 = "1kp72yv4k176i94np0m09g10cviqp2pnpm7jmiq6ik7fmmbknk7c";
+  };
+
+  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 = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST";
+    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..82764af64f53
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wayland/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildDunePackage
+, fetchurl
+, xmlm
+, lwt
+, logs
+, fmt
+, cstruct
+, cmdliner
+, alcotest-lwt
+}:
+
+buildDunePackage rec {
+  pname = "wayland";
+  version = "0.2";
+
+  minimumOCamlVersion = "4.08";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/talex5/ocaml-wayland/releases/download/v${version}/wayland-v${version}.tbz";
+    sha256 = "4eb323e42a8c64e9e49b15a588342bfcc1e99640305cb261d128c75612d9458c";
+  };
+
+  propagatedBuildInputs = [
+    lwt
+    logs
+    fmt
+    cstruct
+  ];
+
+  buildInputs = [
+    cmdliner
+    xmlm
+  ];
+
+  checkInputs = [
+    alcotest-lwt
+  ];
+  doCheck = true;
+
+  meta = {
+    description = "Pure OCaml Wayland protocol library";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.sternenseemann ];
+    homepage = "https://github.com/talex5/ocaml-wayland";
+  };
+}
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..ebc5472ce53b
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/webbrowser/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg
+, astring, bos, cmdliner, rresult
+}:
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-webbrowser-${version}";
+  version = "0.6.1";
+  src = fetchurl {
+    url = "https://erratique.ch/software/webbrowser/releases/webbrowser-${version}.tbz";
+    sha256 = "137a948bx7b71zfv4za3hhznrn5lzbbrgzjy0das83zms508isx3";
+  };
+
+  nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [];
+  propagatedBuildInputs = [ astring bos cmdliner rresult ];
+
+  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 ];
+    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..c7ad92efe768
--- /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";
+  useDune2 = true;
+
+  minimumOCamlVersion = "4.04";
+
+  src = fetchFromGitHub {
+    owner = "inhabitedtype";
+    repo = "ocaml-webmachine";
+    rev = version;
+    sha256 = "03ynb1l2jjqba88m9r8m5hwlm8izpfp617r4vcab5kmdim1l2ffx";
+  };
+
+  propagatedBuildInputs = [ cohttp dispatch ptime ];
+
+  checkInputs = [ ounit ];
+
+  doCheck = true;
+
+  meta = {
+    inherit (src.meta) homepage;
+    license = lib.licenses.bsd3;
+    description = "A REST toolkit for OCaml";
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wodan/default.nix b/nixpkgs/pkgs/development/ocaml-modules/wodan/default.nix
new file mode 100644
index 000000000000..64ca29f20308
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wodan/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildDunePackage, fetchFromGitHub, lwt_ppx, ppx_cstruct, optint
+, checkseum, diet, bitv, nocrypto, logs, lru, io-page, mirage-block }:
+
+buildDunePackage rec {
+  pname = "wodan";
+  version = "unstable-2020-11-20";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "mirage";
+    repo = pname;
+    rev = "cc08fe25888051c207f1009bcd2d39f8c514484f";
+    sha256 = "0186vlhnl8wcz2hmpn327n9a0bibnypmjy3w4nxq3yyglh6vj1im";
+    fetchSubmodules = true;
+  };
+
+  minimumOCamlVersion = "4.08";
+
+  propagatedBuildInputs = [
+    lwt_ppx
+    ppx_cstruct
+    optint
+    checkseum
+    diet
+    bitv
+    nocrypto
+    logs
+    lru
+    io-page
+    mirage-block
+  ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "A flash-friendly, safe and flexible filesystem library";
+    license = licenses.isc;
+    maintainers = with maintainers; [ ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wodan/irmin.nix b/nixpkgs/pkgs/development/ocaml-modules/wodan/irmin.nix
new file mode 100644
index 000000000000..86064d887dbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wodan/irmin.nix
@@ -0,0 +1,26 @@
+{ lib, buildDunePackage, io-page-unix, irmin-chunk, irmin-git, irmin-unix
+, mirage-block-ramdisk, mirage-block-unix, wodan }:
+
+buildDunePackage rec {
+  pname = "wodan-irmin";
+  inherit (wodan) version src useDune2;
+
+  propagatedBuildInputs = [
+    io-page-unix
+    irmin-chunk
+    irmin-git
+    irmin-unix
+    mirage-block-ramdisk
+    mirage-block-unix
+    wodan
+  ];
+
+  meta = wodan.meta // {
+    # wodan is currently incompatible with irmin 2.3.0.
+    # additionally upgrading to current master (unclear
+    # if the issue is fixed there) is not possible as it
+    # depends on a custom fork of mirage-block
+    broken = true;
+    description = "Wodan as an Irmin store";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/wodan/unix.nix b/nixpkgs/pkgs/development/ocaml-modules/wodan/unix.nix
new file mode 100644
index 000000000000..64a18b6b83d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/wodan/unix.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, base64, benchmark, csv, cmdliner, wodan, afl-persistent
+, io-page-unix, mirage-block-ramdisk, mirage-block-unix }:
+
+buildDunePackage rec {
+  outputs = [ "bin" "out" ];
+  pname = "wodan-unix";
+  inherit (wodan) version src useDune2;
+
+  propagatedBuildInputs = [
+    afl-persistent
+    base64
+    benchmark
+    cmdliner
+    csv
+    io-page-unix
+    mirage-block-ramdisk
+    mirage-block-unix
+    wodan
+  ];
+
+  postInstall = ''
+    moveToOutput bin "''${!outputBin}"
+  '';
+
+  meta = wodan.meta // { description = "Wodan clients with Unix integration"; };
+
+}
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..fec6c433604e
--- /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..85209098559a
--- /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, rresult, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk
+, logs, base64
+}:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.07";
+
+  pname = "x509";
+  version = "0.14.0";
+
+  src = fetchurl {
+    url = "https://github.com/mirleft/ocaml-x509/releases/download/v${version}/x509-v${version}.tbz";
+    sha256 = "9b42f34171261b2193ee662f096566c48c48e087949c186c288f90c9b3b9f498";
+  };
+
+  useDune2 = true;
+
+  buildInputs = [ alcotest cstruct-unix ];
+  propagatedBuildInputs = [ asn1-combinators domain-name fmt gmap mirage-crypto mirage-crypto-pk mirage-crypto-ec pbkdf rresult logs base64 ];
+
+  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/xenstore-tool/default.nix b/nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix
new file mode 100644
index 000000000000..34f32e4f117c
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xenstore-tool/default.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, xenstore_transport, xenstore, lwt }:
+
+buildDunePackage {
+  pname = "xenstore-tool";
+
+  inherit (xenstore_transport) src version useDune2 minimumOCamlVersion;
+
+  buildInputs = [ 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..189920290e37
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xenstore/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildDunePackage, fetchurl
+, cstruct, ppx_cstruct, lwt, ounit, stdlib-shims
+}:
+
+buildDunePackage rec {
+  pname = "xenstore";
+  version = "2.1.1";
+
+  minimumOCamlVersion = "4.04";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-xenstore/releases/download/${version}/xenstore-${version}.tbz";
+    sha256 = "283814ea21adc345c4d59cfcb17b2f7c1185004ecaecc3871557c961874c84f5";
+  };
+
+  nativeBuildInputs = [ ppx_cstruct ];
+  propagatedBuildInputs = [ stdlib-shims cstruct lwt ];
+
+  doCheck = true;
+  checkInputs = [ ounit ];
+
+  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..1981f2d5cabb
--- /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";
+
+  minimumOCamlVersion = "4.04";
+  useDune2 = true;
+
+  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..a6db0dc78705
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xml-light/default.nix
@@ -0,0 +1,43 @@
+{stdenv, lib, fetchurl, ocaml, findlib}:
+let
+  pname = "xml-light";
+  version = "2.4";
+in
+stdenv.mkDerivation {
+  name = "ocaml-${pname}-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/ncannasse/${pname}/archive/${version}.tar.gz";
+    sha256 = "10b55qf6mvdp11ny3h0jv6k6wrs78jr9lhsiswl0xya7z8r8j0a2";
+  };
+
+  buildInputs = [ ocaml findlib ];
+
+  createFindlibDestdir = true;
+
+  buildPhase = ''
+    make all
+    make opt
+  '';
+
+  installPhase = ''
+    make install_ocamlfind
+    mkdir -p $out/share
+    cp -vai doc $out/share/
+  '';
+
+  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 ];
+    platforms = ocaml.meta.platforms or [];
+  };
+}
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..43b0bf5faa7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xmlm/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
+let
+  pname = "xmlm";
+  webpage = "https://erratique.ch/software/${pname}";
+in
+
+if !lib.versionAtLeast ocaml.version "4.02"
+then throw "xmlm is not available for OCaml ${ocaml.version}"
+else
+
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-${pname}-${version}";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "${webpage}/releases/${pname}-${version}.tbz";
+    sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n";
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+
+  inherit (topkg) buildPhase installPhase;
+
+  meta = with lib; {
+    description = "An OCaml streaming codec to decode and encode the XML data format";
+    homepage = webpage;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = [ maintainers.vbgl ];
+    license = licenses.bsd3;
+  };
+}
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..f1c1f15dc72d
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitLab, ocaml, findlib, iri, ppx_tools, js_of_ocaml
+, js_of_ocaml-ppx, re }:
+
+if lib.versionOlder ocaml.version "4.03"
+|| lib.versionAtLeast ocaml.version "4.11"
+then throw "xtmpl not supported for ocaml ${ocaml.version}"
+else
+stdenv.mkDerivation rec {
+  name = "ocaml${ocaml.version}-xtmpl-${version}";
+  version = "0.17.0";
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "zoggy";
+    repo = "xtmpl";
+    rev = version;
+    sha256 = "1hq6y4rhz958q40145k4av8hx8jyvspg78xf741samd7vc3jd221";
+  };
+
+  patches = [ ./jsoo.patch ];
+
+  postPatch = ''
+    substituteInPlace Makefile --replace js_of_ocaml.ppx js_of_ocaml-ppx
+  '';
+
+  buildInputs = [ ocaml findlib ppx_tools js_of_ocaml js_of_ocaml-ppx ];
+  propagatedBuildInputs = [ iri re ];
+
+  createFindlibDestdir = true;
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "XML templating library for OCaml";
+    homepage = "https://www.good-eris.net/xtmpl/";
+    license = licenses.lgpl3;
+    platforms = ocaml.meta.platforms or [];
+    maintainers = with maintainers; [ regnat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch
new file mode 100644
index 000000000000..7546dbca924a
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch
@@ -0,0 +1,26 @@
+diff --git a/xtmpl_js.ml b/xtmpl_js.ml
+index e0d3894..991d1b3 100644
+--- a/xtmpl_js.ml
++++ b/xtmpl_js.ml
+@@ -25,6 +25,8 @@
+ 
+ (** *)
+ 
++open Js_of_ocaml
++
+ let log s = Firebug.console##log (Js.string s);;
+ 
+ module X = Xtmpl_rewrite
+diff --git a/xtmpl_js.mli b/xtmpl_js.mli
+index d709896..5ed471c 100644
+--- a/xtmpl_js.mli
++++ b/xtmpl_js.mli
+@@ -25,6 +25,8 @@
+ 
+ (** Convenient functions to use in JS code *)
+ 
++open Js_of_ocaml
++
+ (** Create a new tree of DOM nodes from a given XML tree.
+   Errors are logged to the firebug console.
+   @param doc Default is [Dom_html.document].
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..c8b2b614e860
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yaml/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchurl, buildDunePackage
+, dune-configurator
+, ppx_sexp_conv
+, bos, ctypes, fmt, logs, rresult, sexplib
+}:
+
+buildDunePackage rec {
+  pname = "yaml";
+  version = "2.1.0";
+
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/avsm/ocaml-yaml/releases/download/v${version}/yaml-v${version}.tbz";
+    sha256 = "03g8vsh5jgi1cm5q78v15slgnzifp91fp7n4v1i7pa8yk0bkh585";
+  };
+
+  buildInputs = [ dune-configurator ];
+  propagatedBuildInputs = [ bos ctypes fmt logs ppx_sexp_conv rresult sexplib ];
+
+  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/yojson/default.nix b/nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix
new file mode 100644
index 000000000000..2be9ce1b0210
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/yojson/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchurl, buildDunePackage, cppo, easy-format, biniou }:
+
+buildDunePackage rec {
+  pname = "yojson";
+  version = "1.7.0";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz";
+    sha256 = "1iich6323npvvs8r50lkr4pxxqm9mf6w67cnid7jg1j1g5gwcvv5";
+  };
+
+  nativeBuildInputs = [ cppo ];
+  propagatedBuildInputs = [ easy-format biniou ];
+
+  meta = with lib; {
+    description = "An optimized parsing and printing library for the JSON format";
+    homepage = "https://github.com/ocaml-community/${pname}";
+    license = licenses.bsd3;
+    maintainers = [ 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..01b384fe0ba5
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/z3/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, ocaml, findlib, zarith, z3 }:
+
+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
+  '';
+
+  buildInputs = [ findlib ];
+  propagatedBuildInputs = [ zarith ];
+
+  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..95351caee307
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zarith/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub
+, ocaml, findlib, pkg-config
+, gmp
+}:
+
+if !lib.versionAtLeast 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.12";
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = "Zarith";
+    rev = "release-${version}";
+    sha256 = "1jslm1rv1j0ya818yh23wf3bb6hz7qqj9pn5fwl45y9mqyqa01s9";
+  };
+
+  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    = "http://forge.ocamlcore.org/projects/zarith";
+    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..a7889523bcca
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zed/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildDunePackage, fetchFromGitHub, camomile, react, charInfo_width }:
+
+buildDunePackage rec {
+  pname = "zed";
+  version = "3.1.0";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    sha256 = "04vr1a94imsghm98iigc35rhifsz0rh3qz2qm0wam2wvp6vmrx0p";
+  };
+
+  propagatedBuildInputs = [ charInfo_width react ];
+
+  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.
+    '';
+    inherit (src.meta) homepage;
+    license = lib.licenses.bsd3;
+    maintainers = [
+      lib.maintainers.gal_bolle
+    ];
+  };
+}
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..9779004085c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zmq/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, buildDunePackage, dune-configurator, czmq, stdint }:
+
+buildDunePackage rec {
+  minimumOCamlVersion = "4.03";
+  pname = "zmq";
+  version = "20180726";
+
+  useDune2 = true;
+
+  src = fetchFromGitHub {
+    owner = "issuu";
+    repo = "ocaml-zmq";
+    rev = "d312a8458d6b688f75470248f11875fbbfa5bb1a";
+    sha256 = "1f5l4bw78y4drabhyvmpj3z8k30bill33ca7bzhr02m55yf6gqpf";
+  };
+
+  buildInputs = [ czmq dune-configurator ];
+
+  propagatedBuildInputs = [ stdint ];
+
+  meta = {
+    description = "ZeroMQ bindings for OCaml";
+    license     = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ akavel ];
+    inherit (src.meta) homepage;
+  };
+}
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..6717e787f199
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/zmq/lwt.nix
@@ -0,0 +1,8 @@
+{ buildDunePackage, zmq, ocaml_lwt }:
+
+buildDunePackage {
+  pname = "zmq-lwt";
+  inherit (zmq) version src useDune2 meta;
+
+  propagatedBuildInputs = [ zmq ocaml_lwt ];
+}