GNU bug report logs - #35305
[WIP] LightDM service

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: L p R n d n <guix@HIDDEN>; dated Wed, 17 Apr 2019 12:26:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 35305 <at> debbugs.gnu.org:


Received: (at 35305) by debbugs.gnu.org; 18 Apr 2019 11:20:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 07:20:43 2019
Received: from localhost ([127.0.0.1]:41560 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hH55q-00006Y-0F
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2019 07:20:43 -0400
Received: from mout02.posteo.de ([185.67.36.142]:38509)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1hH55l-00006B-Rx
 for 35305 <at> debbugs.gnu.org; Thu, 18 Apr 2019 07:20:35 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E62352400E6
 for <35305 <at> debbugs.gnu.org>; Thu, 18 Apr 2019 13:20:26 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 44lGqY23nQz9rxH
 for <35305 <at> debbugs.gnu.org>; Thu, 18 Apr 2019 13:20:24 +0200 (CEST)
From: L  p R n  d n    <guix@HIDDEN>
To: 35305 <at> debbugs.gnu.org
Subject: Re: bug#35305: Acknowledgement ([WIP] LightDM service)
References: <87zhooso9g.fsf@HIDDEN>
 <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org>
Date: Thu, 18 Apr 2019 15:20:31 +0200
In-Reply-To: <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org> (GNU bug
 Tracking System's message of "Wed, 17 Apr 2019 12:26:02 +0000")
Message-ID: <87r29zwiu8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 35305
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

--=-=-=
Content-Type: text/plain

Hello,

After some work, here is a new patch replacing the last one from
previous mail. It now seems to work as it successfully starts a window
manager.

Have a nice day,

L  p R n  d n


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0010-services-Add-lightdm-service.patch

From 6598dc79625bda4a2511aaa317a17f0c0559daba Mon Sep 17 00:00:00 2001
From: L  p R n  d n <guix@HIDDEN>
Date: Thu, 18 Apr 2019 15:10:55 +0200
Subject: [PATCH 10/10] services: Add lightdm service.

* gnu/services/lightdm.scm: New file.
---
 gnu/services/lightdm.scm | 235 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 235 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
new file mode 100644
index 0000000000..6c410a9080
--- /dev/null
+++ b/gnu/services/lightdm.scm
@@ -0,0 +1,235 @@
+(define-module (gnu services lightdm)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+
+  #:use-module (gnu system pam)
+  #:use-module (gnu system shadow)
+
+  #:use-module (gnu services)
+  #:use-module (gnu services dbus)
+  #:use-module (gnu services desktop)
+  #:use-module (gnu services shepherd)
+  #:use-module (gnu services xorg)
+
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages display-managers)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages xorg)
+
+  #:export (lightdm-configuration
+            lightdm-configuration?
+            lightdm-service-type))
+
+(define-record-type* <lightdm-configuration>
+  lightdm-configuration make-lightdm-configuration
+  lightdm-configuration?
+
+  (lightdm lightdm-configuration-lightdm
+           (default lightdm))
+  (user lightdm-configuration-user
+        (default "lightdm"))
+  (greeters-directory lightdm-configuration-greeters-directory
+                      (default "/run/current-system/profile/share/xgreeters"))
+  (sessions-directory lightdm-configuration-sessions-directory
+                      (default (string-append
+                                "/run/current-system/profile/share/xsessions"
+                                ":/run/current-system/profile/share/wayland-sessions")))
+  (allow-empty-passwords? lightdm-configuration-allow-empty-passwords?
+                          (default #f))
+  ;; Seat configuration
+  (greeter-session lightdm-configuration-greeter-session
+                   (default "lightdm-gtk-greeter"))
+  (xserver-command lightdm-configuration-xserver-command
+                   (default (xorg-start-command)))
+  (session-wrapper lightdm-configuration-session-wrapper
+                   (default (xinitrc)))
+  (autologin-user lightdm-configuration-autologin-user
+                  (default ""))
+  (default-session-name lightdm-configuration-default-session
+    (default ""))
+  (autologin-timeout lightdm-configuration-autologin-timeout
+                     (default ""))
+  ;; lightdm-gtk-greeter specifics
+  ;; Maybe it should have its own service
+  (gtk-greeter-assets lightdm-configuration-gtk-greeter-assets
+                      (default (list adwaita-icon-theme
+                                     gnome-themes-standard)))
+  (gtk-greeter-theme-name lightdm-configuration-gtk-greeter-theme-name
+                          (default "Adwaita"))
+  (gtk-greeter-icon-theme-name
+   lightdm-configuration-gtk-greeter-icon-theme-name
+   (default "Adwaita"))
+  (gtk-greeter-cursor-theme-name
+   lightdm-configuration-gtk-greeter-cursor-theme-name
+   (default "Adwaita"))
+  (gtk-greeter-cursor-size lightdm-configuration-gtk-greeter-cursor-size
+                           (default 16))
+  (gtk-greeter-background lightdm-configuration-gtk-greeter-background
+                          (default "")))
+
+(define %lightdm-accounts
+  (list (user-group (name "lightdm") (system? #t))
+        (user-account
+         (name "lightdm")
+         (group "lightdm")
+         (system? #t)
+         (comment "LighDM user")
+         (home-directory "/var/lib/lightdm")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define (lightdm-configuration-file config)
+  (mixed-text-file "lightdm.conf" "
+[LightDM]
+greeter-user = "          (lightdm-configuration-user config) "
+greeters-directory = "    (lightdm-configuration-greeters-directory config) "
+sessions-directory = "    (lightdm-configuration-sessions-directory config) "
+
+
+[Seat:*]
+xserver-command = "       (lightdm-configuration-xserver-command config) "
+greeter-session = "       (lightdm-configuration-greeter-session config) "
+user-session = "          (lightdm-configuration-default-session config) "
+autologin-user = "        (lightdm-configuration-autologin-user config) "
+autologin-session = "     (lightdm-configuration-default-session config) "
+autologin-user-timeout = " (lightdm-configuration-autologin-timeout config) "
+session-wrapper = " (lightdm-configuration-session-wrapper config)))
+
+
+(define (lightdm-gtk-greeter-configuration-file config)
+  (mixed-text-file "lightdm-gtk-greeter.conf" "
+[greeter]
+theme-name = "        (lightdm-configuration-gtk-greeter-theme-name config) "
+icon-theme-name = "   (lightdm-configuration-gtk-greeter-icon-theme-name config) "
+cursor-theme-name = " (lightdm-configuration-gtk-greeter-cursor-theme-name config) "
+cursor-theme-size = " (number->string
+                       (lightdm-configuration-gtk-greeter-cursor-size config)) "
+background = "        (lightdm-configuration-gtk-greeter-background config)))
+
+
+(define (lightdm-pam-service config)
+  "Return a PAM service for @command{lightdm}."
+  (unix-pam-service
+   "lightdm"
+   #:allow-empty-passwords?
+   (lightdm-configuration-allow-empty-passwords? config)))
+
+
+(define (lightdm-greeter-pam-service)
+  "Return a PAM service for @command{lightdm-greeter}}."
+  (pam-service
+   (name "lightdm-greeter")
+   (auth
+    (list
+     ;; Load environment from /etc/environment and ~/.pam_environment
+     (pam-entry (control "required") (module "pam_env.so"))
+     ;; Always let the greeter start without authentication
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; No action required for account management
+   (account
+    (list
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; Can't change password
+   (password
+    (list
+     (pam-entry (control "required") (module "pam_deny.so"))))
+   ;; Setup session
+   (session
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))
+     (pam-entry (control "required") (module "pam_env.so"))))))
+
+
+(define (lightdm-autologin-pam-service)
+  "Return a PAM service for @command{lightdm-autologin}}."
+  (pam-service
+   (name "lightdm-autologin")
+   (auth
+    (list
+     ;; Block login if they are globally disabled
+     (pam-entry (control "required") (module "pam_nologin.so"))
+     ;; Load environment from /etc/environment and ~/.pam_environment
+     (pam-entry (control "required") (module "pam_env.so"))
+     ;; Allow access without authentication
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; Stop autologin if account requires action
+   (account
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))))
+   ;; Can't change password
+   (password
+    (list
+     (pam-entry (control "required") (module "pam_deny.so"))))
+   ;; Setup session
+   (session
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))))))
+
+
+(define (lightdm-shepherd-service config)
+  "Return a <lightdm-service> for LightDM with CONFIG."
+
+  (define lightdm-command
+    #~(list (string-append #$(lightdm-configuration-lightdm config) "/sbin/lightdm")))
+
+  (list (shepherd-service
+         (documentation "LightDM display manager.")
+         (requirement '(dbus-system user-processes host-name))
+         (provision '(display-manager))
+         (respawn? #f)
+         (start #~(lambda ()
+                    (fork+exec-command
+                     (list #$(file-append
+                              (lightdm-configuration-lightdm config)
+                              "/sbin/lightdm"))
+                     #:environment-variables
+                     (list
+                      (string-append
+                       "PATH=/run/current-system/profile/sbin"
+                       ":/run/current-system/profile/bin")))))
+         (stop #~(make-kill-destructor)))))
+
+(define (lightdm-etc-service config)
+  (list `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
+          ,(lightdm-configuration-file config))
+        `("xdg/lightdm/lightdm-gtk-greeter.conf"
+          ,(lightdm-gtk-greeter-configuration-file config))))
+
+(define (lightdm-pam-services config)
+  (list (lightdm-pam-service config)
+        (lightdm-greeter-pam-service)
+        (lightdm-autologin-pam-service)))
+
+(define (lightdm-profile-service config)
+  (append (list lightdm-gtk-greeter lightdm)
+          (lightdm-configuration-gtk-greeter-assets config)))
+
+(define (lightdm-activation-service config)
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (define %user
+          (getpw #$(lightdm-configuration-user config)))
+        (let ((directory "/var/lib/lightdm-data"))
+          (mkdir-p directory)
+          (chown directory (passwd:uid %user) (passwd:gid %user))))))
+
+(define lightdm-service-type
+  (service-type (name 'lightdm)
+                (extensions
+                 (list
+                  (service-extension shepherd-root-service-type
+                                     lightdm-shepherd-service)
+                  (service-extension activation-service-type
+                                     lightdm-activation-service)
+                  (service-extension pam-root-service-type
+                                     lightdm-pam-services)
+                  (service-extension etc-service-type
+                                     lightdm-etc-service)
+                  (service-extension dbus-root-service-type
+                                     (compose list lightdm-configuration-lightdm))
+                  (service-extension account-service-type
+                                     (const %lightdm-accounts))
+                  (service-extension profile-service-type
+                                     lightdm-profile-service)))
+                (default-value (lightdm-configuration))))
-- 
2.21.0


--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#35305; Package guix-patches. Full text available.

Message received at 35305 <at> debbugs.gnu.org:


Received: (at 35305) by debbugs.gnu.org; 18 Apr 2019 11:20:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 07:20:27 2019
Received: from localhost ([127.0.0.1]:41557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hH55f-00006C-Kf
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2019 07:20:27 -0400
Received: from mout.web.de ([212.227.15.4]:34669)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jonathan.brielmaier@HIDDEN>) id 1hH55e-00005j-5d
 for 35305 <at> debbugs.gnu.org; Thu, 18 Apr 2019 07:20:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1555586419;
 bh=s33n9tbqcU/LozvSFIO1JE8UET3UiRLNfE4mB0iazcw=;
 h=X-UI-Sender-Class:To:Subject:From:Date;
 b=Z7nWSzHhSrWUx6uttyIFiOujWLC82HcmLuIy6n4w6V7Yd9QzgCZrHS33Xzn2flj3R
 ym2ARObL27hOX95+xwId0uXX6qR+Bvm5Nw1AXxwMNLT0S9VwtjwRI9DhwILE4uTIL+
 PJxTOO4ahYPy20vgjTfAb8VzKXQTutyQeh1/ZHbw=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from [10.160.65.136] ([195.135.221.2]) by smtp.web.de (mrweb001
 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MIeCm-1hEsAN2TRQ-002FXO for
 <35305 <at> debbugs.gnu.org>; Thu, 18 Apr 2019 13:20:19 +0200
To: 35305 <at> debbugs.gnu.org
Subject: [WIP] LightDM service
From: Jonathan Brielmaier <jonathan.brielmaier@HIDDEN>
Message-ID: <98e6b5db-084d-57ad-8bcf-d65a3b7b8b37@HIDDEN>
Date: Thu, 18 Apr 2019 13:20:19 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.6.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:qUndEt56Q3feZ5cSBP82B5wc7WddRIRDw0+C2p8V5+MON+yy+6V
 QfhXE/k8S9uaw/8Yt2dLdumHGEYfeqaFOBtXmmPXQVFZtWwtY0cMYxSECp0OUJqIl2xNlON
 cmjqLOl6SjxwFvaQQZnxhtduj1QLJnODG7EXdtkBYaqaDUWwrmrKEeRVYmqlyWEc0DyQaDX
 31+XlQEadC9k6aEdnVdgw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:ibs/EBPj7O8=:SzD5gamyZyAeF636avGody
 oPJp+ujIThqmTJkQBBF+tLgiP70yovR5BepG4gGI162NEPYtUXTfmuMr3FYgDzCEotiA8DfWJ
 u93dB1HyKb7BXXn2TVNmS98rmpTdtBfdLnTht1O1+6XPHhJ+OpIOgOE13JBaDTOnTDeV9D+6N
 iqhov5A5/NPsgbtLYjE9sLGU0Svu1Bg+QU/Ftv8zU61zg4QlasijI5Bg2eofReFmmIjOXEOhD
 OBIUl+6IKFU0f/WSgnb/f6yyitSVukZxjY638MhToaezb2CPokuW8n+fiO/9VydXiM8NaurXG
 Xx8AZWsps56jCEsq4GjVXyWgwKk4t6xdcXYtiicv5QzonQ6wxWMbJzkS7pSX+pKmvHu94TxdD
 A9sHiQOUywZyXYoXLguwoafAod/PvDtUZbD34HE8bMiqSjIQBWBL97UG+U2vypd+cykvZaQSH
 X8KwPC9j5CnycnREorUaUb6InPsd2WlBu5LPNpax5UL0OfFZSfTuapxit/gsWu/ry1RpSoh2n
 xAWWxKYtgTAZJorXs+aQT33KCv8z6v/ah97NezUd9J0ypsUihPGUGcAGfDhJ+SB8lQut93Qkz
 fbso2m7D3sVP281aZxD00BjK/eG2yZcYVYznMCC7hcOXatyitmOx3todTg8XNwEEqJgCfT+il
 KKItvJInkg/Wa6g+lVE6ZJ3clKmcAMF6WM12iO3SwCm8AoHabYoT9InkTHuTQfptXCEZjOGDf
 TF2/V3bKecevkR14EW/E0PB/6MHYwGOaLZK6RLT7M2r/mZ8UTxzKrGEaOJBvNE+eKo184zACK
 EOKJUItbsJooVe53wLmDkiIueAPGeFFtin49w7KbLKmlWPSzmA9tSpWzb+ycrj0pimwr1uITs
 KYzC3+Fl6PwiegR0wtj8NEEg+4CdfF9QDsF47721dJsib8hir+kzC8txTIN+qjWyXgOl6q8jr
 cOxD6ZNz6QA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 35305
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Please add gnu/services/lightdm.scm to gnu/local.mk




Information forwarded to guix-patches@HIDDEN:
bug#35305; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Apr 2019 12:25:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 17 08:25:10 2019
Received: from localhost ([127.0.0.1]:39689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hGjcb-0003dG-Jj
	for submit <at> debbugs.gnu.org; Wed, 17 Apr 2019 08:25:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59134)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1hGjcY-0003cr-EM
 for submit <at> debbugs.gnu.org; Wed, 17 Apr 2019 08:24:59 -0400
Received: from lists.gnu.org ([209.51.188.17]:56357)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <guix@HIDDEN>) id 1hGjcS-0000wy-UN
 for submit <at> debbugs.gnu.org; Wed, 17 Apr 2019 08:24:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45270)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <guix@HIDDEN>) id 1hGjcP-0005N1-SO
 for guix-patches@HIDDEN; Wed, 17 Apr 2019 08:24:52 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <guix@HIDDEN>) id 1hGjcN-0000SU-5C
 for guix-patches@HIDDEN; Wed, 17 Apr 2019 08:24:49 -0400
Received: from mout02.posteo.de ([185.67.36.142]:55857)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <guix@HIDDEN>) id 1hGjcL-0000H0-Lm
 for guix-patches@HIDDEN; Wed, 17 Apr 2019 08:24:47 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E20682400FD
 for <guix-patches@HIDDEN>; Wed, 17 Apr 2019 14:24:39 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 44khJ45jrvz9rxD
 for <guix-patches@HIDDEN>; Wed, 17 Apr 2019 14:24:36 +0200 (CEST)
From: L  p R n  d n    <guix@HIDDEN>
To: guix-patches@HIDDEN
Subject: [WIP] LightDM service
Date: Wed, 17 Apr 2019 16:24:43 +0200
Message-ID: <87zhooso9g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 185.67.36.142
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

--=-=-=
Content-Type: text/plain

Hello,

Wanted to work on Guix's website but fate led me to try my way on a
lightdm service...
So, here is what I got for now.
It fails to start a window manager but I don't think I'll be able to
debug the last mile with my sole knowledge.

Beside that, here is a list of possible improvements before merging:

* lightdm-greeter-gtk configuration is a part of lightdm's service.
It might be a good idea to give it its own service but it would
mean we need to write a service for each lightdm greeter.

* lightdm complains about the lack of
  org.freedesktop.DisplayManager.AccountsService interface.
  The lightdm package provides the relevent files but it seems
  accountsservice doesn't find them. I think it searches them in
  $XDG_DATA_DIRS/accountservices . See
  https://github.com/NixOS/nixpkgs/issues/45059

* lightdm-gtk-greeter's wrapper is handmade and ugly.

* General refining.

A thorough review would also be welcome as I'm not really sure I know
what I'm doing.

Thanks!

L  p R n  d n   


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-gnu-lightdm-Update-1.28.0.patch

From 826ca620f71f5b219f1402fe4ea582de621b061a Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:16:39 +0200
Subject: [PATCH 01/10] gnu: lightdm: Update 1.28.0.

* gnu/packages/display-managers.scm (lightdm): Update to 1.28.0.
---
 gnu/packages/display-managers.scm | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index afe5cc2b7b..243baebb3d 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -208,16 +208,15 @@ create smooth, animated user interfaces.")
 (define-public lightdm
   (package
     (name "lightdm")
-    (version "1.24.0")
+    (version "1.28.0")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://launchpad.net/lightdm/"
-                                  (version-major+minor version) "/"
-                                  version "/+download/lightdm-"
-                                  version ".tar.xz"))
+              (uri (string-append
+                    "https://github.com/CanonicalLtd/lightdm/releases/download/"
+                    version "/lightdm-" version ".tar.xz"))
               (sha256
                (base32
-                "18j33bm54i8k7ncxcs69zqi4105s62n58jrydqn3ikrb71s9nl6d"))))
+                "01zsxim662n2w66j46rv291w9aqmwvlwccyzl9vhpybwinfmj3zj"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f ; fails when run in parallel
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0002-gnu-lightdm-Add-vala-bindings.patch

From c2ead5265c209315fa57cb07b84ead557e191175 Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:21:55 +0200
Subject: [PATCH 02/10] gnu: lightdm: Add vala bindings.

* gnu/packages/display-managers.scm (lightdm) [native-inputs]: Add vala.
---
 gnu/packages/display-managers.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 243baebb3d..d1eb3f146e 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -263,6 +263,7 @@ create smooth, animated user interfaces.")
        ("pkg-config" ,pkg-config)
        ("itstool" ,itstool)
        ("intltool" ,intltool)
+       ("vala" ,vala)                   ;For vala bindings
        ;; For tests
        ("dbus" ,dbus)
        ("python" ,python-2)
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-gnu-lightdm-Re-enable-all-tests.patch

From 6e0bf56cd21964c868b6eaf2867dfbd412c4d279 Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:26:22 +0200
Subject: [PATCH 03/10] gnu: lightdm: Re-enable all tests.

* gnu/packages/display-managers.scm (lightdm)[arguments]: Remove disable-broken-phase.
---
 gnu/packages/display-managers.scm | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index d1eb3f146e..7f5678f459 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -235,12 +235,6 @@ create smooth, animated user interfaces.")
              (substitute* "src/seat.c"
                (("/bin/sh") (which "sh")))
              #t))
-         (add-after 'unpack 'disable-broken-tests
-           (lambda _
-             (substitute* "tests/Makefile.in"
-               (("test-sessions-gobject ") "")
-               ((" test-sessions-python ") " "))
-             #t))
          (add-before 'check 'pre-check
            ;; Run test-suite under a dbus session.
            (lambda* (#:key inputs #:allow-other-keys)
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0004-gnu-lightdm-gtk-greeter-Update-to-2.0.6.patch

From c31f542d6c551ef2b7bef4d576ff7c2ad1e4a01a Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:40:38 +0200
Subject: [PATCH 04/10] gnu: lightdm-gtk-greeter: Update to 2.0.6.

* gnu/packages/display-manager.scm (lightdm-gtk-greeter): Update to 2.0.6.
---
 gnu/packages/display-managers.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 7f5678f459..be365df6a2 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -276,7 +276,7 @@ display manager which supports different greeters.")
 (define-public lightdm-gtk-greeter
   (package
     (name "lightdm-gtk-greeter")
-    (version "2.0.2")
+    (version "2.0.6")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -285,7 +285,7 @@ display manager which supports different greeters.")
                     "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
               (sha256
                (base32
-                "1436sdm83xqhxyr1rzqxhsl8if2xmidlvb341xcv6dv83lyxkrlf"))))
+                "1pis5qyg95pg31dvnfqq34bzgj00hg4vs547r8h60lxjk81z8p15"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("exo" ,exo)
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0005-gnu-lightdm-gtk-greeter-Fix-at-spi-runtime-dependenc.patch

From 8b4354bd30dc44c47509f0bc0da9fe95e6b4db8d Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:50:58 +0200
Subject: [PATCH 05/10] gnu: lightdm-gtk-greeter: Fix at-spi runtime
 dependency.

* gnu/packages/display-manager.scm (lightdm): Fix at-spi runtime dependency.
[inputs]: Add at-spi2-core.
[arguments]: Add '--enable-at-spi-command' configure flag.
---
 gnu/packages/display-managers.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index be365df6a2..352ad19efa 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -293,7 +293,14 @@ display manager which supports different greeters.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("lightdm" ,lightdm)
+       ("at-spi2-core" ,at-spi2-core)
        ("gtk+" ,gtk+)))
+    (arguments
+     `(#:configure-flags
+       (list "--localstatedir=/var"
+             (string-append "--enable-at-spi-command="
+                            (assoc-ref %build-inputs "at-spi2-core")
+                            "/libexec/at-spi-bus-launcher"))))
     (synopsis "GTK+ greeter for LightDM")
     (home-page "https://launchpad.net/lightdm-gtk-greeter")
     (description "This package provides a LightDM greeter implementation using
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0006-gnu-lightdm-gtk-greeter-Fix-.desktop-file.patch

From ef95fd1a611d24cb5a2f77f758a0495ab231a444 Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 13:58:26 +0200
Subject: [PATCH 06/10] gnu: lightdm-gtk-greeter: Fix .desktop file.

* gnu/packages/display-managers.scm (lightdm-gtk-greeter): Fix .desktop file
  path.
[arguments]: Add fix-.desktop-path phase.
---
 gnu/packages/display-managers.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 352ad19efa..4d22d28f02 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -300,7 +300,17 @@ display manager which supports different greeters.")
        (list "--localstatedir=/var"
              (string-append "--enable-at-spi-command="
                             (assoc-ref %build-inputs "at-spi2-core")
-                            "/libexec/at-spi-bus-launcher"))))
+                            "/libexec/at-spi-bus-launcher"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'fix-.desktop-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* (string-append
+                             out "/share/xgreeters/lightdm-gtk-greeter.desktop")
+                 (("Exec=lightdm-gtk-greeter")
+                  (string-append "Exec=" out "/sbin/lightdm-gtk-greeter")))
+               #t))))))
     (synopsis "GTK+ greeter for LightDM")
     (home-page "https://launchpad.net/lightdm-gtk-greeter")
     (description "This package provides a LightDM greeter implementation using
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0007-gnu-lightdm-gtk-greeter-Wrap-binary.patch

From 8ed5177d5a188f8722e4cfdede4967b3e73968f8 Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 14:17:18 +0200
Subject: [PATCH 07/10] gnu: lightdm-gtk-greeter: Wrap binary.

* gnu/package/display-managers.scm (lightdm-gtk-greeter): Wrap binary.
[inputs]: Add hicolor-icon-theme.
[arguments]: Add wrap-program phase.
---
 gnu/packages/display-managers.scm | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 4d22d28f02..de2b45d4d6 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -294,6 +294,7 @@ display manager which supports different greeters.")
     (inputs
      `(("lightdm" ,lightdm)
        ("at-spi2-core" ,at-spi2-core)
+       ("hicolor-icon-theme" ,hicolor-icon-theme)
        ("gtk+" ,gtk+)))
     (arguments
      `(#:configure-flags
@@ -310,7 +311,27 @@ display manager which supports different greeters.")
                              out "/share/xgreeters/lightdm-gtk-greeter.desktop")
                  (("Exec=lightdm-gtk-greeter")
                   (string-append "Exec=" out "/sbin/lightdm-gtk-greeter")))
-               #t))))))
+               #t)))
+         (add-after 'fix-.desktop-path 'wrap-program
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/sbin/lightdm-gtk-greeter")
+               `("XDG_DATA_DIRS" ":" prefix (,(string-append (assoc-ref inputs "hicolor-icon-theme")
+                                                             "/share")
+                                             ,(string-append (assoc-ref inputs "glib")
+                                                             "/share")
+                                             ,(string-append (assoc-ref inputs "shared-mime-info")
+                                                             "/share")
+                                             ,(string-append (assoc-ref inputs "gtk+")
+                                                             "/share")
+                                             ,(string-append (assoc-ref inputs "exo")
+                                                             "/share")
+                                             ,(string-append (assoc-ref outputs "out")
+                                                             "/share")
+                                             "/run/current-system/profile/share"))
+               `("GTK_PATH" ":" prefix (,(assoc-ref inputs "gtk+")))
+               `("GIO_EXTRA_MODULES" ":" prefix (,(assoc-ref inputs "gtk+"))))
+             #t)))))
     (synopsis "GTK+ greeter for LightDM")
     (home-page "https://launchpad.net/lightdm-gtk-greeter")
     (description "This package provides a LightDM greeter implementation using
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0008-gnu-lightdm-Build-accountsservice-files.patch

From 56c962ccc54f3c7f83ea288c9ac26524af19b5a0 Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Tue, 16 Apr 2019 19:46:44 +0200
Subject: [PATCH 08/10] gnu: lightdm: Build accountsservice files.

* gnu/packages/display-managers.scm (lightdm)[native-inputs]: Add accountsservice.
---
 gnu/packages/display-managers.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index de2b45d4d6..a829e74604 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -253,7 +253,8 @@ create smooth, animated user interfaces.")
        ("libgcrypt" ,libgcrypt)
        ("libxcb" ,libxcb)))
     (native-inputs
-     `(("gobject-introspection" ,gobject-introspection)
+     `(("accountsservice" ,accountsservice)
+       ("gobject-introspection" ,gobject-introspection)
        ("pkg-config" ,pkg-config)
        ("itstool" ,itstool)
        ("intltool" ,intltool)
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0009-gnu-lightdm-gtk-greeter-Fix-some-warnings.patch

From 0d2fa80019cd9d95a0008576fc768fac8ac49c6c Mon Sep 17 00:00:00 2001
From: Lprndn <lprndn@HIDDEN>
Date: Wed, 17 Apr 2019 12:44:07 +0200
Subject: [PATCH 09/10] gnu: lightdm-gtk-greeter: Fix some warnings.

* gnu/packages/display-managers.scm (lightdm-gtk-greeter): Fix some warnings.
[arguments]: Add '--disable-indicator-services-command' configure flags.
---
 gnu/packages/display-managers.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index a829e74604..67d6d9e5c6 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -300,6 +300,7 @@ display manager which supports different greeters.")
     (arguments
      `(#:configure-flags
        (list "--localstatedir=/var"
+             "--disable-indicator-services-command"
              (string-append "--enable-at-spi-command="
                             (assoc-ref %build-inputs "at-spi2-core")
                             "/libexec/at-spi-bus-launcher"))
-- 
2.21.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0010-services-Add-lightDM-service.patch

From 3106b950f70aba2851091731bff4030087c6eca4 Mon Sep 17 00:00:00 2001
From: L  p R n  d n <guix@HIDDEN>
Date: Wed, 17 Apr 2019 15:47:52 +0200
Subject: [PATCH 10/10] services: Add lightDM service.

* gnu/services/lightdm.scm: New file.
---
 gnu/services/lightdm.scm | 259 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 259 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
new file mode 100644
index 0000000000..b280df49ae
--- /dev/null
+++ b/gnu/services/lightdm.scm
@@ -0,0 +1,259 @@
+(define-module (gnu services lightdm)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+
+  #:use-module (gnu system pam)
+  #:use-module (gnu system shadow)
+
+  #:use-module (gnu services)
+  #:use-module (gnu services dbus)
+  #:use-module (gnu services desktop)
+  #:use-module (gnu services shepherd)
+  #:use-module (gnu services xorg)
+
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages display-managers)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages xorg)
+
+  #:export (lightdm-configuration
+            lightdm-configuration?
+            lightdm-service-type))
+
+(define (lightdm-pam-service)
+  "Return a PAM service for @command{lightdm}."
+  (unix-pam-service
+   "lightdm"
+   #:allow-empty-passwords? #t)
+  ;; (pam-service
+  ;; (name "lightdm")
+  ;; (auth
+  ;; (list
+  ;; Block login if they are globally disabled
+  ;; (pam-entry (control "required") (module "pam_nologin.so"))
+  ;; Load environment from /etc/environment and ~/.pam_environment
+  ;; (pam-entry (control "required") (module "pam_env.so"))
+  ;; Use /etc/passwd and /etc/shadow for passwords
+  ;; (pam-entry (control "required") (module "pam_unix.so"))
+  ;; https://wiki.gentoo.org/wiki/LightDM#Unlock_GNOME_Keyring
+  ;; (pam-entry (control "optional") (module "pam_gnome_keyring.so"))
+  ;; ))
+  ;; Check account is active, change password if required
+  ;; (account
+  ;; (list
+  ;; (pam-entry (control "required") (module "pam_unix.so"))))
+  ;; Allow password to be changed
+  ;; (password
+  ;; (list
+  ;; (pam-entry (control "required") (module "pam_unix.so"))))
+  ;; Setup session
+  ;; (session
+  ;; (list
+  ;; (pam-entry (control "required") (module "pam_unix.so"))
+  ;; https://wiki.gentoo.org/wiki/LightDM#Unlock_GNOME_Keyring
+  ;; (pam-entry (control "optional") (module "pam_gnome_keyring.so")
+  ;; (arguments (list "auto_start")))
+  ;; )))
+  )
+
+(define (lightdm-greeter-pam-service)
+  "Return a PAM service for @command{lightdm-greeter}}."
+  (pam-service
+   (name "lightdm-greeter")
+   (auth
+    (list
+     ;; Load environment from /etc/environment and ~/.pam_environment
+     (pam-entry (control "required") (module "pam_env.so"))
+     ;; Always let the greeter start without authentication
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; No action required for account management
+   (account
+    (list
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; Can't change password
+   (password
+    (list
+     (pam-entry (control "required") (module "pam_deny.so"))))
+   ;; Setup session
+   (session
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))
+     (pam-entry (control "required") (module "pam_env.so"))))))
+
+(define (lightdm-autologin-pam-service)
+  "Return a PAM service for @command{lightdm-autologin}}."
+  (pam-service
+   (name "lightdm-autologin")
+   (auth
+    (list
+     ;; Block login if they are globally disabled
+     (pam-entry (control "required") (module "pam_nologin.so"))
+     ;; Load environment from /etc/environment and ~/.pam_environment
+     (pam-entry (control "required") (module "pam_env.so"))
+     ;; Allow access without authentication
+     (pam-entry (control "required") (module "pam_permit.so"))))
+   ;; Stop autologin if account requires action
+   (account
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))))
+   ;; Can't change password
+   (password
+    (list
+     (pam-entry (control "required") (module "pam_deny.so"))))
+   ;; Setup session
+   (session
+    (list
+     (pam-entry (control "required") (module "pam_unix.so"))))))
+
+(define-record-type* <lightdm-configuration>
+  lightdm-configuration make-lightdm-configuration
+  lightdm-configuration?
+
+  (lightdm lightdm-configuration-lightdm
+           (default lightdm))
+  (user lightdm-configuration-user
+        (default "lightdm"))
+  (greeters-directory lightdm-configuration-greeters-directory
+                      (default "/run/current-system/profile/share/xgreeters"))
+  (sessions-directory lightdm-configuration-sessions-directory
+                      (default (string-append
+                                "/run/current-system/profile/share/xsessions"
+                                ":/run/current-system/profile/share/wayland-sessions")))
+
+  ;; Seat configuration
+  (greeter-session lightdm-configuration-greeter-session
+                   (default "lightdm-gtk-greeter"))
+  (xserver-command lightdm-configuration-xserver-command
+                   (default (xorg-start-command)))
+  (pam-service lightdm-configuration-pam-service
+               (default (lightdm-pam-service)))
+  (pam-autologin-service lightdm-configuration-autologin-pam-service
+                         (default (lightdm-autologin-pam-service)))
+  (pam-greeter-service lightdm-configuration-greeter-pam-service
+                       (default (lightdm-greeter-pam-service)))
+  (autologin-user lightdm-configuration-autologin-user
+                  (default ""))
+  (default-session-name lightdm-configuration-default-session
+    (default ""))
+  (autologin-timeout lightdm-configuration-autologin-timeout
+                     (default ""))
+  ;; lightdm-gtk-greeter specifics
+  ;; Maybe it should have its own service
+  (gtk-greeter-theming-packages lightdm-configuration-gtk-greeter-theming-packages
+                                (default (list adwaita-icon-theme)))
+  (gtk-greeter-theme-name lightdm-configuration-gtk-greeter-theme-name
+                          (default ""))
+  (gtk-greeter-icon-theme-name
+   lightdm-configuration-gtk-greeter-icon-theme-name
+   (default "Adwaita"))
+  (gtk-greeter-cursor-theme-name
+   lightdm-configuration-gtk-greeter-cursor-theme-name
+   (default "Adwaita"))
+  (gtk-greeter-cursor-size lightdm-configuration-gtk-greeter-cursor-size
+                           (default 16))
+  (gtk-greeter-background lightdm-configuration-gtk-greeter-background
+                          (default "")))
+
+(define %lightdm-accounts
+  (list (user-group (name "lightdm") (system? #t))
+        (user-account
+         (name "lightdm")
+         (group "lightdm")
+         (system? #t)
+         (comment "LighDM user")
+         (home-directory "/var/lib/lightdm")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define (lightdm-configuration-file config)
+  (mixed-text-file "lightdm.conf" "
+[LightDM]
+greeter-user = "          (lightdm-configuration-user config) "
+greeters-directory = "    (lightdm-configuration-greeters-directory config) "
+sessions-directory = "    (lightdm-configuration-sessions-directory config) "
+
+
+[Seat:*]
+xserver-command = "       (lightdm-configuration-xserver-command config) "
+greeter-session = "       (lightdm-configuration-greeter-session config) "
+user-session = "          (lightdm-configuration-default-session config) "
+autologin-user = "        (lightdm-configuration-autologin-user config) "
+autologin-session = "     (lightdm-configuration-default-session config) "
+autologin-user-timeout = " (lightdm-configuration-autologin-timeout config)))
+
+(define (lightdm-gtk-greeter-configuration-file config)
+  (mixed-text-file "lightdm-gtk-greeter.conf" "
+[greeter]
+theme-name = "        (lightdm-configuration-gtk-greeter-theme-name config) "
+icon-theme-name = "   (lightdm-configuration-gtk-greeter-icon-theme-name config) "
+cursor-theme-name = " (lightdm-configuration-gtk-greeter-cursor-theme-name config) "
+cursor-theme-size = " (number->string (lightdm-configuration-gtk-greeter-cursor-size config)) "
+background = "        (lightdm-configuration-gtk-greeter-background config)))
+
+(define (lightdm-shepherd-service config)
+  "Return a <lightdm-service> for LightDM with CONFIG."
+
+  (define lightdm-command
+    #~(list (string-append #$(lightdm-configuration-lightdm config) "/sbin/lightdm")))
+
+  (list (shepherd-service
+         (documentation "LightDM display manager.")
+         (requirement '(dbus-system user-processes host-name))
+         (provision '(display-manager))
+         (respawn? #f)
+         (start #~(lambda ()
+                    (fork+exec-command
+                     (list #$(file-append
+                              (lightdm-configuration-lightdm config)
+                              "/sbin/lightdm"))
+                     #:environment-variables
+                     (list
+                      (string-append
+                       "PATH=/run/current-system/profile/sbin"
+                       ":/run/current-system/profile/bin")))))
+         (stop #~(make-kill-destructor)))))
+
+(define (lightdm-etc-service config)
+  (list `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
+          ,(lightdm-configuration-file config))
+        `("xdg/lightdm/lightdm-gtk-greeter.conf"
+          ,(lightdm-gtk-greeter-configuration-file config))))
+
+(define (lightdm-pam-services config)
+  (list (lightdm-configuration-pam-service config)
+        (lightdm-configuration-greeter-pam-service config)
+        (lightdm-configuration-autologin-pam-service config)))
+
+(define (lightdm-profile-service config)
+  (append (list lightdm-gtk-greeter lightdm)
+          (lightdm-configuration-gtk-greeter-theming-packages config)))
+
+(define (lightdm-activation-service config)
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (define %user
+          (getpw #$(lightdm-configuration-user config)))
+        (let ((directory "/var/lib/lightdm-data"))
+          (mkdir-p directory)
+          (chown directory (passwd:uid %user) (passwd:gid %user))))))
+
+(define lightdm-service-type
+  (service-type (name 'lightdm)
+                (extensions
+                 (list
+                  (service-extension shepherd-root-service-type
+                                     lightdm-shepherd-service)
+                  (service-extension activation-service-type
+                                     lightdm-activation-service)
+                  (service-extension pam-root-service-type
+                                     lightdm-pam-services)
+                  (service-extension etc-service-type
+                                     lightdm-etc-service)
+                  (service-extension dbus-root-service-type
+                                     (compose list lightdm-configuration-lightdm))
+                  (service-extension account-service-type
+                                     (const %lightdm-accounts))
+                  (service-extension profile-service-type
+                                     lightdm-profile-service)))
+                (default-value (lightdm-configuration))))
-- 
2.21.0


--=-=-=--




Acknowledgement sent to L p R n d n <guix@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#35305; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 18 Apr 2019 11:30:02 UTC

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