1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 23:28:26 -04:00
nix/src/libexpr/flake/eval-cache.hh

41 lines
683 B
C++
Raw Normal View History

#pragma once
#include "sync.hh"
#include "flake.hh"
#include "path.hh"
namespace nix { struct SQLite; struct SQLiteStmt; }
namespace nix::flake {
class EvalCache
{
struct State;
std::unique_ptr<Sync<State>> _state;
EvalCache();
public:
struct Derivation
{
StorePath drvPath;
StorePath outPath;
std::string outputName;
};
void addDerivation(
const Fingerprint & fingerprint,
const std::string & attrPath,
const Derivation & drv);
std::optional<Derivation> getDerivation(
const Fingerprint & fingerprint,
const std::string & attrPath);
static EvalCache & singleton();
};
}