From 1397b422e254929de1805aaf1d0759cd5da6a60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 21 Apr 2017 11:39:49 +0200 Subject: store: 'GUIX_DAEMON_SOCKET' can now be a URI. * guix/store.scm (%daemon-socket-file): Rename to... (%daemon-socket-uri): ... this. (connect-to-daemon): New procedure. (open-connection): Rename 'file' to 'uri'. Use 'connect-to-daemon' instead of 'open-unix-domain-socket'. * guix/tests.scm (open-connection-for-tests): Rename 'file' to 'uri'. * tests/guix-build.sh: Add tests. * tests/store.scm ("open-connection with file:// URI"): New tests. --- doc/guix.texi | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 753c3998e5..5f973e2fe1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3666,10 +3666,30 @@ accidental modifications. @end quotation The @code{(guix store)} module provides procedures to connect to the -daemon, and to perform RPCs. These are described below. +daemon, and to perform RPCs. These are described below. By default, +@code{open-connection}, and thus all the @command{guix} commands, +connect to the local daemon or to the URI specified by the +@code{GUIX_DAEMON_SOCKET} environment variable. -@deffn {Scheme Procedure} open-connection [@var{file}] [#:reserve-space? #t] -Connect to the daemon over the Unix-domain socket at @var{file}. When +@defvr {Environment Variable} GUIX_DAEMON_SOCKET +When set, the value of this variable should be a file name or a URI +designating the daemon endpoint. When it is a file name, it denotes a +Unix-domain socket to connect to. In addition to file names, the +supported URI schemes are: + +@table @code +@item file +@itemx unix +These are for Unix-domain sockets. +@code{file:///var/guix/daemon-socket/socket} is equivalent to +@file{/var/guix/daemon-socket/socket}. +@end table + +Additional URI schemes may be supported in the future. +@end defvr + +@deffn {Scheme Procedure} open-connection [@var{uri}] [#:reserve-space? #t] +Connect to the daemon over the Unix-domain socket at @var{uri} (a string). When @var{reserve-space?} is true, instruct it to reserve a little bit of extra space on the file system so that the garbage collector can still operate should the disk become full. Return a server object. -- cgit v1.2.3