Skip to content

Commit bed0570

Browse files
committed
Registry: Drop settings field
It's not used anywhere.
1 parent dfac44c commit bed0570

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

src/libcmd/common-eval-args.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ MixEvalArgs::MixEvalArgs()
132132
fetchers::Attrs extraAttrs;
133133
if (to.subdir != "")
134134
extraAttrs["dir"] = to.subdir;
135-
fetchers::overrideRegistry(fetchSettings, from.input, to.input, extraAttrs);
135+
fetchers::overrideRegistry(from.input, to.input, extraAttrs);
136136
}},
137137
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
138138
completeFlakeRef(completions, openStore(), prefix);

src/libcmd/installables.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ MixFlakeOptions::MixFlakeOptions()
185185
}
186186

187187
overrideRegistry(
188-
fetchSettings,
189188
fetchers::Input::fromAttrs(fetchSettings, {{"type", "indirect"}, {"id", inputName}}),
190189
input3->lockedRef.input,
191190
extraAttrs);

src/libfetchers/include/nix/fetchers/registry.hh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ namespace nix::fetchers {
1313

1414
struct Registry
1515
{
16-
const Settings & settings;
17-
1816
enum RegistryType {
1917
Flag = 0,
2018
User = 1,
@@ -34,9 +32,8 @@ struct Registry
3432

3533
std::vector<Entry> entries;
3634

37-
Registry(const Settings & settings, RegistryType type)
38-
: settings{settings}
39-
, type{type}
35+
Registry(RegistryType type)
36+
: type{type}
4037
{
4138
}
4239

@@ -59,7 +56,7 @@ Path getUserRegistryPath();
5956

6057
Registries getRegistries(const Settings & settings, Store & store);
6158

62-
void overrideRegistry(const Settings & settings, const Input & from, const Input & to, const Attrs & extraAttrs);
59+
void overrideRegistry(const Input & from, const Input & to, const Attrs & extraAttrs);
6360

6461
enum class UseRegistries : int {
6562
No,

src/libfetchers/registry.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ std::shared_ptr<Registry> Registry::read(const Settings & settings, const Source
1414
{
1515
debug("reading registry '%s'", path);
1616

17-
auto registry = std::make_shared<Registry>(settings, type);
17+
auto registry = std::make_shared<Registry>(type);
1818

1919
if (!path.pathExists())
20-
return std::make_shared<Registry>(settings, type);
20+
return std::make_shared<Registry>(type);
2121

2222
try {
2323

@@ -125,23 +125,23 @@ std::shared_ptr<Registry> getCustomRegistry(const Settings & settings, const Pat
125125
return customRegistry;
126126
}
127127

128-
std::shared_ptr<Registry> getFlagRegistry(const Settings & settings)
128+
std::shared_ptr<Registry> getFlagRegistry()
129129
{
130-
static auto flagRegistry = std::make_shared<Registry>(settings, Registry::Flag);
130+
static auto flagRegistry = std::make_shared<Registry>(Registry::Flag);
131131
return flagRegistry;
132132
}
133133

134-
void overrideRegistry(const Settings & settings, const Input & from, const Input & to, const Attrs & extraAttrs)
134+
void overrideRegistry(const Input & from, const Input & to, const Attrs & extraAttrs)
135135
{
136-
getFlagRegistry(settings)->add(from, to, extraAttrs);
136+
getFlagRegistry()->add(from, to, extraAttrs);
137137
}
138138

139139
static std::shared_ptr<Registry> getGlobalRegistry(const Settings & settings, Store & store)
140140
{
141141
static auto reg = [&]() {
142142
auto path = settings.flakeRegistry.get();
143143
if (path == "") {
144-
return std::make_shared<Registry>(settings, Registry::Global); // empty registry
144+
return std::make_shared<Registry>(Registry::Global); // empty registry
145145
}
146146

147147
return Registry::read(
@@ -165,7 +165,7 @@ static std::shared_ptr<Registry> getGlobalRegistry(const Settings & settings, St
165165
Registries getRegistries(const Settings & settings, Store & store)
166166
{
167167
Registries registries;
168-
registries.push_back(getFlagRegistry(settings));
168+
registries.push_back(getFlagRegistry());
169169
registries.push_back(getUserRegistry(settings));
170170
registries.push_back(getSystemRegistry(settings));
171171
registries.push_back(getGlobalRegistry(settings, store));

0 commit comments

Comments
 (0)