1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

Support arbitrary store URIs in nix.machines

For backwards compatibility, if the URI is just a hostname, ssh://
(i.e. LegacySSHStore) is prepended automatically.

Also, all fields except the URI are now optional. For example, this is
a valid nix.machines file:

  local?root=/tmp/nix

This is useful for testing the remote build machinery since you don't
have to mess around with ssh.
This commit is contained in:
Eelco Dolstra 2017-05-01 17:35:30 +02:00
parent 3e4bdfedee
commit 031d70e500
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 66 additions and 46 deletions

View file

@ -668,20 +668,31 @@ void removeTempRoots();
/* Return a Store object to access the Nix store denoted by
uri (slight misnomer...). Supported values are:
* direct: The Nix store in /nix/store and database in
* local: The Nix store in /nix/store and database in
/nix/var/nix/db, accessed directly.
* daemon: The Nix store accessed via a Unix domain socket
connection to nix-daemon.
* auto or : Equivalent to local or daemon depending on
whether the user has write access to the local Nix
store/database.
* file://<path>: A binary cache stored in <path>.
If uri is empty, it defaults to direct or daemon depending on
whether the user has write access to the local Nix store/database.
set to true *unless* you're going to collect garbage. */
ref<Store> openStore(const std::string & uri = getEnv("NIX_REMOTE"));
* https://<path>: A binary cache accessed via HTTP.
ref<Store> openStore(const std::string & uri, const Store::Params & params);
* s3://<path>: A writable binary cache stored on Amazon's Simple
Storage Service.
* ssh://[user@]<host>: A remote Nix store accessed by running
nix-store --serve via SSH.
You can pass parameters to the store implementation by appending
?key=value&key=value&... to the URI.
*/
ref<Store> openStore(const std::string & uri = getEnv("NIX_REMOTE"),
const Store::Params & extraParams = Store::Params());
void copyPaths(ref<Store> from, ref<Store> to, const PathSet & storePaths, bool substitute = false);