mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 20:27:36 -05:00
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.
This commit is contained in:
parent
a1143ee3fa
commit
05c0ac721e
1 changed files with 10 additions and 2 deletions
|
@ -31,7 +31,9 @@ (define-module (guix store)
|
|||
#: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 @@ (define %default-socket-path
|
|||
(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 @@ (define-condition-type &nix-protocol-error &nix-error
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue