[bug#70494,14/23] scripts: perform-download: Support configuring the %store-prefix.
Commit Message
* guix/scripts/perform-download.scm (guix-perform-download): Use
GUIX_STORE_DIRECTORY from the environment if it's set, as this allows using
the perform-download script with a non-default store directory.
Change-Id: Id96bb901a106e1b13be5b21b3ce436c680c616a2
---
guix/scripts/perform-download.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
Christopher Baines <mail@cbaines.net> skribis:
> * guix/scripts/perform-download.scm (guix-perform-download): Use
> GUIX_STORE_DIRECTORY from the environment if it's set, as this allows using
> the perform-download script with a non-default store directory.
>
> Change-Id: Id96bb901a106e1b13be5b21b3ce436c680c616a2
[...]
> + (and=> (getenv "GUIX_STORE_DIRECTORY")
> + %store-prefix)
‘%store-prefix’ is a parameter, and it already honors NIX_STORE_DIR by
default. ‘GUIX_STORE_DIRECTORY’ isn’t used anywhere AFAICS.
Maybe let’s stick to what we currently have?
@@ -20,7 +20,8 @@ (define-module (guix scripts perform-download)
#:use-module (guix ui)
#:use-module (guix scripts)
#:use-module (guix derivations)
- #:use-module ((guix store) #:select (derivation-path? store-path?))
+ #:use-module ((guix store) #:select (%store-prefix derivation-path?
+ store-path?))
#:autoload (guix build download) (%download-methods url-fetch)
#:autoload (guix build git) (git-fetch-with-fallback)
#:autoload (guix config) (%git)
@@ -153,6 +154,9 @@ (define-command (guix-perform-download . args)
(#f #f)
(str (string-contains str "print-extended-build-trace=1"))))
+ (and=> (getenv "GUIX_STORE_DIRECTORY")
+ %store-prefix)
+
;; This program must be invoked by guix-daemon under an unprivileged UID to
;; prevent things downloading from 'file:///etc/shadow' or arbitrary code
;; execution via the content-addressed mirror procedures. (That means we