#pragma once #include "util.hh" #include "path.hh" #include "path.hh" #include #include namespace nix { class Store; struct BuildableOpaque { StorePath path; nlohmann::json toJSON(ref store) const; std::string to_string(const Store & store) const; static BuildableOpaque parse(const Store & store, std::string_view); }; struct BuildableReqFromDrv { StorePath drvPath; std::set outputs; std::string to_string(const Store & store) const; static BuildableReqFromDrv parse(const Store & store, std::string_view); }; using _BuildableReqRaw = std::variant< BuildableOpaque, BuildableReqFromDrv >; struct BuildableReq : _BuildableReqRaw { using Raw = _BuildableReqRaw; using Raw::Raw; inline const Raw & raw() const { return static_cast(*this); } std::string to_string(const Store & store) const; static BuildableReq parse(const Store & store, std::string_view); }; struct BuildableFromDrv { StorePath drvPath; std::map> outputs; nlohmann::json toJSON(ref store) const; static BuildableFromDrv parse(const Store & store, std::string_view); }; using Buildable = std::variant< BuildableOpaque, BuildableFromDrv >; typedef std::vector Buildables; nlohmann::json buildablesToJSON(const Buildables & buildables, ref store); }