guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Substitute Mirrors page to installer


From: Mathieu Othacehe
Subject: Re: Adding Substitute Mirrors page to installer
Date: Thu, 01 Apr 2021 11:22:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello,

Thanks for this patch, it seems to work fine!

> +         ;; Extract the substitute URLs of the user configuration.
> +         (os              (read-operating-system 
> (%installer-configuration-file)))
> +         (substitute-urls (and=> (find
> +                                   (lambda (service)
> +                                     (eq? guix-service-type
> +                                          (service-kind service)))
> +                                   (operating-system-services os))
> +                                 (compose guix-configuration-substitute-urls
> +                                          service-value)))

We could make the mirror selection a proper step, adding it to (gnu
installer record). Then in (gnu installer), you could add:

--8<---------------cut here---------------start------------->8---
  (installer-step
   (id 'mirrors)
   (description (G_ "Mirror substitute server"))
   (compute (lambda _
              ((installer-mirrors-page current-installer)))))
--8<---------------cut here---------------end--------------->8---

This way, you should be able to select the step result in
"run-final-page" this way:

--8<---------------cut here---------------start------------->8---
(let* ((configuration   (format-configuration prev-steps result))
       (user-partitions (result-step result 'partition))
       (locale          (result-step result 'locale))
       (users           (result-step result 'user))
       (mirrors         (result-step result 'mirrors))
       (install-ok?
        (with-mounted-partitions
         user-partitions
         (configuration->file configuration)
         (run-config-display-page #:locale locale)
         (run-install-shell locale #:users users #:mirrors mirrors))))
  ...)
--8<---------------cut here---------------end--------------->8---

That would avoid the need to parse the resulting configuration file.

> +(define (run-substitute-mirror-page)
> +  (let ((title (G_ "Substitute mirror")))
> +    (run-listbox-selection-page
> +      #:title title
> +      #:info-text (G_ "Choose a server to get substitutes from.
> +
> +Depending on your location, the official substitutes server can be slow; \
> +in that case, using a mirror may be faster.")

I wonder if it would make sense to select multiple mirrors, as fallback
if the preferred mirror is not up to date. We could also add the
possibility for the user to add a mirror manually.

In that case, the mirror page could look like the "User creation" page,
with an "Add" button opening a popup proposing to type a mirror URL or
to select one from an existing list.

WDYT?

Thanks,

Mathieu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]