aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/registry.cc
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2022-12-12 17:08:01 +0100
committerGitHub <noreply@github.com>2022-12-12 17:08:01 +0100
commita642b1030188f7538ef6243cd7fd1404419a6933 (patch)
treeff0bd385f28f7d862cf86857f49efa611b7ab748 /src/libfetchers/registry.cc
parent11ef807c22acb3232f5ccf5f1c9a53b55280bd6c (diff)
parenta456630a5a93db170bbc5570ae0e1a48a16cbe09 (diff)
Merge pull request #5420 from bew/allow-disable-global-registry
Allow to disable global flake-registry with ""
Diffstat (limited to 'src/libfetchers/registry.cc')
-rw-r--r--src/libfetchers/registry.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libfetchers/registry.cc b/src/libfetchers/registry.cc
index acd1ff866..43c03beec 100644
--- a/src/libfetchers/registry.cc
+++ b/src/libfetchers/registry.cc
@@ -153,6 +153,9 @@ static std::shared_ptr<Registry> getGlobalRegistry(ref<Store> store)
{
static auto reg = [&]() {
auto path = fetchSettings.flakeRegistry.get();
+ if (path == "") {
+ return std::make_shared<Registry>(Registry::Global); // empty registry
+ }
if (!hasPrefix(path, "/")) {
auto storePath = downloadFile(store, path, "flake-registry.json", false).storePath;