aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-07-13 16:07:59 +0200
committerLudovic Courtès <ludo@gnu.org>2015-07-13 18:29:01 +0200
commitf8a8e0fe1653d4bd998a33f013ea2583b4a32a00 (patch)
treea6a322ce08ff58e185e6fe004927ee068b21fee7 /guix
parent24f5aaaf24e009de7f7402f2d311a26cafbf4f4a (diff)
downloadgnu-guix-f8a8e0fe1653d4bd998a33f013ea2583b4a32a00.tar
gnu-guix-f8a8e0fe1653d4bd998a33f013ea2583b4a32a00.tar.gz
guix build: Add '--substitute-urls' client option.
* guix/scripts/build.scm (%standard-build-options, show-build-options-help): Add --substitute-urls=URLS. (set-build-options-from-command-line): Honor it. * guix/store.scm (%default-substitute-urls): Make public. * doc/guix.texi (Substitutes): Add xref to the client --substitute-urls option. (Invoking guix build): Document it. (Invoking guix-daemon): Add 'daemon-substitute-urls' anchor.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/build.scm12
-rw-r--r--guix/store.scm1
2 files changed, 13 insertions, 0 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 7fd05da189..d593b5a8a7 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -118,6 +118,9 @@ options handled by 'set-build-options-from-command-line', and listed in
(display (_ "
--no-substitutes build instead of resorting to pre-built substitutes"))
(display (_ "
+ --substitute-urls=URLS
+ fetch substitute from URLS if they are authorized"))
+ (display (_ "
--no-build-hook do not attempt to offload builds via the build hook"))
(display (_ "
--max-silent-time=SECONDS
@@ -141,6 +144,8 @@ options handled by 'set-build-options-from-command-line', and listed in
#:max-build-jobs (or (assoc-ref opts 'max-jobs) 1)
#:fallback? (assoc-ref opts 'fallback?)
#:use-substitutes? (assoc-ref opts 'substitutes?)
+ #:substitute-urls (or (assoc-ref opts 'substitute-urls)
+ %default-substitute-urls)
#:use-build-hook? (assoc-ref opts 'build-hook?)
#:max-silent-time (assoc-ref opts 'max-silent-time)
#:timeout (assoc-ref opts 'timeout)
@@ -177,6 +182,13 @@ options handled by 'set-build-options-from-command-line', and listed in
(alist-cons 'substitutes? #f
(alist-delete 'substitutes? result))
rest)))
+ (option '("substitute-urls") #t #f
+ (lambda (opt name arg result . rest)
+ (apply values
+ (alist-cons 'substitute-urls
+ (string-tokenize arg)
+ (alist-delete 'substitute-urls result))
+ rest)))
(option '("no-build-hook") #f #f
(lambda (opt name arg result . rest)
(apply values
diff --git a/guix/store.scm b/guix/store.scm
index 39e5faf6c8..132b8a3ac4 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -37,6 +37,7 @@
#:use-module (ice-9 popen)
#:export (%daemon-socket-file
%gc-roots-directory
+ %default-substitute-urls
nix-server?
nix-server-major-version