aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-18 21:53:59 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-27 20:55:41 +0100
commit05c0ac721e9411b1ac34f15a910b90bdf64b839a (patch)
treeb950a514860e757b655b10bdf7ccaac8a79a673a
parenta1143ee3fad712e74deefa7eb7f62b323789b8bb (diff)
downloadpatches-05c0ac721e9411b1ac34f15a910b90bdf64b839a.tar
patches-05c0ac721e9411b1ac34f15a910b90bdf64b839a.tar.gz
store: Add the `%daemon-socket-file' parameter.
* guix/store.scm (%daemon-socket-file): New variable. (open-connection): Use it as the default value for FILE.
-rw-r--r--guix/store.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 6a3f036a8c..3627d5be04 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -31,7 +31,9 @@
#:use-module (ice-9 rdelim)
#:use-module (ice-9 ftw)
#:use-module (ice-9 regex)
- #:export (nix-server?
+ #:export (%daemon-socket-file
+
+ nix-server?
nix-server-major-version
nix-server-minor-version
nix-server-socket
@@ -143,6 +145,12 @@
(string-append (or (getenv "NIX_STATE_DIR") %state-directory)
"/daemon-socket/socket"))
+(define %daemon-socket-file
+ ;; File name of the socket the daemon listens too.
+ (make-parameter (or (getenv "GUIX_DAEMON_SOCKET")
+ %default-socket-path)))
+
+
;; serialize.cc
@@ -365,7 +373,7 @@
(message nix-protocol-error-message)
(status nix-protocol-error-status))
-(define* (open-connection #:optional (file %default-socket-path)
+(define* (open-connection #:optional (file (%daemon-socket-file))
#:key (reserve-space? #t))
"Connect to the daemon over the Unix-domain socket at FILE. When
RESERVE-SPACE? is true, instruct it to reserve a little bit of extra