#pragma once #include "types.hh" #include "fetchers.hh" namespace nix { class Store; } namespace nix::fetchers { struct Registry { enum RegistryType { Flag = 0, User = 1, System = 2, Global = 3, Custom = 4, }; RegistryType type; struct Entry { Input from, to; Attrs extraAttrs; bool exact = false; }; std::vector entries; Registry(RegistryType type) : type(type) { } static std::shared_ptr read( const Path & path, RegistryType type); void write(const Path & path); void add( const Input & from, const Input & to, const Attrs & extraAttrs); void remove(const Input & input); }; typedef std::vector> Registries; std::shared_ptr getUserRegistry(); std::shared_ptr getCustomRegistry(const Path & p); Path getUserRegistryPath(); Registries getRegistries(ref store); void overrideRegistry( const Input & from, const Input & to, const Attrs & extraAttrs); std::pair lookupInRegistries( ref store, const Input & input); }