all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dariqq <dariqq@posteo.net>
To: 73859@debbugs.gnu.org
Cc: Dariqq <dariqq@posteo.net>, Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#73859: [PATCH 2/2] gnu: lightdm-service-type: Add lightdm.conf to /etc/lightdm.
Date: Sat,  2 Nov 2024 10:18:33 +0000	[thread overview]
Message-ID: <073c63896dcec5eae8e81df5fc1b6131f33add78.1730541249.git.dariqq@posteo.net> (raw)
In-Reply-To: <cover.1730541249.git.dariqq@posteo.net>

* gnu/services/lightdm.scm
(lightdm-configuration->greeters-config-dir): Rename to
lightdm-configuration-directory and add the lightdm-configuration-file.
(lightdm-shepherd-service): Don't pass the configuration file, don't set
XDG_CONFIG_DIRS
(lightdm-etc-service): New procedure.
(lightdm-service-type): Use lightdm-etc-service as the etc-extension.

Change-Id: I982ec1f7bdfd085621f45a8a1e4b175ab481202f
---
 gnu/services/lightdm.scm | 48 ++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
index 798c106563..191cb5635b 100644
--- a/gnu/services/lightdm.scm
+++ b/gnu/services/lightdm.scm
@@ -397,15 +397,6 @@ (define-configuration/no-serialization lightdm-configuration
    (list-of-strings '())
    "Extra configuration values to append to the LightDM configuration file."))
 
-(define (lightdm-configuration->greeters-config-dir config)
-  "Return a directory containing all the serialized greeter configurations
-from CONFIG, a <lightdm-configuration> object."
-  (file-union "etc-lightdm"
-              (append-map (lambda (g)
-                            `((,(greeter-configuration->conf-name g)
-                               ,(greeter-configuration->file g))))
-                          (lightdm-configuration-greeters config))))
-
 (define (lightdm-configuration->packages config)
   "Return all the greeter packages and their assets defined in CONFIG, a
 <lightdm-configuration> object, as well as the lightdm package itself."
@@ -496,6 +487,16 @@ (define (lightdm-configuration-file config)
                                        lightdm-seat-configuration-fields)))
           seats))))
 
+(define (lightdm-configuration-directory config)
+  "Return a directory containing the serialized lightdm configuration
+and all the serialized greeter configurations from CONFIG."
+  (file-union "etc-lightdm"
+              (cons `("lightdm.conf" ,(lightdm-configuration-file config))
+                    (map (lambda (g)
+                           `(,(greeter-configuration->conf-name g)
+                             ,(greeter-configuration->file g)))
+                         (lightdm-configuration-greeters config)))))
+
 (define %lightdm-accounts
   (list (user-group (name "lightdm") (system? #t))
         (user-account
@@ -589,9 +590,7 @@ (define (lightdm-shepherd-service config)
                            "/sbin/lightdm")
             #$@(if (lightdm-configuration-debug? config)
                    #~("--debug")
-                   #~())
-            "--config"
-            #$(lightdm-configuration-file config)))
+                   #~())))
 
   (define lightdm-paths
     (let ((lightdm (lightdm-configuration-lightdm config)))
@@ -601,9 +600,6 @@ (define (lightdm-shepherd-service config)
                  '("/bin" "/sbin" "/libexec"))
          ":")))
 
-  (define greeters-config-dir
-    (lightdm-configuration->greeters-config-dir config))
-
   (define data-dirs
     ;; LightDM itself needs to be in XDG_DATA_DIRS for the accountsservice
     ;; interface it provides to be picked up.  The greeters must also be in
@@ -626,11 +622,7 @@ (define (lightdm-shepherd-service config)
                                   ;; Lightdm needs itself in its PATH.
                                   #:environment-variables
                                   (list
-                                   ;; It knows to look for greeter
-                                   ;; configurations in XDG_CONFIG_DIRS...
-                                   (string-append "XDG_CONFIG_DIRS="
-                                                  #$greeters-config-dir)
-                                   ;; ... and for greeter .desktop files as
+                                   ;; It looks for greeter .desktop files as
                                    ;; well as lightdm accountsservice
                                    ;; interface in XDG_DATA_DIRS.
                                    (string-append "XDG_DATA_DIRS="
@@ -638,6 +630,11 @@ (define (lightdm-shepherd-service config)
                                    (string-append "PATH=" #$lightdm-paths))))
     (stop #~(make-kill-destructor)))))
 
+(define (lightdm-etc-service config)
+  "Return a list of FILES for @var{etc-service-type} to build the
+/etc/lightdm directory using CONFIG"
+  (list `("lightdm" ,(lightdm-configuration-directory config))))
+
 (define lightdm-service-type
   (handle-xorg-configuration
    lightdm-configuration
@@ -666,13 +663,10 @@ (define lightdm-service-type
            ;; https://github.com/NixOS/nixpkgs/issues/45059.
            (service-extension profile-service-type
                               lightdm-configuration->packages)
-           ;; This is needed for the greeter itself to find its configuration,
-           ;; because XDG_CONF_DIRS gets overridden by /etc/profile.
-           (service-extension
-            etc-service-type
-            (lambda (config)
-              `(("lightdm"
-                 ,(lightdm-configuration->greeters-config-dir config)))))))
+           ;; This is needed for lightdm and greeter
+           ;; to find their configuration
+           (service-extension etc-service-type
+                              lightdm-etc-service)))
     (description "Run @code{lightdm}, the LightDM graphical login manager."))))
 
 \f
-- 
2.46.0





  parent reply	other threads:[~2024-11-02 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  9:23 bug#73859: lightdm-service-type is almost unusable Dariqq
2024-10-23 14:48 ` Maxim Cournoyer
2024-10-23 18:15   ` Dariqq
2024-10-24  0:51 ` bug#73859: lightdm Feng Shu
2024-10-25  8:41 ` Feng Shu
2024-11-02 10:18 ` bug#73859: [PATCH 0/2] lightdm: Fix empty session list Dariqq
2024-11-02 10:18   ` bug#73859: [PATCH 1/2] gnu: lightdm: Use global sysconfdir Dariqq
2024-11-02 10:18   ` Dariqq [this message]
2024-12-16  2:35   ` bug#73859: [PATCH 0/2] lightdm: Fix empty session list Maxim Cournoyer

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

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

  git send-email \
    --in-reply-to=073c63896dcec5eae8e81df5fc1b6131f33add78.1730541249.git.dariqq@posteo.net \
    --to=dariqq@posteo.net \
    --cc=73859@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.