unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45023] [PATCH] install: Discover local substitute servers.
@ 2020-12-03 14:01 Mathieu Othacehe
  2020-12-04 13:05 ` Mathieu Othacehe
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Othacehe @ 2020-12-03 14:01 UTC (permalink / raw)
  To: 45023; +Cc: Mathieu Othacehe

* gnu/system/install.scm (%installation-services): Add avahi-service-type and
enable substitute server discover in guix-service-type.
[<name-service-switch>]: Set it to %mdns-host-lookup-nss.
---

Hello,

This allows the installation image to use local substitute servers discovered
using Avahi.

It only increases the image closure by 10MiB.

Thanks,

Mathieu

 gnu/system/install.scm | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 7701297411..7720a42c60 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -34,6 +34,7 @@
   #:use-module ((guix store) #:select (%store-prefix))
   #:use-module (gnu installer)
   #:use-module (gnu system locale)
+  #:use-module (gnu services avahi)
   #:use-module (gnu services dbus)
   #:use-module (gnu services networking)
   #:use-module (gnu services shepherd)
@@ -335,11 +336,18 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
           ;; The usual services.
           (syslog-service)
 
+          ;; Use the Avahi daemon to discover substitute servers on the local
+          ;; network.  It can be faster than fetching from remote servers.
+          (service avahi-service-type
+                   (avahi-configuration (debug? #t)))
+
           ;; The build daemon.  Register the default substitute server key(s)
-          ;; as trusted to allow the installation process to use substitutes by
-          ;; default.
+          ;; as trusted to allow the installation process to use substitutes
+          ;; by default.
           (service guix-service-type
-                   (guix-configuration (authorize-key? #t)))
+                   (guix-configuration
+                    (authorize-key? #t)
+                    (discover? #t))) ;see above.
 
           ;; Start udev so that useful device nodes are available.
           ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
@@ -435,6 +443,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
     (host-name "gnu")
     (timezone "Europe/Paris")
     (locale "en_US.utf8")
+    (name-service-switch %mdns-host-lookup-nss)
     (bootloader (bootloader-configuration
                  (bootloader grub-bootloader)
                  (target "/dev/sda")))
-- 
2.29.2





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-11 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 14:01 [bug#45023] [PATCH] install: Discover local substitute servers Mathieu Othacehe
2020-12-04 13:05 ` Mathieu Othacehe
2020-12-11 16:45   ` Ludovic Courtès
2020-12-11 20:43     ` bug#45023: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).