diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-12-04 23:48:21 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-12-04 23:48:21 +0100 |
commit | cd3ded43015f09c84990dd0dcae4cfd114387410 (patch) | |
tree | f80f144c13f546f7834acc98e2ed1dae76f1072c | |
parent | 860a6f1ae06151d76d39a402d3d92cc7ea6f36ff (diff) | |
download | guix-cd3ded43015f09c84990dd0dcae4cfd114387410.tar guix-cd3ded43015f09c84990dd0dcae4cfd114387410.tar.gz |
store: Honor $NIX_STORE_DIR and $NIX_STATE_DIR.
* guix/store.scm (%nix-state-dir): Honor $NIX_STATE_DIR.
(%store-prefix): Honor $NIX_STORE_DIR.
-rw-r--r-- | guix/store.scm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/store.scm b/guix/store.scm index d1621e4504..9aafb332dc 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -111,7 +111,8 @@ (sha1 2) (sha256 3)) -(define %nix-state-dir "/nix/var/nix") +(define %nix-state-dir + (or (getenv "NIX_STATE_DIR") "/nix/var/nix")) (define %default-socket-path (string-append %nix-state-dir "/daemon-socket/socket")) @@ -437,7 +438,8 @@ file name. Return #t on success." (define %store-prefix ;; Absolute path to the Nix store. - (make-parameter "/nix/store")) + (make-parameter (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path) + "/nix/store"))) (define (store-path? path) "Return #t if PATH is a store path." |