diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 98a7866a1..ecf157c0b 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -283,6 +283,8 @@ void LocalStore::findRootsNoTemp(Roots & roots, bool censor) if (::connect(fd.get(), (struct sockaddr *) &addr, sizeof(addr)) == -1) return findRootsNoTempNoExternalDaemon(roots, censor); + settings.requireExperimentalFeature(Xp::ExternalGCDaemon); + try { while (true) { auto line = readLine(fd.get()); diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc index b49f47e1d..7002acc56 100644 --- a/src/libutil/experimental-features.cc +++ b/src/libutil/experimental-features.cc @@ -11,6 +11,7 @@ std::map stringifiedXpFeatures = { { Xp::NixCommand, "nix-command" }, { Xp::RecursiveNix, "recursive-nix" }, { Xp::NoUrlLiterals, "no-url-literals" }, + { Xp::ExternalGCDaemon, "external-gc-daemon" }, }; const std::optional parseExperimentalFeature(const std::string_view & name) diff --git a/src/libutil/experimental-features.hh b/src/libutil/experimental-features.hh index 291a58e32..29b1d51b8 100644 --- a/src/libutil/experimental-features.hh +++ b/src/libutil/experimental-features.hh @@ -19,7 +19,8 @@ enum struct ExperimentalFeature Flakes, NixCommand, RecursiveNix, - NoUrlLiterals + NoUrlLiterals, + ExternalGCDaemon, }; /** diff --git a/tests/gc-external-daemon.sh b/tests/gc-external-daemon.sh index 3a321ce99..2aec36e02 100644 --- a/tests/gc-external-daemon.sh +++ b/tests/gc-external-daemon.sh @@ -1,5 +1,7 @@ source common.sh +sed -i 's/experimental-features .*/& external-gc-daemon/' "$NIX_CONF_DIR"/nix.conf + export NIX_GC_SOCKET_PATH=$TEST_ROOT/gc.socket startGcDaemon() { # Start the daemon, wait for the socket to appear. !!!