diff --git a/nix/pkgs.nix b/nix/pkgs.nix
index 1729378c62ea7abdd3fd04763c380cb145bcad5d..6f226cf8b0611aa9c89f75b79de000d8c72029b0 100644
--- a/nix/pkgs.nix
+++ b/nix/pkgs.nix
@@ -8,6 +8,7 @@ let
     mlmpfr = oself.callPackage ./mlmpfr.nix {};
     why3 = oself.callPackage ./why3.nix {};
     yaml = oself.callPackage ./yaml.nix {};
+    ppx_deriving_yaml = oself.callPackage ./ppx_deriving_yaml.nix {};
     # Helpers
     mk_tests = oself.callPackage ./mk_tests.nix {};
     mk_plugin = oself.callPackage ./mk_plugin.nix {};
diff --git a/nix/ppx_deriving_yaml.nix b/nix/ppx_deriving_yaml.nix
new file mode 100644
index 0000000000000000000000000000000000000000..44b6e980ae69201b348aad19bba59a2b4b905e85
--- /dev/null
+++ b/nix/ppx_deriving_yaml.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, ppxlib, alcotest, mdx
+, ppx_deriving, yaml
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_yaml";
+  version = "0.2.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v${version}/ppx_deriving_yaml-${version}.tbz";
+    sha256 = "sha256-3vmay8UY7d3j96VOQ+D3oYEotzVls91F51ebXWQ/9SQ=";
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving yaml ];
+
+  doCheck = true;
+  checkInputs = [ alcotest mdx ];
+
+  meta = {
+    description = "A YAML codec generator for OCaml";
+    homepage = "https://github.com/patricoferris/ppx_deriving_yaml";
+    license = lib.licenses.isc;
+    maintainers = [ ];
+  };
+}