guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: self: 'guix-daemon' honors %localstatedir, %sysconfdir, and %stor


From: guix-commits
Subject: 01/03: self: 'guix-daemon' honors %localstatedir, %sysconfdir, and %storedir.
Date: Sun, 26 May 2019 17:21:52 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit dfc69e4b6d4bbc41a4d37b3cc6ea12adb34aaafa
Author: Ludovic Courtès <address@hidden>
Date:   Sun May 26 22:01:42 2019 +0200

    self: 'guix-daemon' honors %localstatedir, %sysconfdir, and %storedir.
    
    Fixes <https://bugs.gnu.org/35874>.
    Reported by Ricardo Wurmus <address@hidden>.
    
    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.
---
 guix/self.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/self.scm b/guix/self.scm
index 6d7569e..8cc82de 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -603,7 +603,21 @@ Info manual."
   (define (wrap daemon)
     (program-file "guix-daemon"
                   #~(begin
+                      ;; Refer to the right 'guix' command for 'guix
+                      ;; substitute' & co.
                       (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")
                              "guix-daemon" (cdr (command-line))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]