aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/parsed-derivations.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-24 14:26:13 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-03-24 14:34:47 +0100
commit0a10854f857e519d1455ff0f0be1f8401c40a11c (patch)
tree64cd9b1c0727eb0642574e4535c5ba61af497c3a /src/libstore/parsed-derivations.hh
parentc85097da7c1ef06e2f1912c922110ff358de3aa2 (diff)
Misc changes from the flakes branch
Diffstat (limited to 'src/libstore/parsed-derivations.hh')
-rw-r--r--src/libstore/parsed-derivations.hh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstore/parsed-derivations.hh b/src/libstore/parsed-derivations.hh
index cec868754..f4df5dd54 100644
--- a/src/libstore/parsed-derivations.hh
+++ b/src/libstore/parsed-derivations.hh
@@ -1,6 +1,6 @@
#include "derivations.hh"
-#include <nlohmann/json.hpp>
+#include <nlohmann/json_fwd.hpp>
namespace nix {
@@ -8,15 +8,17 @@ class ParsedDerivation
{
StorePath drvPath;
BasicDerivation & drv;
- std::optional<nlohmann::json> structuredAttrs;
+ std::unique_ptr<nlohmann::json> structuredAttrs;
public:
ParsedDerivation(StorePath && drvPath, BasicDerivation & drv);
- const std::optional<nlohmann::json> & getStructuredAttrs() const
+ ~ParsedDerivation();
+
+ const nlohmann::json * getStructuredAttrs() const
{
- return structuredAttrs;
+ return structuredAttrs.get();
}
std::optional<std::string> getStringAttr(const std::string & name) const;