unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: 47979@debbugs.gnu.org
Subject: [bug#47979] [PATCH v3] installer: Recommend 'ntp-service-type' for non-graphical systems.
Date: Fri, 23 Apr 2021 20:56:43 -0400	[thread overview]
Message-ID: <YINsy8LNhQd4NYmq@jasmine.lan> (raw)
In-Reply-To: <YINOJ3HMdKFFKASf@jasmine.lan>


[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]

On Fri, Apr 23, 2021 at 06:45:59PM -0400, Leo Famulari wrote:
> ice-9/eval.scm:159:9: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): (#<<system-service> name: "Network time service, to set the clock automatically" type: administration recommended?: #t snippet: ((service ntp-service-type)) packages: ()>)

With Leo Prikler's help on #guix [0], I got it to work :)

I've attached the working patch, as well as a patch to offer the GPM
"console mouse" service on non-graphical systems.

[0] http://logs.guix.gnu.org/guix/2021-04-24.log#012921

[-- Attachment #1.2: 0001-installer-Recommend-ntp-service-type-for-non-graphic.patch --]
[-- Type: text/plain, Size: 3719 bytes --]

From 6f2f131551247aa20794007c43ae61b82f6e34d6 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Fri, 23 Apr 2021 14:50:15 -0400
Subject: [PATCH 1/2] 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/newt/services.scm | 23 ++++++++++++++++++++++-
 gnu/installer/services.scm      |  8 ++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm
index 74f28e41ba..ee003b24b1 100644
--- a/gnu/installer/newt/services.scm
+++ b/gnu/installer/newt/services.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -68,6 +69,25 @@ system.")
         (condition
          (&installer-step-abort)))))))
 
+(define (run-system-administration-cbt-page)
+  "Run a page to select various system adminstration services."
+  (let ((items (filter (lambda (service)
+                         (eq? 'administration
+                              (system-service-type service)))
+                       %system-services)))
+    (run-checkbox-tree-page
+      #:title (G_ "Miscellaneous services")
+      #:info-text (G_ "Select miscellaneous services to run on your 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")))
@@ -99,5 +119,6 @@ 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-system-administration-cbt-page))
                 '()))))
diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm
index ec5ea30594..b50bd3e412 100644
--- a/gnu/installer/services.scm
+++ b/gnu/installer/services.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
 ;;;
 ;;; 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, 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"))
-- 
2.31.1


[-- Attachment #1.3: 0002-installer-Offer-gpm-service-type-for-non-graphical-s.patch --]
[-- Type: text/plain, Size: 963 bytes --]

From a00274e70d700b9325ad9ab7cd1804d444a5dc37 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Fri, 23 Apr 2021 20:42:28 -0400
Subject: [PATCH 2/2] installer: Offer 'gpm-service-type' for non-graphical
 systems.

* gnu/installer/services.scm (%system-services): Add the gpm-service-type.
---
 gnu/installer/services.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm
index b50bd3e412..27beb5da66 100644
--- a/gnu/installer/services.scm
+++ b/gnu/installer/services.scm
@@ -111,6 +111,10 @@
        (type 'administration)
        (recommended? #t)
        (snippet '((service ntp-service-type))))
+     (system-service
+       (name (G_ "GPM mouse daemon, to use the mouse in the console"))
+       (type 'administration)
+       (snippet '((service gpm-service-type))))
 
      ;; Network connectivity management.
      (system-service
-- 
2.31.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-04-24 14:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 18:53 [bug#47979] [PATCH] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-04-23 18:56 ` Leo Famulari
2021-04-23 22:45   ` Leo Famulari
2021-04-23 23:20     ` Leo Famulari
2021-04-24  0:56     ` Leo Famulari [this message]
2021-05-02  4:36       ` [bug#47979] [PATCH v3] " Leo Famulari
2021-05-02  9:25         ` Mathieu Othacehe
2021-05-02 15:22           ` Leo Famulari
2021-05-21 12:58       ` [bug#47979] [PATCH] " Mathieu Othacehe
2021-05-21 13:37         ` Leo Famulari
2021-05-21 14:21         ` Leo Famulari
2021-05-21 14:26           ` Leo Famulari
2021-05-21 14:39           ` Mathieu Othacehe
2021-05-21 21:01         ` Leo Famulari
2021-05-21 21:44           ` Leo Famulari
2021-06-01  9:49           ` Mathieu Othacehe
2021-12-24 18:04 ` [bug#47979] [PATCH v5] gnu: binutils: Fix CVE-2021-45078 Leo Famulari
2021-12-24 18:04 ` [bug#47979] [PATCH v5 1/2] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-24 18:04   ` [bug#47979] [PATCH v5 2/2] installer: Offer 'gpm-service-type' " Leo Famulari
2021-12-24 18:14   ` [bug#47979] [PATCH v5 1/2] installer: Recommend 'ntp-service-type' " Leo Famulari
2021-12-26 20:31 ` [bug#47979] [PATCH v6 1/3] installer: Offer the CUPS printing service on a dedicated page Leo Famulari
2021-12-26 20:31   ` [bug#47979] [PATCH v6 2/3] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-26 20:33     ` Leo Famulari
2021-12-26 21:06       ` Mathieu Othacehe
2021-12-27  0:57         ` Leo Famulari
2021-12-26 20:31   ` [bug#47979] [PATCH v6 3/3] installer: Offer 'gpm-service-type' " Leo Famulari
2021-12-27 22:24 ` [bug#47979] [PATCH v7 1/3] installer: Offer the CUPS printing service on a dedicated page Leo Famulari
2021-12-27 22:24   ` [bug#47979] [PATCH v7 2/3] installer: Recommend 'ntp-service-type' for non-graphical systems Leo Famulari
2021-12-27 23:53     ` Leo Famulari
2021-12-28  4:54     ` Leo Famulari
2021-12-28  8:27       ` Mathieu Othacehe
2021-12-28 20:34         ` bug#47979: " Leo Famulari
2021-12-27 22:24   ` [bug#47979] [PATCH v7 3/3] installer: Offer 'gpm-service-type' " Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YINsy8LNhQd4NYmq@jasmine.lan \
    --to=leo@famulari.name \
    --cc=47979@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).