summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-28 22:23:10 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-28 22:25:34 +0100
commit13bcc6b45fb7564347a55d03fa11b9bd8a96436d (patch)
tree97173d66618746d1e75af30440282b2734ed54c5
parenta52ae1b6620fcef28e668047a51a6b2a9fb89e35 (diff)
downloadguix-13bcc6b45fb7564347a55d03fa11b9bd8a96436d.tar.gz
download: Add berlin.guixsd.org as a content-addressed mirror.
* guix/download.scm (%content-addressed-mirrors)[guix-publish]: New
procedure.
Use it for "mirror.hydra.gnu.org" and add "berlin.guixsd.org" too.
-rw-r--r--guix/download.scm16
1 files changed, 10 insertions, 6 deletions
diff --git a/guix/download.scm b/guix/download.scm
index 7aebec44ac..a7f51b1999 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -375,18 +375,22 @@
   '(begin
      (use-modules (guix base32))
 
+     (define (guix-publish host)
+       (lambda (file algo hash)
+         ;; Files served by 'guix publish' are accessible under a single
+         ;; hash algorithm.
+         (string-append "https://" host "/file/"
+                        file "/" (symbol->string algo) "/"
+                        (bytevector->nix-base32-string hash))))
+
      ;; XXX: (guix base16) appeared in March 2017 (and thus 0.13.0) so old
      ;; installations of the daemon might lack it.  Thus, load it lazily to
      ;; avoid gratuitous errors.  See <https://bugs.gnu.org/33542>.
      (module-autoload! (current-module)
                        '(guix base16) '(bytevector->base16-string))
 
-     (list (lambda (file algo hash)
-             ;; Files served by 'guix publish' are accessible under a single
-             ;; hash algorithm.
-             (string-append "https://mirror.hydra.gnu.org/file/"
-                            file "/" (symbol->string algo) "/"
-                            (bytevector->nix-base32-string hash)))
+     (list (guix-publish "mirror.hydra.gnu.org")
+           (guix-publish "berlin.guixsd.org")
            (lambda (file algo hash)
              ;; 'tarballs.nixos.org' supports several algorithms.
              (string-append "https://tarballs.nixos.org/"