Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
registry.hh
Go to the documentation of this file.
1#pragma once
3
6
7namespace nix { class Store; }
8
9namespace nix::fetchers {
10
11struct Registry
12{
13 enum RegistryType {
14 Flag = 0,
15 User = 1,
16 System = 2,
17 Global = 3,
18 Custom = 4,
19 };
20
21 RegistryType type;
22
23 struct Entry
24 {
25 Input from, to;
26 Attrs extraAttrs;
27 bool exact = false;
28 };
29
30 std::vector<Entry> entries;
31
32 Registry(RegistryType type)
33 : type(type)
34 { }
35
36 static std::shared_ptr<Registry> read(
37 const Path & path, RegistryType type);
38
39 void write(const Path & path);
40
41 void add(
42 const Input & from,
43 const Input & to,
44 const Attrs & extraAttrs);
45
46 void remove(const Input & input);
47};
48
49typedef std::vector<std::shared_ptr<Registry>> Registries;
50
51std::shared_ptr<Registry> getUserRegistry();
52
53std::shared_ptr<Registry> getCustomRegistry(const Path & p);
54
55Path getUserRegistryPath();
56
57kj::Promise<Result<Registries>> getRegistries(ref<Store> store);
58
59void overrideRegistry(
60 const Input & from,
61 const Input & to,
62 const Attrs & extraAttrs);
63
64kj::Promise<Result<std::pair<Input, Attrs>>> lookupInRegistries(
65 ref<Store> store,
66 const Input & input);
67
68}
Definition store-api.hh:195
Definition ref.hh:19
Definition fetchers.hh:39
Definition registry.hh:24
std::string Path
Definition types.hh:28