#include "types.hh" #include "flakeref.hh" #include namespace nix { struct Value; class EvalState; struct FlakeRegistry { struct Entry { FlakeRef ref; Entry(const FlakeRef & flakeRef) : ref(flakeRef) {}; Entry operator=(const Entry & entry) { return Entry(entry.ref); } }; std::map entries; }; Path getUserRegistryPath(); Value * makeFlakeRegistryValue(EvalState & state); Value * makeFlakeValue(EvalState & state, const FlakeRef & flakeRef, bool impureTopRef, Value & v); std::shared_ptr readRegistry(const Path &); void writeRegistry(FlakeRegistry, Path); struct Flake { FlakeId id; FlakeRef ref; std::string description; Path path; std::optional revCount; std::vector requires; std::shared_ptr lockFile; std::map nonFlakeRequires; Value * vProvides; // FIXME: gc // date // content hash Flake(const FlakeRef flakeRef) : ref(flakeRef) {}; }; struct NonFlake { FlakeId id; FlakeRef ref; Path path; // date // content hash NonFlake(const FlakeRef flakeRef) : ref(flakeRef) {}; }; Flake getFlake(EvalState &, const FlakeRef &); struct Dependencies { FlakeId topFlakeId; std::vector flakes; std::vector nonFlakes; }; Dependencies resolveFlake(EvalState &, const FlakeRef &, bool impureTopRef); FlakeRegistry updateLockFile(EvalState &, Flake &); void updateLockFile(EvalState &, Path); }