diff options
| author | Rutherther <rutherther@ditigal.xyz> | 2025-10-14 22:23:04 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-10-17 12:23:55 +0200 |
| commit | 9ea2174ba8f05445227c952e0faa17d9f65ddb8f (patch) | |
| tree | e2cfb6a7858267d94ff9ef81fc6b40497258bb21 /gnu | |
| parent | 0b35df4c8b9f1cc80eaadff0e0444e16cfa5375f (diff) | |
installer: network: Add step for substitute availability.
Notifies the user if substitutes are not available to
let them know they might have to build a lot of software.
* gnu/installer/newt/network.scm
(check-substitute-availability): Step for checking if substitutes are available.
(run-network-page): Add the step.
Change-Id: Ia7f54b7a5b70b371240b9e732c7eff078d2c2184
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/installer/newt/network.scm | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index b29a475fba2..459c6d58d8c 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -165,6 +165,36 @@ Internet. The install process requires Internet access. \ Do you want to continue anyway?")) ((2) (abort-to-prompt 'installer-step 'abort)))))) +(define (check-substitute-availability) + "Check that at least one of the Guix substitute servers is available." + (define (substitutes-available?) + (common-urls-alive? + (list + "https://bordeaux.guix.gnu.org/nix-cache-info" + "https://ci.guix.gnu.org/nix-cache-info"))) + + (let* ((full-value 5)) + (run-scale-page + #:title (G_ "Checking substitutes") + #:info-text (G_ "Checking if Guix substitutes are available...") + #:scale-full-value full-value + #:scale-update-proc + (lambda (value) + (sleep 1) + (if (substitutes-available?) + full-value + (+ value 1)))) + (unless (substitutes-available?) + (case (choice-window + (G_ "Substitute availability") + (G_ "Continue") + (G_ "Try again?") + (G_ " +None of the Guix substitute servers are available. +You can proceed with the install, but you will +have to build most of the packages you install locally.")) + ((2) (abort-to-prompt 'installer-step 'abort)))))) + (define (run-network-page) "Run a page to allow the user to configure connman so that it can access the Internet." @@ -202,7 +232,11 @@ Internet." (installer-step (id 'wait-online) (compute (lambda _ - (wait-service-online)))))) + (wait-service-online)))) + (installer-step + (id 'check-substitutes) + (compute (lambda _ + (check-substitute-availability)))))) (run-installer-steps #:steps network-steps #:rewind-strategy 'start)) |
