From 2842a42b518227607fed4470b0de1c84e3511beb Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Fri, 23 Apr 2021 14:50:15 -0400 Subject: installer: Recommend 'ntp-service-type' for non-graphical systems. We had several bug reports with a root cause of "the clock was incorrect" from users who used the installer to install a non-graphical Guix System. * gnu/installer/services.scm (%system-services): Add the ntp-service-type. * gnu/installer/newt/services.scm (run-system-administration-cbt-page): New variable. (run-services-page): Use run-system-administration-cbt-page when not installing a desktop. * gnu/installer/tests.scm (choose-services): Add and use a choose-misc-service? procedure. * gnu/tests/install.scm (installation-target-os-for-gui-tests): Add ntp-service-type. --- gnu/installer/newt/services.scm | 25 ++++++++++++++++++++++++- gnu/installer/services.scm | 8 ++++++++ gnu/installer/tests.scm | 9 +++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) (limited to 'gnu/installer') diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index b4b5219b20..c218825813 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2021 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -88,6 +89,27 @@ system.") (condition (&installer-step-abort))))))) +(define (run-console-services-cbt-page) + "Run a page to select various system adminstration services for non-graphical +systems." + (let ((items (filter (lambda (service) + (eq? 'administration + (system-service-type service))) + %system-services))) + (run-checkbox-tree-page + #:title (G_ "Console services") + #:info-text (G_ "Select miscellaneous services to run on your \ +non-graphical system.") + #:items items + #:selection (map system-service-recommended? items) + #:item->text (compose G_ system-service-name) + #:checkbox-tree-height 5 + #:exit-button-callback-procedure + (lambda () + (raise + (condition + (&installer-step-abort))))))) + (define (run-network-management-page) "Run a page to select among several network management methods." (let ((title (G_ "Network management"))) @@ -119,6 +141,7 @@ client may be enough for a server.") (append desktop (run-networking-cbt-page) (if (null? desktop) - (list (run-network-management-page)) + (cons (run-network-management-page) + (run-console-services-cbt-page)) '()) (run-printing-services-cbt-page)))) diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index 341d8b69c8..94c49307f0 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2021 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -104,6 +105,13 @@ (packages '((specification->package "nss-certs"))) (recommended? #t)) + ;; Miscellaneous system administration services. + (system-service + (name (G_ "Network time service (NTP), to set the clock automatically")) + (type 'administration) + (recommended? #t) + (snippet '((service ntp-service-type)))) + ;; Network connectivity management. (system-service (name (G_ "NetworkManager network connection manager")) diff --git a/gnu/installer/tests.scm b/gnu/installer/tests.scm index 5d931149b8..3c049a1c85 100644 --- a/gnu/installer/tests.scm +++ b/gnu/installer/tests.scm @@ -221,7 +221,11 @@ ROOT-PASSWORD, and USERS." (choose-network-management-tool? (lambda (service) (string-contains service "DHCP"))) + (choose-misc-service? + (lambda (service) + (string-contains service "NTP"))) (choose-other-service? (const #f))) + "Converse over PORT to choose services." (define desktop-environments '()) @@ -243,6 +247,11 @@ ROOT-PASSWORD, and USERS." (null? desktop-environments) (find choose-network-management-tool? services)) + ((checkbox-list (title "Console services") (text _) + (items ,services)) + (null? desktop-environments) + (filter choose-misc-service? services)) + ((checkbox-list (title "Printing and document services") (text _) (items ,services)) (filter choose-other-service? services)))) -- cgit v1.2.3