#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; }; struct LockFile { struct FlakeEntry { FlakeRef ref; std::map flakeEntries; std::map nonFlakeEntries; FlakeEntry(const FlakeRef & flakeRef) : ref(flakeRef) {}; }; std::map flakeEntries; std::map nonFlakeEntries; }; 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; LockFile 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 &, bool impureIsAllowed); struct Dependencies { Flake flake; std::vector flakeDeps; // The flake dependencies std::vector nonFlakeDeps; Dependencies(const Flake & flake) : flake(flake) {} }; Dependencies resolveFlake(EvalState &, const FlakeRef &, bool impureTopRef, bool isTopFlake); void updateLockFile(EvalState &, Path path, bool impureTopRef); }