#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); }; template struct BuildableForFromDrv { StorePath drvPath; Outputs outputs; nlohmann::json toJSON(ref store) const; std::string to_string(const Store & store) const; static BuildableForFromDrv parse(const Store & store, std::string_view); }; template using BuildableFor = std::variant< BuildableOpaque, BuildableForFromDrv >; typedef BuildableForFromDrv> BuildableReqFromDrv; typedef BuildableFor> BuildableReq; std::string to_string(const Store & store, const BuildableReq &); BuildableReq parseBuildableReq(const Store & store, std::string_view); typedef BuildableForFromDrv>> BuildableFromDrv; typedef BuildableFor>> Buildable; typedef std::vector Buildables; nlohmann::json buildablesToJSON(const Buildables & buildables, ref store); }