1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 05:21:16 +02:00

Add custom to_json and from_json functions for ExperimentalFeature

nix show-config --json was serializing experimental features as ints.
nlohmann::json will automatically use these definitions to serialize
and deserialize ExperimentalFeatures.

Strictly, we don't use the from_json instance yet, it's provided for
completeness and hopefully future use.
This commit is contained in:
Yorick van Pelt 2022-04-20 15:41:01 +02:00
parent cd0549a9cd
commit ebf2fd76b1
No known key found for this signature in database
GPG key ID: A36E70F9DC014A15
2 changed files with 21 additions and 0 deletions

View file

@ -51,4 +51,11 @@ public:
MissingExperimentalFeature(ExperimentalFeature);
};
/**
* 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&);
}