self: 'guix-daemon' honors %localstatedir, %sysconfdir, and %storedir.

Fixes <https://bugs.gnu.org/35874>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

Previously, the 'guix-daemon' program provided by 'guix pull' would
systematically use default directory locations for these.

* guix/self.scm (whole-package)[wrap]: Set GUIX_STATE_DIRECTORY,
GUIX_CONFIGURATION_DIRECTORY, and NIX_STORE_DIR.
This commit is contained in:
Ludovic Courtès 2019-05-26 22:01:42 +02:00
parent 45bdb66251
commit dfc69e4b6d
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 14 additions and 0 deletions

View File

@ -603,7 +603,21 @@ Info manual."
(define (wrap daemon) (define (wrap daemon)
(program-file "guix-daemon" (program-file "guix-daemon"
#~(begin #~(begin
;; Refer to the right 'guix' command for 'guix
;; substitute' & co.
(setenv "GUIX" #$command) (setenv "GUIX" #$command)
;; Honor the user's settings rather than those hardcoded
;; in the 'guix-daemon' package.
(unless (getenv "GUIX_STATE_DIRECTORY")
(setenv "GUIX_STATE_DIRECTORY"
#$(string-append %localstatedir "/guix")))
(unless (getenv "GUIX_CONFIGURATION_DIRECTORY")
(setenv "GUIX_CONFIGURATION_DIRECTORY"
#$(string-append %sysconfdir "/guix")))
(unless (getenv "NIX_STORE_DIR")
(setenv "NIX_STORE_DIR" %storedir))
(apply execl #$(file-append daemon "/bin/guix-daemon") (apply execl #$(file-append daemon "/bin/guix-daemon")
"guix-daemon" (cdr (command-line)))))) "guix-daemon" (cdr (command-line))))))