((installer-user-page current-installer))))
(configuration-formatter users->configuration))
+ ;; Ask the user to choose one or many desktop environment(s).
+ (installer-step
+ (id 'services)
+ (description (G_ "Services"))
(compute (lambda _
- ((installer-user-page current-installer)))))
+ ((installer-services-page current-installer))))
+ (configuration-formatter
+ desktop-environments->configuration))
- (installer-step
+ (installer-step
(id 'final)
(description (G_ "Configuration file"))
(compute
(lambda (result prev-steps)
((installer-final-page current-installer)
- result prev-steps)))))))
+ result prev-steps))))))))
(define (installer-program)
"Return a file-like object that runs the given INSTALLER."
#:use-module (gnu installer newt locale)
#:use-module (gnu installer newt menu)
#:use-module (gnu installer newt network)
+ #:use-module (gnu installer newt services)
#:use-module (gnu installer newt timezone)
#:use-module (gnu installer newt user)
#:use-module (gnu installer newt utils)
(define (user-page)
(run-user-page))
+(define (services-page)
+ (run-services-page))
+
(define newt-installer
(installer
(name 'newt)
(timezone-page timezone-page)
(hostname-page hostname-page)
(user-page user-page)
+ (services-page services-page)
(welcome-page welcome-page)))
--- /dev/null
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;;
+;;; 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 services)
+ #:use-module (gnu installer services)
+ #:use-module (gnu installer steps)
+ #:use-module (gnu installer newt page)
+ #:use-module (gnu installer newt utils)
+ #:use-module (guix i18n)
+ #:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-35)
+ #:use-module (newt)
+ #:export (run-services-page))
+
+(define (run-desktop-environments-cbt-page)
+ "Run a page allowing the user to choose between various desktop
+environments."
+ (run-checkbox-tree-page
+ #:info-text (G_ "Please select the desktop(s) environment(s) you wish to \
+install. If you select multiple desktops environments, we will be able to \
+choose the one to use on the log-in screen with F1.")
+ #:title (G_ "Desktop environment")
+ #:items %desktop-environments
+ #:item->text desktop-environment-name
+ #:checkbox-tree-height 5
+ #:cancel-button-callback-procedure
+ (lambda ()
+ (raise
+ (condition
+ (&installer-step-abort))))))
+
+(define (run-services-page)
+ (run-desktop-environments-cbt-page))
installer-timezone-page
installer-hostname-page
installer-user-page
+ installer-services-page
installer-welcome-page))
\f
(hostname-page installer-hostname-page)
;; procedure void -> void
(user-page installer-user-page)
+ ;; procedure void -> void
+ (services-page installer-services-page)
;; procedure (logo) -> void
(welcome-page installer-welcome-page))
--- /dev/null
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;;
+;;; 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 services)
+ #:use-module (guix records)
+ #:export (<desktop-environment>
+ desktop-environment
+ make-desktop-environment
+ desktop-environment-name
+ desktop-environment-snippet
+
+ %desktop-environments
+ desktop-environments->configuration))
+
+(define-record-type* <desktop-environment>
+ desktop-environment make-desktop-environment
+ desktop-environment?
+ (name desktop-environment-name) ;string
+ (snippet desktop-environment-snippet)) ;symbol
+
+;; This is the list of desktop environments supported as services.
+(define %desktop-environments
+ (list
+ (desktop-environment
+ (name "GNOME")
+ (snippet '(gnome-desktop-service)))
+ (desktop-environment
+ (name "Xfce")
+ (snippet '(xfce-desktop-service)))
+ (desktop-environment
+ (name "MATE")
+ (snippet '(mate-desktop-service)))
+ (desktop-environment
+ (name "Enlightenment")
+ (snippet '(service enlightenment-desktop-service-type)))))
+
+(define (desktop-environments->configuration desktop-environments)
+ "Return the configuration field for DESKTOP-ENVIRONMENTS."
+ (let ((snippets
+ (map desktop-environment-snippet desktop-environments)))
+ `(,@(if (null? snippets)
+ '()
+ `((services (cons* ,@snippets
+ %desktop-services)))))))
%D%/installer/keymap.scm \
%D%/installer/locale.scm \
%D%/installer/newt.scm \
+ %D%/installer/services.scm \
%D%/installer/steps.scm \
%D%/installer/timezone.scm \
%D%/installer/utils.scm \
%D%/installer/newt/menu.scm \
%D%/installer/newt/network.scm \
%D%/installer/newt/page.scm \
+ %D%/installer/newt/services.scm \
%D%/installer/newt/timezone.scm \
%D%/installer/newt/utils.scm \
%D%/installer/newt/welcome.scm \
gnu/installer/newt/menu.scm
gnu/installer/newt/network.scm
gnu/installer/newt/page.scm
+gnu/installer/newt/services.scm
gnu/installer/newt/timezone.scm
gnu/installer/newt/user.scm
gnu/installer/newt/utils.scm
gnu/installer/newt/welcome.scm
gnu/installer/newt/wifi.scm
+gnu/installer/services.scm
gnu/installer/steps.scm
gnu/installer/timezone.scm
gnu/installer/utils.scm