GNU bug report logs - #39633
[PATCH] services: set-xorg-configuration: handle slim and sddm

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Sun, 16 Feb 2020 16:13:02 UTC

Severity: normal

Tags: patch

Done: Jakub Kądziołka <kuba <at> kadziolka.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39633 in the body.
You can then email your comments to 39633 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39633; Package guix-patches. (Sun, 16 Feb 2020 16:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 16 Feb 2020 16:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: set-xorg-configuration: handle slim and sddm
Date: Sun, 16 Feb 2020 17:12:32 +0100
* gnu/services/xorg.scm (handle-xorg-configuration): New syntax.
  (gdm-service-type, slim-service-type): Use handle-xorg-configuration.
* gnu/services/sddm.scm (sddm-service-type): Likewise.
---
NOTE: This patch is best reviewed with git's -w option.

 gnu/services/sddm.scm |  34 ++++++-------
 gnu/services/xorg.scm | 108 +++++++++++++++++++++++-------------------
 2 files changed, 77 insertions(+), 65 deletions(-)

diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm
index 473b4876a1..1921afce95 100644
--- a/gnu/services/sddm.scm
+++ b/gnu/services/sddm.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
 ;;; Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve <at> protonmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -306,22 +307,23 @@ Relogin="              (if (sddm-configuration-relogin? config)
   (compose list sddm-configuration-sddm))
 
 (define sddm-service-type
-  (service-type (name 'sddm)
-                (extensions
-                  (list (service-extension shepherd-root-service-type
-                                           sddm-shepherd-service)
-                        (service-extension etc-service-type
-                                           sddm-etc-service)
-                        (service-extension pam-root-service-type
-                                           sddm-pam-services)
-                        (service-extension account-service-type
-                                           (const %sddm-accounts))
-                        (service-extension profile-service-type
-                                           sddm-profile-service)))
-                (default-value (sddm-configuration))
-                (description
-                 "Run SDDM, a display and log-in manager for X11 and
-Wayland.")))
+  (handle-xorg-configuration sddm-configuration
+    (service-type (name 'sddm)
+                  (extensions
+                    (list (service-extension shepherd-root-service-type
+                                             sddm-shepherd-service)
+                          (service-extension etc-service-type
+                                             sddm-etc-service)
+                          (service-extension pam-root-service-type
+                                             sddm-pam-services)
+                          (service-extension account-service-type
+                                             (const %sddm-accounts))
+                          (service-extension profile-service-type
+                                             sddm-profile-service)))
+                  (default-value (sddm-configuration))
+                  (description
+                   "Run SDDM, a display and log-in manager for X11 and
+Wayland."))))
 
 (define-deprecated (sddm-service #:optional (config (sddm-configuration)))
   sddm-service-type
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index df5c350a37..09379d40c3 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen <at> yahoo.de>
 ;;; Copyright © 2020 shtwzrd <shtwzrd <at> protonmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -103,6 +104,8 @@
             gdm-configuration
             gdm-service-type
             gdm-service
+
+            handle-xorg-configuration
             set-xorg-configuration))
 
 ;;; Commentary:
@@ -459,6 +462,25 @@ desktop session from the system or user profile will be used."
 
   (program-file "xinitrc" builder))
 
+(define-syntax handle-xorg-configuration
+  (syntax-rules ()
+    "Generate the `compose' and `extend' entries of a login manager
+`service-type' to handle specifying the `xorg-configuration' through
+a `service-extension', as used by `set-xorg-configuration'."
+    ((_ configuration-record service-type-definition)
+     (service-type
+       (inherit service-type-definition)
+       (compose (lambda (extensions)
+                  (match extensions
+                    (() #f)
+                    ((config . _) config))))
+       (extend (lambda (config xorg-configuration)
+                 (if xorg-configuration
+                     (configuration-record
+                      (inherit config)
+                      (xorg-configuration xorg-configuration))
+                     config)))))))
+
 
 ;;;
 ;;; SLiM log-in manager.
@@ -584,18 +606,20 @@ reboot_cmd " shepherd "/sbin/reboot\n"
            (respawn? #t)))))
 
 (define slim-service-type
-  (service-type (name 'slim)
-                (extensions
-                 (list (service-extension shepherd-root-service-type
-                                          slim-shepherd-service)
-                       (service-extension pam-root-service-type
-                                          slim-pam-service)
+  (handle-xorg-configuration slim-configuration
+    (service-type (name 'slim)
+                  (extensions
+                   (list (service-extension shepherd-root-service-type
+                                            slim-shepherd-service)
+                         (service-extension pam-root-service-type
+                                            slim-pam-service)
 
-                       ;; Unconditionally add xterm to the system profile, to
-                       ;; avoid bad surprises.
-                       (service-extension profile-service-type
-                                          (const (list xterm)))))
-                (default-value (slim-configuration))))
+                         ;; Unconditionally add xterm to the system profile, to
+                         ;; avoid bad surprises.
+                         (service-extension profile-service-type
+                                            (const (list xterm)))))
+
+                  (default-value (slim-configuration)))))
 
 (define-deprecated (slim-service #:key (slim slim)
                                  (allow-empty-passwords? #t) auto-login?
@@ -946,44 +970,30 @@ the GNOME desktop environment.")
          (respawn? #t))))
 
 (define gdm-service-type
-  (service-type (name 'gdm)
-                (extensions
-                 (list (service-extension shepherd-root-service-type
-                                          gdm-shepherd-service)
-                       (service-extension activation-service-type
-                                          (const %gdm-activation))
-                       (service-extension account-service-type
-                                          (const %gdm-accounts))
-                       (service-extension pam-root-service-type
-                                          gdm-pam-service)
-                       (service-extension profile-service-type
-                                          gdm-configuration-gnome-shell-assets)
-                       (service-extension dbus-root-service-type
-                                          (compose list
-                                                   gdm-configuration-gdm))
-                       (service-extension localed-service-type
-                                          (compose
-                                           xorg-configuration-keyboard-layout
-                                           gdm-configuration-xorg))))
-
-                ;; For convenience, this service can be extended with an
-                ;; <xorg-configuration> record.  Take the first one that
-                ;; comes.
-                (compose (lambda (extensions)
-                           (match extensions
-                             (() #f)
-                             ((config . _) config))))
-                (extend (lambda (config xorg-configuration)
-                          (if xorg-configuration
-                              (gdm-configuration
-                               (inherit config)
-                               (xorg-configuration xorg-configuration))
-                              config)))
-
-                (default-value (gdm-configuration))
-                (description
-                 "Run the GNOME Desktop Manager (GDM), a program that allows
-you to log in in a graphical session, whether or not you use GNOME.")))
+  (handle-xorg-configuration gdm-configuration
+    (service-type (name 'gdm)
+                  (extensions
+                   (list (service-extension shepherd-root-service-type
+                                            gdm-shepherd-service)
+                         (service-extension activation-service-type
+                                            (const %gdm-activation))
+                         (service-extension account-service-type
+                                            (const %gdm-accounts))
+                         (service-extension pam-root-service-type
+                                            gdm-pam-service)
+                         (service-extension profile-service-type
+                                            gdm-configuration-gnome-shell-assets)
+                         (service-extension dbus-root-service-type
+                                            (compose list
+                                                     gdm-configuration-gdm))
+                         (service-extension localed-service-type
+                                            (compose
+                                             xorg-configuration-keyboard-layout
+                                             gdm-configuration-xorg))))
+                  (default-value (gdm-configuration))
+                  (description
+                   "Run the GNOME Desktop Manager (GDM), a program that allows
+you to log in in a graphical session, whether or not you use GNOME."))))
 
 (define-deprecated (gdm-service #:key (gdm gdm)
                                 (allow-empty-passwords? #t)
-- 
2.25.0





Reply sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
You have taken responsibility. (Sun, 01 Mar 2020 13:14:01 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Sun, 01 Mar 2020 13:14:01 GMT) Full text and rfc822 format available.

Message #10 received at 39633-done <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 39633-done <at> debbugs.gnu.org
Subject: Done: services: set-xorg-configuration: handle slim and sddm
Date: Sun, 1 Mar 2020 14:14:17 +0100
[Message part 1 (text/plain, inline)]
Pushed as commit 50be0da7bfd5c108697679effeb2a893d2f37598, closing.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 30 Mar 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.