summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/tezos
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/tezos')
-rw-r--r--pkgs/development/ocaml-modules/tezos/base.nix33
-rw-r--r--pkgs/development/ocaml-modules/tezos/clic.nix25
-rw-r--r--pkgs/development/ocaml-modules/tezos/crypto.nix38
-rw-r--r--pkgs/development/ocaml-modules/tezos/error-monad.nix30
-rw-r--r--pkgs/development/ocaml-modules/tezos/event-logging.nix22
-rw-r--r--pkgs/development/ocaml-modules/tezos/lmdb.nix51
-rw-r--r--pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix32
-rw-r--r--pkgs/development/ocaml-modules/tezos/micheline.nix28
-rw-r--r--pkgs/development/ocaml-modules/tezos/p2p-services.nix18
-rw-r--r--pkgs/development/ocaml-modules/tezos/p2p.nix25
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix19
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix23
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-compiler.nix29
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix18
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix15
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix30
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix20
-rw-r--r--pkgs/development/ocaml-modules/tezos/protocol-environment.nix33
-rw-r--r--pkgs/development/ocaml-modules/tezos/requester.nix27
-rw-r--r--pkgs/development/ocaml-modules/tezos/rpc.nix22
-rw-r--r--pkgs/development/ocaml-modules/tezos/sapling.nix31
-rw-r--r--pkgs/development/ocaml-modules/tezos/shell-services.nix22
-rw-r--r--pkgs/development/ocaml-modules/tezos/stdlib-unix.nix30
-rw-r--r--pkgs/development/ocaml-modules/tezos/stdlib.nix53
-rw-r--r--pkgs/development/ocaml-modules/tezos/test-services.nix20
-rw-r--r--pkgs/development/ocaml-modules/tezos/version.nix18
-rw-r--r--pkgs/development/ocaml-modules/tezos/workers.nix18
27 files changed, 730 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/tezos/base.nix b/pkgs/development/ocaml-modules/tezos/base.nix
new file mode 100644
index 00000000000..2f5d7658131
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/clic.nix b/pkgs/development/ocaml-modules/tezos/clic.nix
new file mode 100644
index 00000000000..d69174e5f29
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/crypto.nix b/pkgs/development/ocaml-modules/tezos/crypto.nix
new file mode 100644
index 00000000000..9c5bd45f94f
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/error-monad.nix b/pkgs/development/ocaml-modules/tezos/error-monad.nix
new file mode 100644
index 00000000000..70cdff0c0ac
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/event-logging.nix b/pkgs/development/ocaml-modules/tezos/event-logging.nix
new file mode 100644
index 00000000000..30d6c12087e
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/lmdb.nix b/pkgs/development/ocaml-modules/tezos/lmdb.nix
new file mode 100644
index 00000000000..960b2532c37
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix b/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix
new file mode 100644
index 00000000000..fe32b7aba74
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/micheline.nix b/pkgs/development/ocaml-modules/tezos/micheline.nix
new file mode 100644
index 00000000000..a729cdef155
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/p2p-services.nix b/pkgs/development/ocaml-modules/tezos/p2p-services.nix
new file mode 100644
index 00000000000..b4243f589f0
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/p2p.nix b/pkgs/development/ocaml-modules/tezos/p2p.nix
new file mode 100644
index 00000000000..b75c03debfa
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix b/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk-parameters.nix
new file mode 100644
index 00000000000..5b043eede93
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix b/pkgs/development/ocaml-modules/tezos/protocol-008-PtEdo2Zk.nix
new file mode 100644
index 00000000000..49a7f0e6380
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix b/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix
new file mode 100644
index 00000000000..a43356d9cbe
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix b/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix
new file mode 100644
index 00000000000..51efe694184
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix
new file mode 100644
index 00000000000..42662105b95
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix
new file mode 100644
index 00000000000..79b84360a9d
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix
new file mode 100644
index 00000000000..feddca046f8
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/protocol-environment.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment.nix
new file mode 100644
index 00000000000..60d9ae29222
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/requester.nix b/pkgs/development/ocaml-modules/tezos/requester.nix
new file mode 100644
index 00000000000..d4a2b69eaa8
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/rpc.nix b/pkgs/development/ocaml-modules/tezos/rpc.nix
new file mode 100644
index 00000000000..33450bdf167
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/sapling.nix b/pkgs/development/ocaml-modules/tezos/sapling.nix
new file mode 100644
index 00000000000..40665e38054
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/shell-services.nix b/pkgs/development/ocaml-modules/tezos/shell-services.nix
new file mode 100644
index 00000000000..4e2f40497eb
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix b/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix
new file mode 100644
index 00000000000..2b3a01469a7
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/stdlib.nix b/pkgs/development/ocaml-modules/tezos/stdlib.nix
new file mode 100644
index 00000000000..d0a734800c4
--- /dev/null
+++ b/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 = "12cv2cssnw60jbpnh6xjysxgsgcj7d72454k4zs2b8fjx7mkgksk";
+  };
+
+  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/pkgs/development/ocaml-modules/tezos/test-services.nix b/pkgs/development/ocaml-modules/tezos/test-services.nix
new file mode 100644
index 00000000000..ba30b922d17
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/version.nix b/pkgs/development/ocaml-modules/tezos/version.nix
new file mode 100644
index 00000000000..3b4bdd4bf6f
--- /dev/null
+++ b/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/pkgs/development/ocaml-modules/tezos/workers.nix b/pkgs/development/ocaml-modules/tezos/workers.nix
new file mode 100644
index 00000000000..ca659f8adfb
--- /dev/null
+++ b/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";
+  };
+}