1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 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 hostname)
25 #:use-module (gnu installer newt keymap)
26 #:use-module (gnu installer newt locale)
27 #:use-module (gnu installer newt menu)
28 #:use-module (gnu installer newt network)
29 #:use-module (gnu installer newt page)
30 #:use-module (gnu installer newt partition)
31 #:use-module (gnu installer newt services)
32 #:use-module (gnu installer newt timezone)
33 #:use-module (gnu installer newt user)
34 #:use-module (gnu installer newt utils)
35 #:use-module (gnu installer newt welcome)
36 #:use-module (gnu installer newt wifi)
37 #:use-module (guix config)
38 #:use-module (guix discovery)
39 #:use-module (guix i18n)
40 #:use-module (srfi srfi-26)
42 #:export (newt-installer))
53 (define (exit-error file key args)
54 (newt-set-color COLORSET-ROOT "white" "red")
55 (let ((width (nearest-exact-integer
56 (* (screen-columns) 0.8)))
57 (height (nearest-exact-integer
58 (* (screen-rows) 0.7))))
59 (run-file-textbox-page
60 #:info-text (format #f (G_ "The installer has encountered an unexpected \
61 problem. The backtrace is displayed below. Please report it by email to \
62 <~a>.") %guix-bug-report-address)
63 #:title (G_ "Unexpected problem")
66 #:info-textbox-width width
67 #:file-textbox-width width
68 #:file-textbox-height height))
69 (newt-set-color COLORSET-ROOT "white" "blue")
73 (define (final-page result prev-steps)
74 (run-final-page result prev-steps))
76 (define* (locale-page #:key
81 #:supported-locales supported-locales
82 #:iso639-languages iso639-languages
83 #:iso3166-territories iso3166-territories))
85 (define (timezone-page zonetab)
86 (run-timezone-page zonetab))
88 (define (welcome-page logo)
89 (run-welcome-page logo))
91 (define (menu-page steps)
92 (run-menu-page steps))
94 (define* (keymap-page layouts)
95 (run-keymap-page layouts))
97 (define (network-page)
100 (define (hostname-page)
106 (define (partition-page)
107 (run-partioning-page))
109 (define (services-page)
112 (define newt-installer
117 (exit-error exit-error)
118 (final-page final-page)
119 (keymap-page keymap-page)
120 (locale-page locale-page)
121 (menu-page menu-page)
122 (network-page network-page)
123 (timezone-page timezone-page)
124 (hostname-page hostname-page)
125 (user-page user-page)
126 (partition-page partition-page)
127 (services-page services-page)
128 (welcome-page welcome-page)))