Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
registry.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/types.hh
"
5
#include "
nix/util/source-path.hh
"
6
#include "
nix/fetchers/fetchers.hh
"
7
8
namespace
nix {
9
class
Store
;
10
}
11
12
namespace
nix::fetchers {
13
14
struct
Registry
15
{
16
enum
RegistryType {
17
Flag = 0,
18
User = 1,
19
System = 2,
20
Global = 3,
21
Custom = 4,
22
};
23
24
RegistryType type;
25
26
struct
Entry
27
{
28
Input
from, to;
29
Attrs
extraAttrs;
30
bool
exact =
false
;
31
};
32
33
std::vector<Entry> entries;
34
35
Registry(RegistryType type)
36
: type{type}
37
{
38
}
39
40
static
std::shared_ptr<Registry>
read
(
const
Settings
& settings,
const
SourcePath
& path, RegistryType type);
41
42
void
write
(
const
std::filesystem::path & path);
43
44
void
add(
const
Input
& from,
const
Input
& to,
const
Attrs
& extraAttrs);
45
46
void
remove(
const
Input
& input);
47
};
48
49
typedef
std::vector<std::shared_ptr<Registry>> Registries;
50
51
std::shared_ptr<Registry> getUserRegistry(
const
Settings
& settings);
52
53
std::shared_ptr<Registry> getCustomRegistry(
const
Settings
& settings,
const
std::filesystem::path & p);
54
55
std::filesystem::path getUserRegistryPath();
56
57
Registries getRegistries(
const
Settings
& settings,
Store
& store);
58
59
void
overrideRegistry(
const
Input & from,
const
Input & to,
const
Attrs & extraAttrs);
60
61
enum class
UseRegistries :
int
{
62
No,
63
All,
64
Limited,
// global and flag registry only
65
};
66
71
std::pair<Input, Attrs>
72
lookupInRegistries(
const
Settings & settings, Store & store,
const
Input & input, UseRegistries useRegistries);
73
74
}
// namespace nix::fetchers
nix::fetchers::Attrs
std::map< std::string, Attr > Attrs
Definition
attrs.hh:68
nix::Settings
Definition
globals.hh:106
nix::Store
Definition
store-api.hh:397
fetchers.hh
nix::write
size_t write(Descriptor fd, std::span< const std::byte > buffer, bool allowInterrupts)
Definition
file-descriptor.cc:54
nix::read
size_t read(Descriptor fd, std::span< std::byte > buffer)
Definition
file-descriptor.cc:30
source-path.hh
SourcePath.
nix::SourcePath
Definition
source-path.hh:22
nix::fetchers::Input
Definition
fetchers.hh:36
nix::fetchers::Registry::Entry
Definition
registry.hh:27
nix::fetchers::Settings
Definition
fetch-settings.hh:27
types.hh
libfetchers
include
nix
fetchers
registry.hh
Generated by
1.18.0