aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/experimental-features-json.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/experimental-features-json.hh')
-rw-r--r--src/libutil/experimental-features-json.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/libutil/experimental-features-json.hh b/src/libutil/experimental-features-json.hh
new file mode 100644
index 000000000..a4f999a93
--- /dev/null
+++ b/src/libutil/experimental-features-json.hh
@@ -0,0 +1,29 @@
+#pragma once
+///@file
+
+#include "experimental-features.hh"
+#include "json-utils.hh"
+
+namespace nix {
+
+/**
+ * Compute the documentation of all experimental features.
+ *
+ * See `doc/manual` for how this information is used.
+ */
+nlohmann::json documentExperimentalFeatures();
+
+/**
+ * Semi-magic conversion to and from json.
+ * See the nlohmann/json readme for more details.
+ */
+void to_json(nlohmann::json &, const ExperimentalFeature &);
+void from_json(const nlohmann::json &, ExperimentalFeature &);
+
+/**
+ * It is always rendered as a string
+ */
+template<>
+struct json_avoids_null<ExperimentalFeature> : std::true_type {};
+
+};