aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index bf81b4892..df5c2226f 100644
--- a/src/libutil/config.hh
+++ b/src/libutil/config.hh
@@ -100,6 +100,12 @@ public:
virtual nlohmann::json toJSON() = 0;
/**
+ * Outputs all settings in a key-value pair format suitable to be used as
+ * `nix.conf`
+ */
+ virtual std::string toKeyValue() = 0;
+
+ /**
* Converts settings to `Args` to be used on the command line interface
* - args: args to write to
* - category: category of the settings
@@ -169,6 +175,8 @@ public:
nlohmann::json toJSON() override;
+ std::string toKeyValue() override;
+
void convertToArgs(Args & args, const std::string & category) override;
};
@@ -330,6 +338,8 @@ struct GlobalConfig : public AbstractConfig
nlohmann::json toJSON() override;
+ std::string toKeyValue() override;
+
void convertToArgs(Args & args, const std::string & category) override;
struct Register