1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-06 00:51:00 +01:00

Ensure all store types support "real" URIs

In particular `local://<path>` and `unix://` (without any path) now
work, and mean the same things as `local` and `daemon`, respectively. We
thus now have the opportunity to desguar `local` and `daemon` early.

This will allow me to make a change to
https://github.com/NixOS/nix/pull/9839 requested during review to
desugar those earlier.

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
This commit is contained in:
John Ericson 2024-01-25 10:31:52 -05:00
parent 3a7d62528d
commit 470c0501eb
19 changed files with 170 additions and 75 deletions

View file

@ -40,12 +40,13 @@ UDSRemoteStore::UDSRemoteStore(const Params & params)
UDSRemoteStore::UDSRemoteStore(
const std::string scheme,
std::string socket_path,
std::string_view scheme,
PathView socket_path,
const Params & params)
: UDSRemoteStore(params)
{
path.emplace(socket_path);
if (!socket_path.empty())
path.emplace(socket_path);
}
@ -54,6 +55,7 @@ std::string UDSRemoteStore::getUri()
if (path) {
return std::string("unix://") + *path;
} else {
// unix:// with no path also works. Change what we return?
return "daemon";
}
}