2018-11-16 06:43:55 -05:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2020-03-30 06:24:56 -04:00
|
|
|
;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
|
2018-11-16 06:43:55 -05:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (gnu installer newt)
|
2018-11-23 22:25:03 -05:00
|
|
|
#:use-module (gnu installer record)
|
2018-12-05 21:11:04 -05:00
|
|
|
#:use-module (gnu installer utils)
|
2018-11-23 22:25:03 -05:00
|
|
|
#:use-module (gnu installer newt ethernet)
|
2018-12-05 00:30:16 -05:00
|
|
|
#:use-module (gnu installer newt final)
|
2020-04-08 04:16:25 -04:00
|
|
|
#:use-module (gnu installer newt parameters)
|
2018-11-23 22:25:03 -05:00
|
|
|
#:use-module (gnu installer newt hostname)
|
|
|
|
#:use-module (gnu installer newt keymap)
|
|
|
|
#:use-module (gnu installer newt locale)
|
|
|
|
#:use-module (gnu installer newt menu)
|
|
|
|
#:use-module (gnu installer newt network)
|
2018-12-05 21:11:04 -05:00
|
|
|
#:use-module (gnu installer newt page)
|
2018-12-05 00:57:28 -05:00
|
|
|
#:use-module (gnu installer newt partition)
|
2018-12-05 00:41:48 -05:00
|
|
|
#:use-module (gnu installer newt services)
|
2018-11-23 22:25:03 -05:00
|
|
|
#:use-module (gnu installer newt timezone)
|
|
|
|
#:use-module (gnu installer newt user)
|
|
|
|
#:use-module (gnu installer newt utils)
|
|
|
|
#:use-module (gnu installer newt welcome)
|
|
|
|
#:use-module (gnu installer newt wifi)
|
2018-12-05 21:11:04 -05:00
|
|
|
#:use-module (guix config)
|
2018-11-16 06:43:55 -05:00
|
|
|
#:use-module (guix discovery)
|
2018-11-23 22:25:03 -05:00
|
|
|
#:use-module (guix i18n)
|
|
|
|
#:use-module (srfi srfi-26)
|
|
|
|
#:use-module (newt)
|
2018-11-16 06:43:55 -05:00
|
|
|
#:export (newt-installer))
|
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (init)
|
|
|
|
(newt-init)
|
|
|
|
(clear-screen)
|
2020-03-30 06:24:56 -04:00
|
|
|
(set-screen-size!)
|
2020-11-06 04:59:54 -05:00
|
|
|
(syslog "Display is ~ax~a.~%" (screen-columns) (screen-rows))
|
2020-03-30 06:24:56 -04:00
|
|
|
(push-help-line
|
2020-04-08 04:16:25 -04:00
|
|
|
(format #f (G_ "Press <F1> for installation parameters."))))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (exit)
|
2018-12-07 20:37:56 -05:00
|
|
|
(newt-finish)
|
|
|
|
(clear-screen))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-12-05 21:11:04 -05:00
|
|
|
(define (exit-error file key args)
|
|
|
|
(newt-set-color COLORSET-ROOT "white" "red")
|
|
|
|
(let ((width (nearest-exact-integer
|
|
|
|
(* (screen-columns) 0.8)))
|
|
|
|
(height (nearest-exact-integer
|
|
|
|
(* (screen-rows) 0.7))))
|
|
|
|
(run-file-textbox-page
|
|
|
|
#:info-text (format #f (G_ "The installer has encountered an unexpected \
|
|
|
|
problem. The backtrace is displayed below. Please report it by email to \
|
|
|
|
<~a>.") %guix-bug-report-address)
|
|
|
|
#:title (G_ "Unexpected problem")
|
|
|
|
#:file file
|
|
|
|
#:exit-button? #f
|
|
|
|
#:info-textbox-width width
|
|
|
|
#:file-textbox-width width
|
|
|
|
#:file-textbox-height height))
|
|
|
|
(newt-set-color COLORSET-ROOT "white" "blue")
|
2018-12-07 20:37:56 -05:00
|
|
|
(newt-finish)
|
|
|
|
(clear-screen))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-12-05 00:30:16 -05:00
|
|
|
(define (final-page result prev-steps)
|
|
|
|
(run-final-page result prev-steps))
|
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define* (locale-page #:key
|
|
|
|
supported-locales
|
|
|
|
iso639-languages
|
|
|
|
iso3166-territories)
|
|
|
|
(run-locale-page
|
|
|
|
#:supported-locales supported-locales
|
|
|
|
#:iso639-languages iso639-languages
|
|
|
|
#:iso3166-territories iso3166-territories))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (timezone-page zonetab)
|
|
|
|
(run-timezone-page zonetab))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (welcome-page logo)
|
|
|
|
(run-welcome-page logo))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (menu-page steps)
|
|
|
|
(run-menu-page steps))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2020-03-30 06:24:56 -04:00
|
|
|
(define* (keymap-page layouts context)
|
|
|
|
(run-keymap-page layouts #:context context))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (network-page)
|
|
|
|
(run-network-page))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (hostname-page)
|
|
|
|
(run-hostname-page))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-11-23 22:25:03 -05:00
|
|
|
(define (user-page)
|
|
|
|
(run-user-page))
|
2018-11-16 06:43:55 -05:00
|
|
|
|
2018-12-05 00:57:28 -05:00
|
|
|
(define (partition-page)
|
2020-09-20 15:09:19 -04:00
|
|
|
(run-partitioning-page))
|
2018-12-05 00:57:28 -05:00
|
|
|
|
2018-12-05 00:41:48 -05:00
|
|
|
(define (services-page)
|
|
|
|
(run-services-page))
|
|
|
|
|
2020-04-08 04:16:25 -04:00
|
|
|
(define (parameters-menu menu-proc)
|
2020-03-30 06:24:56 -04:00
|
|
|
(newt-set-help-callback menu-proc))
|
|
|
|
|
2020-04-08 04:16:25 -04:00
|
|
|
(define (parameters-page keyboard-layout-selection)
|
|
|
|
(run-parameters-page keyboard-layout-selection))
|
2020-03-30 06:24:56 -04:00
|
|
|
|
2018-11-16 06:43:55 -05:00
|
|
|
(define newt-installer
|
|
|
|
(installer
|
|
|
|
(name 'newt)
|
|
|
|
(init init)
|
|
|
|
(exit exit)
|
|
|
|
(exit-error exit-error)
|
2018-12-05 00:30:16 -05:00
|
|
|
(final-page final-page)
|
2018-11-16 06:43:55 -05:00
|
|
|
(keymap-page keymap-page)
|
|
|
|
(locale-page locale-page)
|
|
|
|
(menu-page menu-page)
|
|
|
|
(network-page network-page)
|
|
|
|
(timezone-page timezone-page)
|
|
|
|
(hostname-page hostname-page)
|
|
|
|
(user-page user-page)
|
2018-12-05 00:57:28 -05:00
|
|
|
(partition-page partition-page)
|
2018-12-05 00:41:48 -05:00
|
|
|
(services-page services-page)
|
2020-03-30 06:24:56 -04:00
|
|
|
(welcome-page welcome-page)
|
2020-04-08 04:16:25 -04:00
|
|
|
(parameters-menu parameters-menu)
|
|
|
|
(parameters-page parameters-page)))
|