about summary refs log tree commit diff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-20T15·34+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-20T15·34+0200
commitefa4bdbfcd1489527bcf6f20a49c9a3bca8bbf6b (patch)
tree0e965a2b8feb129623c221564e7ca208ce16fe2a /src/libutil/config.hh
parent4410e9d995bcd53a7a4cff0bbee3917375adcba3 (diff)
Improve nix show-config --json
In particular, show descriptions. This could be used for manpage
generation etc.
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index 130f59e2bd..9196210910 100644
--- a/src/libutil/config.hh
+++ b/src/libutil/config.hh
@@ -9,6 +9,8 @@ namespace nix {
 
 class Args;
 class AbstractSetting;
+class JSONPlaceholder;
+class JSONObject;
 
 /* A class to simplify providing configuration settings. The typical
    use is to inherit Config and add Setting<T> members:
@@ -56,6 +58,8 @@ public:
     void applyConfigFile(const Path & path, bool fatal = false);
 
     void resetOverriden();
+
+    void toJSON(JSONObject & out);
 };
 
 class AbstractSetting
@@ -90,6 +94,8 @@ protected:
 
     virtual std::string to_string() = 0;
 
+    virtual void toJSON(JSONPlaceholder & out);
+
     bool isOverriden() { return overriden; }
 };
 
@@ -122,6 +128,8 @@ public:
     void set(const std::string & str) override;
 
     std::string to_string() override;
+
+    void toJSON(JSONPlaceholder & out) override;
 };
 
 template<typename T>