diff --git a/src/libstore/local-overlay-store.hh b/src/libstore/local-overlay-store.hh index 40ee75bca..44f0c77c8 100644 --- a/src/libstore/local-overlay-store.hh +++ b/src/libstore/local-overlay-store.hh @@ -56,6 +56,11 @@ struct LocalOverlayStoreConfig : virtual LocalStoreConfig const std::string name() override { return "Experimental Local Overlay Store"; } + std::optional experimentalFeature() const override + { + return ExperimentalFeature::LocalOverlayStore; + } + std::string doc() override { return diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 1fbf8995b..1863a0876 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1444,7 +1444,9 @@ std::shared_ptr openFromNonUri(const std::string & uri, const Store::Para } else if (uri == "local") { return std::make_shared(params); } else if (uri == "local-overlay") { - return std::make_shared(params); + auto store = std::make_shared(params); + experimentalFeatureSettings.require(store->experimentalFeature()); + return store; } else if (isNonUriPath(uri)) { Store::Params params2 = params; params2["root"] = absPath(uri); @@ -1512,6 +1514,7 @@ ref openStore(const std::string & uri_, params.insert(uriParams.begin(), uriParams.end()); if (auto store = openFromNonUri(uri, params)) { + experimentalFeatureSettings.require(store->experimentalFeature()); store->warnUnknownSettings(); return ref(store); } diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index 7c4112d32..422d18522 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -12,7 +12,7 @@ struct ExperimentalFeatureDetails std::string_view description; }; -constexpr std::array xpFeatureDetails = {{ +constexpr std::array xpFeatureDetails = {{ { .tag = Xp::CaDerivations, .name = "ca-derivations", @@ -228,6 +228,13 @@ constexpr std::array xpFeatureDetails = {{ Allow the use of the `read-only` parameter in [local store](@docroot@/command-ref/new-cli/nix3-help-stores.md#local-store) URIs. )", }, + { + .tag = Xp::LocalOverlayStore, + .name = "local-overlay-store", + .description = R"( + Allow the use of [local overlay store](@docroot@/command-ref/new-cli/nix3-help-stores.md#local-overlay-store). + )", + }, }}; static_assert( diff --git a/src/libutil/experimental-features.hh b/src/libutil/experimental-features.hh index faf2e9398..c044a858e 100644 --- a/src/libutil/experimental-features.hh +++ b/src/libutil/experimental-features.hh @@ -32,6 +32,7 @@ enum struct ExperimentalFeature DynamicDerivations, ParseTomlTimestamps, ReadOnlyLocalStore, + LocalOverlayStore, }; /** diff --git a/tests/overlay-local-store/common.sh b/tests/overlay-local-store/common.sh index 6bb5bc391..2d614b140 100644 --- a/tests/overlay-local-store/common.sh +++ b/tests/overlay-local-store/common.sh @@ -16,7 +16,7 @@ setupConfig () { addConfig "build-users-group = " } - +enableFeatures "local-overlay-store" storeDirs () { # Attempt to create store dirs on tmpfs volume.