mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
40 lines
654 B
C++
40 lines
654 B
C++
|
#pragma once
|
||
|
|
||
|
#include "sync.hh"
|
||
|
#include "flake.hh"
|
||
|
|
||
|
namespace nix { struct SQLite; struct SQLiteStmt; }
|
||
|
|
||
|
namespace nix::flake {
|
||
|
|
||
|
class EvalCache
|
||
|
{
|
||
|
struct State;
|
||
|
|
||
|
std::unique_ptr<Sync<State>> _state;
|
||
|
|
||
|
EvalCache();
|
||
|
|
||
|
public:
|
||
|
|
||
|
struct Derivation
|
||
|
{
|
||
|
Path drvPath;
|
||
|
Path 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();
|
||
|
};
|
||
|
|
||
|
}
|