From cd583362ecbae9726714b6abf70882905304ca5a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 17 Feb 2023 18:37:35 -0500 Subject: Move `Derivation` toJSON logic to libnixstore --- src/libstore/derivations.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstore/derivations.hh') diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index f42c13cdc..8456b29e7 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -83,6 +83,11 @@ struct DerivationOutput : _DerivationOutputRaw inline const Raw & raw() const { return static_cast(*this); } + + nlohmann::json toJSON( + const Store & store, + std::string_view drvName, + std::string_view outputName) const; }; typedef std::map DerivationOutputs; @@ -210,6 +215,8 @@ struct Derivation : BasicDerivation Derivation() = default; Derivation(const BasicDerivation & bd) : BasicDerivation(bd) { } Derivation(BasicDerivation && bd) : BasicDerivation(std::move(bd)) { } + + nlohmann::json toJSON(const Store & store) const; }; -- cgit v1.2.3