mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 05:56:03 +01:00
Add a proper nix option for the external GC
This commit is contained in:
parent
f76bfbfbd6
commit
240f1614d8
2 changed files with 10 additions and 2 deletions
|
|
@ -269,8 +269,9 @@ void LocalStore::findRootsNoTemp(Roots & roots, bool censor)
|
|||
throw SysError("cannot create Unix domain socket");
|
||||
closeOnExec(fd.get());
|
||||
|
||||
// FIXME: Don’t hardcode
|
||||
string socketPath = getEnv("NIX_GC_SOCKET_PATH").value_or("/nix/var/nix/gc-socket/socket");
|
||||
std::string socketPath = settings.gcSocketPath.get() != "auto"
|
||||
? settings.gcSocketPath.get()
|
||||
: stateDir.get() + gcSocketPath;
|
||||
|
||||
struct sockaddr_un addr;
|
||||
addr.sun_family = AF_UNIX;
|
||||
|
|
|
|||
|
|
@ -94,6 +94,13 @@ public:
|
|||
Setting<std::string> storeUri{this, getEnv("NIX_REMOTE").value_or("auto"), "store",
|
||||
"The default Nix store to use."};
|
||||
|
||||
Setting<std::string> gcSocketPath {
|
||||
this,
|
||||
getEnv("NIX_GC_SOCKET_PATH").value_or("auto"),
|
||||
"gc-socket-path",
|
||||
"Path to the socket used to communicate with an external GC."
|
||||
};
|
||||
|
||||
Setting<bool> keepFailed{this, false, "keep-failed",
|
||||
"Whether to keep temporary directories of failed builds."};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue