nix-eval-jobs/src/drv.hh

34 lines
854 B
C++
Raw Permalink Normal View History

2024-05-16 23:47:20 +00:00
#include <lix/libexpr/get-drvs.hh>
#include <lix/libexpr/eval.hh>
#include <nlohmann/json.hpp>
#include <nlohmann/json_fwd.hpp>
2023-12-10 14:07:38 +00:00
#include <string>
#include <map>
#include <set>
#include <string>
#include <optional>
#include "eval-args.hh"
2023-12-10 14:07:38 +00:00
class MyArgs;
2023-12-10 14:07:38 +00:00
namespace nix {
class EvalState;
struct DrvInfo;
} // namespace nix
2023-12-10 14:07:38 +00:00
/* The fields of a derivation that are printed in json form */
struct Drv {
std::string name;
std::string system;
std::string drvPath;
enum class CacheStatus { Cached, Uncached, Unknown } cacheStatus;
std::map<std::string, std::optional<std::string>> outputs;
2023-12-10 14:07:38 +00:00
std::map<std::string, std::set<std::string>> inputDrvs;
std::optional<nlohmann::json> meta;
Drv(std::string &attrPath, nix::EvalState &state, nix::DrvInfo &drvInfo, MyArgs &args);
};
void to_json(nlohmann::json &json, const Drv &drv);