diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2018-12-05 14:41:48 +0900 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-01-17 14:04:23 +0100 |
| commit | b51bde71a9385f4e81fbea258bfb9e8ff48be119 (patch) | |
| tree | ebcd1332428ed202df0a911366c93cd1d149849b /gnu/installer/services.scm | |
| parent | c088b2e47f6675199f1ef545df7d04d4532e64e3 (diff) | |
installer: Add services page.
Add a page to select services, for now only desktop environments choice is
available.
* gnu/installer.scm (steps): Add services step.
* gnu/installer/newt.scm (newt-installer): Add services-page field.
* gnu/installer/newt/services.scm: New file.
* gnu/installer/record.scm (installer): Add services-page field.
* gnu/installer/services.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add new files.
* po/guix/POTFILES.in: Add new files.
Diffstat (limited to 'gnu/installer/services.scm')
| -rw-r--r-- | gnu/installer/services.scm | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm new file mode 100644 index 00000000000..ed44b876825 --- /dev/null +++ b/gnu/installer/services.scm | |||
| @@ -0,0 +1,59 @@ | |||
| 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 services) | ||
| 20 | #:use-module (guix records) | ||
| 21 | #:export (<desktop-environment> | ||
| 22 | desktop-environment | ||
| 23 | make-desktop-environment | ||
| 24 | desktop-environment-name | ||
| 25 | desktop-environment-snippet | ||
| 26 | |||
| 27 | %desktop-environments | ||
| 28 | desktop-environments->configuration)) | ||
| 29 | |||
| 30 | (define-record-type* <desktop-environment> | ||
| 31 | desktop-environment make-desktop-environment | ||
| 32 | desktop-environment? | ||
| 33 | (name desktop-environment-name) ;string | ||
| 34 | (snippet desktop-environment-snippet)) ;symbol | ||
| 35 | |||
| 36 | ;; This is the list of desktop environments supported as services. | ||
| 37 | (define %desktop-environments | ||
| 38 | (list | ||
| 39 | (desktop-environment | ||
| 40 | (name "GNOME") | ||
| 41 | (snippet '(gnome-desktop-service))) | ||
| 42 | (desktop-environment | ||
| 43 | (name "Xfce") | ||
| 44 | (snippet '(xfce-desktop-service))) | ||
| 45 | (desktop-environment | ||
| 46 | (name "MATE") | ||
| 47 | (snippet '(mate-desktop-service))) | ||
| 48 | (desktop-environment | ||
| 49 | (name "Enlightenment") | ||
| 50 | (snippet '(service enlightenment-desktop-service-type))))) | ||
| 51 | |||
| 52 | (define (desktop-environments->configuration desktop-environments) | ||
| 53 | "Return the configuration field for DESKTOP-ENVIRONMENTS." | ||
| 54 | (let ((snippets | ||
| 55 | (map desktop-environment-snippet desktop-environments))) | ||
| 56 | `(,@(if (null? snippets) | ||
| 57 | '() | ||
| 58 | `((services (cons* ,@snippets | ||
| 59 | %desktop-services))))))) | ||
