aboutsummaryrefslogtreecommitdiff
path: root/guix/self.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/self.scm')
-rw-r--r--guix/self.scm28
1 files changed, 25 insertions, 3 deletions
diff --git a/guix/self.scm b/guix/self.scm
index 8a474ffb54..0ad8c34e2a 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -672,9 +672,7 @@ assumed to be part of MODULES."
((_ variable rest ...)
(cons `(variable . ,variable)
(variables rest ...))))))
- (variables %config-directory %localstatedir %state-directory
- %store-database-directory %store-directory
- %storedir %sysconfdir %system)))
+ (variables %localstatedir %storedir %sysconfdir %system)))
(define* (make-config.scm #:key libgcrypt zlib gzip xz bzip2
(package-name "GNU Guix")
@@ -692,6 +690,10 @@ assumed to be part of MODULES."
%guix-version
%guix-bug-report-address
%guix-home-page-url
+ %store-directory
+ %state-directory
+ %store-database-directory
+ %config-directory
%libgcrypt
%libz
%gzip
@@ -703,6 +705,26 @@ assumed to be part of MODULES."
#~(define-public #$name #$value)))
%config-variables)
+ (define %store-directory
+ (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)
+ %storedir))
+
+ (define %state-directory
+ ;; This must match `NIX_STATE_DIR' as defined in
+ ;; `nix/local.mk'.
+ (or (getenv "NIX_STATE_DIR")
+ (string-append %localstatedir "/guix")))
+
+ (define %store-database-directory
+ (or (getenv "NIX_DB_DIR")
+ (string-append %state-directory "/db")))
+
+ (define %config-directory
+ ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as
+ ;; defined in `nix/local.mk'.
+ (or (getenv "GUIX_CONFIGURATION_DIRECTORY")
+ (string-append %sysconfdir "/guix")))
+
(define %guix-package-name #$package-name)
(define %guix-version #$package-version)
(define %guix-bug-report-address #$bug-report-address)