1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 21:50:58 +01:00

Gate the external gc behind an xp feature flag

This commit is contained in:
Théophane Hufschmitt 2022-04-11 10:20:37 +02:00
parent 240f1614d8
commit 8de54ed4e1
4 changed files with 7 additions and 1 deletions

View file

@ -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());

View file

@ -11,6 +11,7 @@ std::map<ExperimentalFeature, std::string> stringifiedXpFeatures = {
{ Xp::NixCommand, "nix-command" },
{ Xp::RecursiveNix, "recursive-nix" },
{ Xp::NoUrlLiterals, "no-url-literals" },
{ Xp::ExternalGCDaemon, "external-gc-daemon" },
};
const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name)

View file

@ -19,7 +19,8 @@ enum struct ExperimentalFeature
Flakes,
NixCommand,
RecursiveNix,
NoUrlLiterals
NoUrlLiterals,
ExternalGCDaemon,
};
/**

View file

@ -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. !!!