#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 BuildableReq = std::variant< BuildableOpaque, BuildableReqFromDrv >; std::string to_string(const Store & store, const BuildableReq &); BuildableReq parseBuildableReq(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); }