installer: newt: Use scheme-modules* instead of scheme-modules.
[jackhill/guix/guix.git] / gnu / installer / newt.scm
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)
20 #:use-module (gnu installer)
21 #:use-module (guix discovery)
22 #:use-module (guix gexp)
23 #:use-module (guix ui)
24 #:export (newt-installer))
25
26 (define (modules)
27 (cons '(newt)
28 (scheme-modules*
29 (dirname (search-path %load-path "guix.scm"))
30 "gnu/installer/newt")))
31
32 (define init
33 #~(begin
34 (newt-init)
35 (clear-screen)
36 (set-screen-size!)))
37
38 (define exit
39 #~(begin
40 (newt-finish)))
41
42 (define exit-error
43 #~(lambda (key args)
44 (newt-finish)))
45
46 (define locale-page
47 #~(lambda* (#:key
48 supported-locales
49 iso639-languages
50 iso3166-territories)
51 (run-locale-page
52 #:supported-locales supported-locales
53 #:iso639-languages iso639-languages
54 #:iso3166-territories iso3166-territories)))
55
56 (define timezone-page
57 #~(lambda* (zonetab)
58 (run-timezone-page zonetab)))
59
60 (define logo
61 (string-append
62 (dirname (search-path %load-path "guix.scm"))
63 "/gnu/installer/aux-files/logo.txt"))
64
65 (define welcome-page
66 #~(run-welcome-page #$(local-file logo)))
67
68 (define menu-page
69 #~(lambda (steps)
70 (run-menu-page steps)))
71
72 (define keymap-page
73 #~(lambda* (#:key models layouts)
74 (run-keymap-page #:models models
75 #:layouts layouts)))
76
77 (define network-page
78 #~(run-network-page))
79
80 (define hostname-page
81 #~(run-hostname-page))
82
83 (define user-page
84 #~(run-user-page))
85
86 (define newt-installer
87 (installer
88 (name 'newt)
89 (modules (modules))
90 (init init)
91 (exit exit)
92 (exit-error exit-error)
93 (keymap-page keymap-page)
94 (locale-page locale-page)
95 (menu-page menu-page)
96 (network-page network-page)
97 (timezone-page timezone-page)
98 (hostname-page hostname-page)
99 (user-page user-page)
100 (welcome-page welcome-page)))