Commit | Line | Data |
---|---|---|
d0f3a672 MO |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
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. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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/>. | |
18 | ||
19 | (define-module (gnu installer newt) | |
a49d633c | 20 | #:use-module (gnu installer record) |
133c401f | 21 | #:use-module (gnu installer utils) |
a49d633c | 22 | #:use-module (gnu installer newt ethernet) |
dc5f3275 | 23 | #:use-module (gnu installer newt final) |
a49d633c MO |
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) | |
133c401f | 29 | #:use-module (gnu installer newt page) |
69a934f2 | 30 | #:use-module (gnu installer newt partition) |
b51bde71 | 31 | #:use-module (gnu installer newt services) |
a49d633c MO |
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) | |
133c401f | 37 | #:use-module (guix config) |
d0f3a672 | 38 | #:use-module (guix discovery) |
a49d633c MO |
39 | #:use-module (guix i18n) |
40 | #:use-module (srfi srfi-26) | |
41 | #:use-module (newt) | |
d0f3a672 MO |
42 | #:export (newt-installer)) |
43 | ||
a49d633c MO |
44 | (define (init) |
45 | (newt-init) | |
46 | (clear-screen) | |
47 | (set-screen-size!)) | |
d0f3a672 | 48 | |
a49d633c MO |
49 | (define (exit) |
50 | (newt-finish)) | |
d0f3a672 | 51 | |
133c401f MO |
52 | (define (exit-error file key args) |
53 | (newt-set-color COLORSET-ROOT "white" "red") | |
54 | (let ((width (nearest-exact-integer | |
55 | (* (screen-columns) 0.8))) | |
56 | (height (nearest-exact-integer | |
57 | (* (screen-rows) 0.7)))) | |
58 | (run-file-textbox-page | |
59 | #:info-text (format #f (G_ "The installer has encountered an unexpected \ | |
60 | problem. The backtrace is displayed below. Please report it by email to \ | |
61 | <~a>.") %guix-bug-report-address) | |
62 | #:title (G_ "Unexpected problem") | |
63 | #:file file | |
64 | #:exit-button? #f | |
65 | #:info-textbox-width width | |
66 | #:file-textbox-width width | |
67 | #:file-textbox-height height)) | |
68 | (newt-set-color COLORSET-ROOT "white" "blue") | |
a49d633c | 69 | (newt-finish)) |
d0f3a672 | 70 | |
dc5f3275 MO |
71 | (define (final-page result prev-steps) |
72 | (run-final-page result prev-steps)) | |
73 | ||
a49d633c MO |
74 | (define* (locale-page #:key |
75 | supported-locales | |
76 | iso639-languages | |
77 | iso3166-territories) | |
78 | (run-locale-page | |
79 | #:supported-locales supported-locales | |
80 | #:iso639-languages iso639-languages | |
81 | #:iso3166-territories iso3166-territories)) | |
d0f3a672 | 82 | |
a49d633c MO |
83 | (define (timezone-page zonetab) |
84 | (run-timezone-page zonetab)) | |
d0f3a672 | 85 | |
a49d633c MO |
86 | (define (welcome-page logo) |
87 | (run-welcome-page logo)) | |
d0f3a672 | 88 | |
a49d633c MO |
89 | (define (menu-page steps) |
90 | (run-menu-page steps)) | |
d0f3a672 | 91 | |
c088b2e4 MO |
92 | (define* (keymap-page layouts) |
93 | (run-keymap-page layouts)) | |
d0f3a672 | 94 | |
a49d633c MO |
95 | (define (network-page) |
96 | (run-network-page)) | |
d0f3a672 | 97 | |
a49d633c MO |
98 | (define (hostname-page) |
99 | (run-hostname-page)) | |
d0f3a672 | 100 | |
a49d633c MO |
101 | (define (user-page) |
102 | (run-user-page)) | |
d0f3a672 | 103 | |
69a934f2 MO |
104 | (define (partition-page) |
105 | (run-partioning-page)) | |
106 | ||
b51bde71 MO |
107 | (define (services-page) |
108 | (run-services-page)) | |
109 | ||
d0f3a672 MO |
110 | (define newt-installer |
111 | (installer | |
112 | (name 'newt) | |
d0f3a672 MO |
113 | (init init) |
114 | (exit exit) | |
115 | (exit-error exit-error) | |
dc5f3275 | 116 | (final-page final-page) |
d0f3a672 MO |
117 | (keymap-page keymap-page) |
118 | (locale-page locale-page) | |
119 | (menu-page menu-page) | |
120 | (network-page network-page) | |
121 | (timezone-page timezone-page) | |
122 | (hostname-page hostname-page) | |
123 | (user-page user-page) | |
69a934f2 | 124 | (partition-page partition-page) |
b51bde71 | 125 | (services-page services-page) |
d0f3a672 | 126 | (welcome-page welcome-page))) |