#pragma once #include "util.hh" #include "path.hh" #include "path.hh" #include #include namespace nix { class Store; struct DerivedPathOpaque { StorePath path; nlohmann::json toJSON(ref store) const; std::string to_string(const Store & store) const; static DerivedPathOpaque parse(const Store & store, std::string_view); }; struct DerivedPathBuilt { StorePath drvPath; std::set outputs; std::string to_string(const Store & store) const; static DerivedPathBuilt parse(const Store & store, std::string_view); }; using _DerivedPathRaw = std::variant< DerivedPathOpaque, DerivedPathBuilt >; struct DerivedPath : _DerivedPathRaw { using Raw = _DerivedPathRaw; using Raw::Raw; using Opaque = DerivedPathOpaque; using Built = DerivedPathBuilt; inline const Raw & raw() const { return static_cast(*this); } std::string to_string(const Store & store) const; static DerivedPath parse(const Store & store, std::string_view); }; struct DerivedPathWithHintsBuilt { StorePath drvPath; std::map> outputs; nlohmann::json toJSON(ref store) const; static DerivedPathWithHintsBuilt parse(const Store & store, std::string_view); }; using DerivedPathWithHints = std::variant< DerivedPath::Opaque, DerivedPathWithHintsBuilt >; typedef std::vector DerivedPathsWithHints; nlohmann::json derivedPathsWithHintsToJSON(const DerivedPathsWithHints & buildables, ref store); }