1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu installer newt)
20 #:use-module (gnu installer record)
21 #:use-module (gnu installer utils)
22 #:use-module (gnu installer newt ethernet)
23 #:use-module (gnu installer newt final)
24 #:use-module (gnu installer newt parameters)
25 #:use-module (gnu installer newt hostname)
26 #:use-module (gnu installer newt keymap)
27 #:use-module (gnu installer newt locale)
28 #:use-module (gnu installer newt menu)
29 #:use-module (gnu installer newt network)
30 #:use-module (gnu installer newt page)
31 #:use-module (gnu installer newt partition)
32 #:use-module (gnu installer newt services)
33 #:use-module (gnu installer newt substitutes)
34 #:use-module (gnu installer newt timezone)
35 #:use-module (gnu installer newt user)
36 #:use-module (gnu installer newt utils)
37 #:use-module (gnu installer newt welcome)
38 #:use-module (gnu installer newt wifi)
39 #:use-module (guix config)
40 #:use-module (guix discovery)
41 #:use-module (guix i18n)
42 #:use-module (srfi srfi-26)
44 #:export (newt-installer))
50 (syslog "Display is ~ax~a.~%" (screen-columns) (screen-rows))
52 (format #f (G_ "Press <F1> for installation parameters."))))
58 (define (exit-error file key args)
59 (newt-set-color COLORSET-ROOT "white" "red")
60 (let ((width (nearest-exact-integer
61 (* (screen-columns) 0.8)))
62 (height (nearest-exact-integer
63 (* (screen-rows) 0.7))))
64 (run-file-textbox-page
65 #:info-text (format #f (G_ "The installer has encountered an unexpected \
66 problem. The backtrace is displayed below. Please report it by email to \
67 <~a>.") %guix-bug-report-address)
68 #:title (G_ "Unexpected problem")
71 #:info-textbox-width width
72 #:file-textbox-width width
73 #:file-textbox-height height))
74 (newt-set-color COLORSET-ROOT "white" "blue")
78 (define (final-page result prev-steps)
79 (run-final-page result prev-steps))
81 (define* (locale-page #:key
86 #:supported-locales supported-locales
87 #:iso639-languages iso639-languages
88 #:iso3166-territories iso3166-territories))
90 (define (timezone-page zonetab)
91 (run-timezone-page zonetab))
93 (define (welcome-page logo)
94 (run-welcome-page logo))
96 (define (menu-page steps)
97 (run-menu-page steps))
99 (define* (keymap-page layouts context)
100 (run-keymap-page layouts #:context context))
102 (define (network-page)
105 (define (substitutes-page)
106 (run-substitutes-page))
108 (define (hostname-page)
114 (define (partition-page)
115 (run-partitioning-page))
117 (define (services-page)
120 (define (parameters-menu menu-proc)
121 (newt-set-help-callback menu-proc))
123 (define (parameters-page keyboard-layout-selection)
124 (run-parameters-page keyboard-layout-selection))
126 (define newt-installer
131 (exit-error exit-error)
132 (final-page final-page)
133 (keymap-page keymap-page)
134 (locale-page locale-page)
135 (menu-page menu-page)
136 (network-page network-page)
137 (substitutes-page substitutes-page)
138 (timezone-page timezone-page)
139 (hostname-page hostname-page)
140 (user-page user-page)
141 (partition-page partition-page)
142 (services-page services-page)
143 (welcome-page welcome-page)
144 (parameters-menu parameters-menu)
145 (parameters-page parameters-page)))