summaryrefslogtreecommitdiff
path: root/guix/inferior.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-16 15:33:57 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-16 16:10:47 +0200
commit838ac881ec98cb71d4a4e4b20773573f99ecbf25 (patch)
treebf5b3c47c0dff0d6f7c9bd2892e710d3dd456ad0 /guix/inferior.scm
parenta9eeeaa6aeeafb817df3aad22a4b85205ac3ec13 (diff)
time-machine: Add '--disable-authentication'.
* guix/inferior.scm (cached-channel-instance): Add #:authenticate? and pass it to 'latest-channel-instances'. * guix/scripts/time-machine.scm (show-help, %options): Add '--disable-authentication'. (%default-options): Add 'authenticate-channels?'. (guix-time-machine): Honor it.
Diffstat (limited to 'guix/inferior.scm')
-rw-r--r--guix/inferior.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index c9a5ee5129..d347754bbc 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -687,13 +687,16 @@ failing when GUIX is too old and lacks the 'guix repl' command."
(define* (cached-channel-instance store
channels
#:key
+ (authenticate? #t)
(cache-directory (%inferior-cache-directory))
(ttl (* 3600 24 30)))
"Return a directory containing a guix filetree defined by CHANNELS, a list of channels.
The directory is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL seconds.
-This procedure opens a new connection to the build daemon."
+This procedure opens a new connection to the build daemon. AUTHENTICATE?
+determines whether CHANNELS are authenticated."
(define instances
- (latest-channel-instances store channels))
+ (latest-channel-instances store channels
+ #:authenticate? authenticate?))
(define key
(bytevector->base32-string
@@ -732,6 +735,8 @@ This procedure opens a new connection to the build daemon."
(mbegin %store-monad
(show-what-to-build* (list profile))
(built-derivations (list profile))
+ ;; Note: Caching is fine even when AUTHENTICATE? is false because
+ ;; we always call 'latest-channel-instances?'.
(symlink* (derivation->output-path profile) cached)
(add-indirect-root* cached)
(return cached))))))