Subject: [PATCH] WIP: gnu: propagate inputs for gdm and rework gdm-service-type.

From: Dariqq <[email-masked]>
Date: Mon, 29 Jan 2024 21:31:25 +0000

* gnu/packages/gnome.scm (gdm)[propagated inputs]: Add adwaita-icon-theme,
dconf, font-abattis-cantarell, gnome-control-center.
* gnu/services/xorg.scm (gdm-shepherd-service): Set XDG_DATA_DIR to
run/current-system/profile/share.
(gdm-profile-service): New variable.
(gdm-service-type): Use gdm-profile-service.
(gdm-configuration-gnome-shell-assets): Set default to gnome-shell.

Change-Id: I870206a9ee6a7481d19e6b38b6a3ee72b5801c6a
---
Hi Maxim and others,
This is not quite the explicit wrapper we talked about on IRC but something similiar.

The gdm package now propagates the packages from gnome-shell-assets and I added dconf and gnome-control-center for basic accessibility settings functionality + icon. Does this introduce a problem as dconf is already a natice input?
Maybe also some other packages can be added like  at-spi2-core, orca, ... or is this something the user should add to the system profile themselves?

In order for the gdm-shepherd-service to find the propagated packages I changed the XDG_DATA_DIR of the service to the system profile and added a gdm-profile-service to add gdm and gnome-shell to the system profile. Probably the gnome-shell-assets name should now also be changed as is is now only the gnome-shell package.

What do you think?

 gnu/packages/gnome.scm |  5 +++++
 gnu/services/xorg.scm  | 20 +++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 6f22529dd7..c16079da0a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -9020,6 +9020,11 @@ (define-public gdm
            libcanberra
            libgudev
            linux-pam))
+    (propagated-inputs
+     (list  adwaita-icon-theme
+            dconf
+            font-abattis-cantarell
+            gnome-control-center))
     (synopsis "Display manager for GNOME")
     (home-page "https://wiki.gnome.org/Projects/GDM/")
     (description
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 1ee15ea90c..8b360d7729 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -1039,7 +1039,9 @@ (define-record-type* <gdm-configuration>
   (debug? gdm-configuration-debug? (default #f))
   (default-user gdm-configuration-default-user (default #f))
   (gnome-shell-assets gdm-configuration-gnome-shell-assets
-                      (default (list adwaita-icon-theme font-abattis-cantarell)))
+                      ;; XXX: Remove gnome-shell below when GDM
+                      ;; can depend on GNOME Shell directly.
+                      (default (list gnome-shell)))
   (xorg-configuration gdm-configuration-xorg
                       (default (xorg-configuration)))
   (x-session gdm-configuration-x-session
@@ -1136,6 +1138,10 @@ (define (gdm-pam-service config)
                      #:allow-empty-passwords?
                      (gdm-configuration-allow-empty-passwords? config))))
 
+(define (gdm-profile-service config)
+  (cons* (gdm-configuration-gdm config)
+         (gdm-configuration-gnome-shell-assets config)))
+
 (define (gdm-shepherd-service config)
   (define config-file
     (gdm-configuration-file config))
@@ -1164,15 +1170,7 @@ (define (gdm-shepherd-service config)
                             "GDM_X_SESSION="
                             #$(gdm-configuration-x-session config))
                            (string-append
-                            "XDG_DATA_DIRS="
-                            ((lambda (ls) (string-join ls ":"))
-                             (map (lambda (path)
-                                    (string-append path "/share"))
-                                  ;; XXX: Remove gnome-shell below when GDM
-                                  ;; can depend on GNOME Shell directly.
-                                  (cons #$gnome-shell
-                                        '#$(gdm-configuration-gnome-shell-assets
-                                            config)))))
+                            "XDG_DATA_DIRS=/run/current-system/profile/share")
                            ;; Add XCURSOR_PATH so that mutter can find its
                            ;; cursors.  gdm doesn't login so doesn't source
                            ;; the corresponding line in /etc/profile.
@@ -1237,7 +1235,7 @@ (define gdm-service-type
                          (service-extension polkit-service-type
                                             gdm-polkit-rules)
                          (service-extension profile-service-type
-                                            gdm-configuration-gnome-shell-assets)
+                                            gdm-profile-service)
                          (service-extension dbus-root-service-type
                                             (compose list
                                                      gdm-configuration-gdm))

base-commit: 21e4d6cd6913eca131f2c0fd0cd509fc843c7eb8
-- 
2.41.0