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; 14 Apr 2020 09:38:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 14 05:38:30 2020
Received: from localhost ([127.0.0.1]:33267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jOI1W-0005Tx-J8
	for submit <at> debbugs.gnu.org; Tue, 14 Apr 2020 05:38:30 -0400
Received: from mout01.posteo.de ([185.67.36.141]:58403)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1jOI1U-0005Tj-Gz
 for 35305 <at> debbugs.gnu.org; Tue, 14 Apr 2020 05:38:29 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 2A5D9160065
 for <35305 <at> debbugs.gnu.org>; Tue, 14 Apr 2020 11:38:21 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 491gQj13PBz9rxQ;
 Tue, 14 Apr 2020 11:38:20 +0200 (CEST)
From: L  p R n  d n    <guix@HIDDEN>
To: Brice Waegeneire <brice@HIDDEN>
Subject: Re: [bug#35305] LightDM service
References: <e0dd6ca666986ea18597f95873e3b1c1@HIDDEN>
 <87sghcir5k.fsf@HIDDEN>
 <2d2d720d1fd6a6357a171e13953a593b@HIDDEN>
Date: Tue, 14 Apr 2020 11:38:18 +0200
In-Reply-To: <2d2d720d1fd6a6357a171e13953a593b@HIDDEN> (Brice
 Waegeneire's message of "Sun, 12 Apr 2020 09:53:41 +0000")
Message-ID: <874ktmjtkl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org
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 (--)

Hello,

Thanks again for the feedbacks.

Brice Waegeneire <brice@HIDDEN> writes:

[...]
> There is an error on vt1 at startup about some dbus stuff related to
> =E2=80=9Caccountservice=E2=80=9D. The cursor theme isn't set as well as t=
he icon theme,=20
> it
> seems; it may come from some missing environment variable as NixOS set a
> few of them in their service[0].

For the cursor, setting "XCURSOR_PATH" seems to solve the problem.
Preparing a patch.

As for dbus, from what I found at NixOS[0][1], it's a accountsservice
bug. I'll send a bug report. In the meantime, it doesn't appear to
affect LightDM too much so it might be ok...?

> After digging in the new service file I keep wondering if it's the right
> way to go about implementing it. I tried to set a simple setting
> for `lightdm-gtk-greeter` and I ended up with the following which=20
> doesn't
> look intuitive:
>
> (service lightdm-service-type
>           (lightdm-configuration
>            (greeter-configuration-file
>             (lightdm-gtk-greeter-configuration-file
>              (lightdm-gtk-greeter-configuration
>               (extra-config "hide-user-image=3Dtrue"))))))

Yeah, far from elegant. Did it that way in case someone wanted to
provide its own file but dropping
lightdm-gtk-greeter-configuration-file gives one level less of nesting.

> Furthermore `lightdm-service-type` only set a single seat while lightdm=20
> can
> have many of them. So maybe there should be a lightdm-seat` record used=20
> as
> a list of seats in `lightdm-service-type`. Each greater will be able to
> expand `lightdm-service-type` by appending a seat to it. Then the
> configuration could look like this:
>
> (service lightdm-service-type)
> (service lightdm-gtk-greeter-service-type
>           (lightdm-gtk-greeter-configuration
>            (assets (list guix-artwork))
>            (theme-name "Guix")
>            (extra-config "hide-user-image=3Dtrue")))

I didn't know one could use a different greeter for each seat. Indeed,
it would be nice to have that feature!
The only thing that bothers me is that you don't get a working
default LightDM service by default. I feel that just adding (service
lightdm-service-type) to your configuration should get you a fully
working LightDM, specially for newcomers. Here one would lack a greeter.
:/

I believe there is a solution that would give us the best of both
worlds. If someone has a clue, an idea or even a patch, please share it!
:)

Also, merging as is and improving the service later is possible too.

>
> Using this approch would also avoid populating =E2=80=9C/etc=E2=80=9D, at=
 least for
> `lightdm-grk-greeter`, since each greeter would be defined as a service=20
> and
> could expand =E2=80=9C/etc=E2=80=9D if it really needs it. For `lightdm-g=
tk-greeter`
> specifically avoiding putting config in =E2=80=9C/etc/=E2=80=9D can be do=
ne by compiling=20
> it
> with `-DCONFIG_FILE` pointing to `/run/current-system` And `lightdm` can=
=20
> be
> started with `--config`.

I will make a patch to use --config for lightdm.
For lightdm-gtk-greeter, how would one put the config file in
"/run/current-system"? Do we need to make a package out of it?

> Here is an example in how to make a conjuration file procedure more
> readable while keeping under the line length limit by using=20
> `match-record`:
>
> (define (lightdm-gtk-greeter-configuration-file config)
>    (match-record config <lightdm-gtk-greeter-configuration>
>      (theme-name icon-theme-name cursor-theme-name cursor-size background
>                  extra-config)
>     (mixed-text-file "lightdm-gtk-greeter.conf" "
> [greeter]
> theme-name =3D "           theme-name                   "
> icon-theme-name =3D "      icon-theme-name              "
> cursor-theme-name =3D "    cursor-theme-name            "
> cursor-theme-size =3D "    (number->string cursor-size) "
> background =3D "           background                   "
> " extra-config                                        "
> ")))

Way better! Preparing a patch for that.

> BTW the default background could use one from Guix artwork repo like
> =E2=80=9C(file-append %artwork-repository "/grub/GuixSD-fully-black-16-9.=
svg")=E2=80=9D.

Yeap!

> WDYT? I may be completely off on the `lightdm-seat` part.
>
> [0]:=20
> https://github.com/NixOS/nixpkgs/blob/release-19.09/nixos/modules/service=
s/x11/display-managers/lightdm-greeters/gtk.nix#L18
>
> Cheers,
> - Brice

Have a nice day!

L  p R n  d n




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; 12 Apr 2020 09:53:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 12 05:53:51 2020
Received: from localhost ([127.0.0.1]:57389 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jNZJG-00014n-V3
	for submit <at> debbugs.gnu.org; Sun, 12 Apr 2020 05:53:51 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:58991)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jNZJE-00014Q-C8
 for 35305 <at> debbugs.gnu.org; Sun, 12 Apr 2020 05:53:49 -0400
Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18])
 (Authenticated sender: brice@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPA id 7078E60002;
 Sun, 12 Apr 2020 09:53:41 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Date: Sun, 12 Apr 2020 09:53:41 +0000
From: Brice Waegeneire <brice@HIDDEN>
To: L  p R n  d n <guix@HIDDEN>
Subject: Re: [bug#35305] LightDM service
In-Reply-To: <87sghcir5k.fsf@HIDDEN>
References: <e0dd6ca666986ea18597f95873e3b1c1@HIDDEN>
 <87sghcir5k.fsf@HIDDEN>
Message-ID: <2d2d720d1fd6a6357a171e13953a593b@HIDDEN>
X-Sender: brice@HIDDEN
User-Agent: Roundcube Webmail/1.3.8
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org
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 (-)

Hello L p R n d n,

Using `set-xorg-configuration` with `lightdm-service-type` seems to be
working.

There is an error on vt1 at startup about some dbus stuff related to
“accountservice”. The cursor theme isn't set as well as the icon theme, 
it
seems; it may come from some missing environment variable as NixOS set a
few of them in their service[0].

After digging in the new service file I keep wondering if it's the right
way to go about implementing it. I tried to set a simple setting
for `lightdm-gtk-greeter` and I ended up with the following which 
doesn't
look intuitive:

--8<---------------cut here---------------start------------->8---
(service lightdm-service-type
          (lightdm-configuration
           (greeter-configuration-file
            (lightdm-gtk-greeter-configuration-file
             (lightdm-gtk-greeter-configuration
              (extra-config "hide-user-image=true"))))))
--8<---------------cut here---------------end--------------->8---

Furthermore `lightdm-service-type` only set a single seat while lightdm 
can
have many of them. So maybe there should be a lightdm-seat` record used 
as
a list of seats in `lightdm-service-type`. Each greater will be able to
expand `lightdm-service-type` by appending a seat to it. Then the
configuration could look like this:

--8<---------------cut here---------------start------------->8---
(service lightdm-service-type)
(service lightdm-gtk-greeter-service-type
          (lightdm-gtk-greeter-configuration
           (assets (list guix-artwork))
           (theme-name "Guix")
           (extra-config "hide-user-image=true")))
--8<---------------cut here---------------end--------------->8---

Using this approch would also avoid populating “/etc”, at least for
`lightdm-grk-greeter`, since each greeter would be defined as a service 
and
could expand “/etc” if it really needs it. For `lightdm-gtk-greeter`
specifically avoiding putting config in “/etc/” can be done by compiling 
it
with `-DCONFIG_FILE` pointing to `/run/current-system` And `lightdm` can 
be
started with `--config`.

Here is an example in how to make a conjuration file procedure more
readable while keeping under the line length limit by using 
`match-record`:

--8<---------------cut here---------------start------------->8---
(define (lightdm-gtk-greeter-configuration-file config)
   (match-record config <lightdm-gtk-greeter-configuration>
     (theme-name icon-theme-name cursor-theme-name cursor-size background
                 extra-config)
    (mixed-text-file "lightdm-gtk-greeter.conf" "
[greeter]
theme-name = "           theme-name                   "
icon-theme-name = "      icon-theme-name              "
cursor-theme-name = "    cursor-theme-name            "
cursor-theme-size = "    (number->string cursor-size) "
background = "           background                   "
" extra-config                                        "
")))
--8<---------------cut here---------------end--------------->8---

BTW the default background could use one from Guix artwork repo like
“(file-append %artwork-repository "/grub/GuixSD-fully-black-16-9.svg")”.

WDYT? I may be completely off on the `lightdm-seat` part.

[0]: 
https://github.com/NixOS/nixpkgs/blob/release-19.09/nixos/modules/services/x11/display-managers/lightdm-greeters/gtk.nix#L18

Cheers,
- Brice




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; 9 Apr 2020 16:02:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 09 12:02:38 2020
Received: from localhost ([127.0.0.1]:54355 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jMZdM-0004p4-Ss
	for submit <at> debbugs.gnu.org; Thu, 09 Apr 2020 12:02:38 -0400
Received: from mout02.posteo.de ([185.67.36.142]:58265)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1jMZdI-0004of-Dm
 for 35305 <at> debbugs.gnu.org; Thu, 09 Apr 2020 12:02:27 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id C2149240101
 for <35305 <at> debbugs.gnu.org>; Thu,  9 Apr 2020 18:02:17 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 48ymB04WCcz9rxL;
 Thu,  9 Apr 2020 18:02:16 +0200 (CEST)
From: L  p R n  d n    <guix@HIDDEN>
To: Brice Waegeneire <brice@HIDDEN>
Subject: Re: [bug#35305] LightDM service
References: <e0dd6ca666986ea18597f95873e3b1c1@HIDDEN>
Date: Thu, 09 Apr 2020 18:02:15 +0200
In-Reply-To: <e0dd6ca666986ea18597f95873e3b1c1@HIDDEN> (Brice
 Waegeneire's message of "Tue, 07 Apr 2020 17:06:34 +0000")
Message-ID: <87sghcir5k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org
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; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

Brice Waegeneire <brice@HIDDEN> writes:

> Hello L p R n d n,
>
> I never did a review before but I would like to see this patch merged, so
> bear with me.

Thank you for the review! It's my first service for guix so we're
probably even here. ;)

> The indentation of lightdm's origin should probably be done in the commit
> 01 not 03.

Done.

>> `("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"))
> This part can use a map procedure.

Done. + cleaned some things that weren't necessary.

> It would be nice if =E2=80=9Clightdm-service-type=E2=80=9D support =E2=80=
=9Cset-xorg-configuration=E2=80=9D
> like the other login manager now does by using =E2=80=9Chandle-xorg-confi=
guration=E2=80=9D
> see 50be0da7bfd5c108697679effeb2a893d2f37598 for how it's done in GDM, SL=
IM
> and co.
>
>> +         (comment "LighDM user")
>                           ^ a =E2=80=9Ct=E2=80=9D is missing here

Huh.. Done (I think...) and done!

>> +(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")))
> [=E2=80=A6]
>> + (fork+exec-command
>> + (list #$(file-append
>> + (lightdm-configuration-lightdm config)
>> + "/sbin/lightdm"))
>
> =E2=80=9Clightdm-command=E2=80=9D isn't used, I get the hint it ought to =
be the argument of
> =E2=80=9Cfork+exec-command.=E2=80=9D

Done.

>
>> +(define (lightdm-etc-service config)
>> +  (list `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
>> +          ,(lightdm-configuration-file config))
>> +        `(,(string-append "xdg/lightdm/"
>> +                          (computed-file-name
>> +                           (lightdm-configuration-greeter-configuration
>> config)))
>> +          ,(lightdm-configuration-greeter-configuration config))))
>
> I've been told, in Guix, it's better to avoid putting configuration in
> =E2=80=9C/etc=E2=80=9D since it cause edge case during rollback and such,=
 specifying the
> configuration by passing the =E2=80=9C--config=E2=80=9D argument to =E2=
=80=9Clightdm=E2=80=9D would be more
> appropriate.

Need some advices here as even if "--config" works for LightDM, greeters
also search their config in /etc. They're all different so they might or
might not provide a convenient way to do it... :/
In the meantime, kept the etc-service-extension + prevented errors in
case a file wasn't provided.

>> +        (define %user
>> +          (getpw "lightdm"))
>> +        (let ((directory "/var/lib/lightdm-data"))
>> +          (mkdir-p directory)
>> +          (chown directory (passwd:uid %user) (passwd:gid %user))))))
>
> =E2=80=9C%user=E2=80=9D could go in the =E2=80=9Clet=E2=80=9D. BTW can't =
lightdm use its user home
> directory instead of =E2=80=9C/var/lib/lightdm-data=E2=80=9D or the rever=
se; IOW does it
> need to have to own two directories in =E2=80=9C/var/lib=E2=80=9D?

Reworked everything a little bit to match what is done for gdm.
I think we can use a CFLAG to change "/var/lib/lightdm-data" to
"/var/lib/lightdm/lightdm-data" for example. However, I think lightdm
sometime cleans or delete stuff in "/var/lib/lightdm" so it might
explain why there are two directories. I don't know what
"/var/lib/lightdm-data" is used for but LightDM does complain if it
doesn't exist. Advices needed here too.

> Several lines in =E2=80=9Cgnu/services/lightdm.scm=E2=80=9D exceed the ma=
ximal line length.
>

Tried to keep them below 80. Is it ok?

>
> Thank you very much for this patch series. I'm impatient seeing it in Guix
> proper.
>
> - Brice


+ Corrected some typos in the documentation and added an extra-config
field to lightd and lightdm-gtk-greeter's configuration.

Hope it's better now, new patches are attached below.

Have a nice day,

L  p R n  d n

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

From 461b4c27816d4340a37209ca5389d7ec9f373581 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.30.0.

* gnu/packages/display-managers.scm (lightdm): Update to 1.30.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 bfe1a8f6dd..2f81f10140 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -125,16 +125,15 @@ create smooth, animated user interfaces.")
 (define-public lightdm
   (package
     (name "lightdm")
-    (version "1.24.0")
+    (version "1.30.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"))))
+                "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f ; fails when run in parallel
-- 
2.25.1


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

From a2d8e9027e12dabb0acebd3c32aff555727c4129 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 2f81f10140..1f4842bff3 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -180,6 +180,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.25.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-gnu-lightdm-Disable-python-tests-only.patch

From 524bf60a51f0775d165347a1f2bf5e82a842261d 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: Disable python tests only.

* gnu/packages/patches/lightdm-disable-python-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/display-managers.scm (lightdm)[source]: Use patch.
* gnu/packages/display-managers.scm (lightdm)[arguments]: Remove
test-python-greeter wrapping.
* gnu/packages/display-managers.scm (lightdm)[native-inputs]: Remove python
and python-gobject.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/display-managers.scm             | 18 ++-------
 .../lightdm-disable-python-tests.patch        | 40 +++++++++++++++++++
 3 files changed, 44 insertions(+), 15 deletions(-)
 create mode 100644 gnu/packages/patches/lightdm-disable-python-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index caa73d44d4..fc9030b7f9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1144,6 +1144,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightdm-disable-python-tests.patch	\
   %D%/packages/patches/linkchecker-tests-require-network.patch	\
   %D%/packages/patches/linux-pam-no-setfsuid.patch		\
   %D%/packages/patches/lirc-localstatedir.patch			\
diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 1f4842bff3..eee7c6d841 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -133,7 +133,8 @@ create smooth, animated user interfaces.")
                     version "/lightdm-" version ".tar.xz"))
               (sha256
                (base32
-                "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
+                "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))
+              (patches (search-patches "lightdm-disable-python-tests.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f ; fails when run in parallel
@@ -152,19 +153,8 @@ 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)
-             (wrap-program "tests/src/test-python-greeter"
-               `("PYTHONPATH"      ":" prefix (,(getenv "PYTHONPATH")))
-               `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
-
              ;; Avoid printing locale warnings, which trip up the text
              ;; matching tests.
              (unsetenv "LC_ALL")
@@ -182,9 +172,7 @@ create smooth, animated user interfaces.")
        ("intltool" ,intltool)
        ("vala" ,vala)                   ;For vala bindings
        ;; For tests
-       ("dbus" ,dbus)
-       ("python" ,python-2)
-       ("python-pygobject" ,python2-pygobject)))
+       ("dbus" ,dbus)))
     ;; Required by liblightdm-gobject-1.pc.
     (propagated-inputs
      `(("glib" ,glib)
diff --git a/gnu/packages/patches/lightdm-disable-python-tests.patch b/gnu/packages/patches/lightdm-disable-python-tests.patch
new file mode 100644
index 0000000000..b1850f279c
--- /dev/null
+++ b/gnu/packages/patches/lightdm-disable-python-tests.patch
@@ -0,0 +1,40 @@
+ tests/Makefile.in | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 9451a6f..46c027c 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -810,29 +810,6 @@ TESTS = test-xserver-fail-start test-greeter-fail-start \
+ 	test-wayland-autologin test-wayland-greeter \
+ 	test-wayland-session test-invalid-seat \
+ 	test-seatdefaults-still-supported \
+-	test-autologin-timeout-python \
+-	test-autologin-guest-timeout-python \
+-	test-autologin-session-timeout-python \
+-	test-cancel-authentication-python test-sessions-python \
+-	test-users-python test-login-python test-login-manual-python \
+-	test-login-manual-previous-session-python \
+-	test-login-no-password-python test-login-long-username-python \
+-	test-login-long-password-python test-login-two-factor-python \
+-	test-login-new-authtok-python test-login-info-prompt-python \
+-	test-login-multi-info-prompt-python \
+-	test-login-previous-session-python \
+-	test-login-wrong-password-python \
+-	test-login-invalid-user-python \
+-	test-login-invalid-session-python test-login-logout-python \
+-	test-login-pick-session-python \
+-	test-login-remember-session-python \
+-	test-login-manual-remember-session-python \
+-	test-login-guest-python test-login-guest-pick-session-python \
+-	test-login-guest-disabled-python \
+-	test-login-guest-no-setup-script-python \
+-	test-login-guest-fail-setup-script-python \
+-	test-login-guest-logout-python \
+-	test-login-remote-session-python test-power-python \
+ 	$(am__append_1) $(am__append_2)
+ EXTRA_DIST = \
+ 	$(TESTS) \
+-- 
+2.25.1
+
-- 
2.25.1


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

From 0f3bc9f7b17b4a099a9622c92b7b2fdb4076ba24 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.7.

* gnu/packages/display-manager.scm (lightdm-gtk-greeter): Update to 2.0.7.
---
 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 eee7c6d841..49739a0064 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -187,7 +187,7 @@ display manager which supports different greeters.")
 (define-public lightdm-gtk-greeter
   (package
     (name "lightdm-gtk-greeter")
-    (version "2.0.2")
+    (version "2.0.7")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -196,7 +196,7 @@ display manager which supports different greeters.")
                     "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
               (sha256
                (base32
-                "1436sdm83xqhxyr1rzqxhsl8if2xmidlvb341xcv6dv83lyxkrlf"))))
+                "1g7wc3d3vqfa7mrdhx1w9ywydgjbffla6rbrxq9k3sc62br97qms"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("exo" ,exo)
-- 
2.25.1


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

From b394a0e2019c9780b669a3258fe8e9afb5dfb76d 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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 49739a0064..7b280fee6b 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -204,7 +204,13 @@ 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 (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.25.1


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

From f695692a52e5768e9d40a485140c148e88c51593 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 7b280fee6b..a97730ab1a 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -210,7 +210,17 @@ display manager which supports different greeters.")
      `(#:configure-flags
        (list (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.25.1


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

From eaa49a238ab60f6a905506a750914ad3269c6e15 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 shared-mime-info.
[arguments]: Add wrap-program phase.
---
 gnu/packages/display-managers.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index a97730ab1a..8636d713b0 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -204,6 +204,7 @@ display manager which supports different greeters.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("lightdm" ,lightdm)
+       ("shared-mime-info" ,shared-mime-info)
        ("at-spi2-core" ,at-spi2-core)
        ("gtk+" ,gtk+)))
     (arguments
@@ -220,7 +221,21 @@ 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
+           ;; try to mimic glib-or-gtk build system
+           ;; which doesn't wrap files in /sbin
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/sbin/lightdm-gtk-greeter")
+               `("XDG_DATA_DIRS" ":" prefix
+                 ,(cons "/run/current-system/profile/share"
+                   (map (lambda (pkg)
+                          (string-append (assoc-ref inputs pkg) "/share"))
+                        '("gtk+" "shared-mime-info" "glib"))))
+               `("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.25.1


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

From 967da134843193aaaded8a681d44734a9702e247 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 8636d713b0..fe45165b90 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -166,7 +166,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.25.1


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

From f5f2da7c91530ca4ad7aae38aa083cff81c1e9bc 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index fe45165b90..e13266ed03 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -210,7 +210,8 @@ display manager which supports different greeters.")
        ("gtk+" ,gtk+)))
     (arguments
      `(#:configure-flags
-       (list (string-append "--enable-at-spi-command="
+       (list "--disable-indicator-services-command"
+             (string-append "--enable-at-spi-command="
                             (assoc-ref %build-inputs "at-spi2-core")
                             "/libexec/at-spi-bus-launcher"))
        #:phases
-- 
2.25.1


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0010-services-Add-lightdm-service-type.patch
Content-Transfer-Encoding: quoted-printable

From 5be647a2c7e1994f7cf970fa79fe693ffd4415b8 Mon Sep 17 00:00:00 2001
From: L  p R n  d n <guix@HIDDEN>
Date: Thu, 18 Apr 2019 17:58:56 +0200
Subject: [PATCH 10/10] services: Add lightdm-service-type.

* gnu/services/lightdm.scm: Add file.
* doc/guix.texi (@deftp, @deffn): Add documentation.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 doc/guix.texi            |  88 +++++++++++
 gnu/local.mk             |   1 +
 gnu/services/lightdm.scm | 313 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 402 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index a0920adc1c..2d0230d5e6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14664,6 +14664,94 @@ auto-login session.
 @end table
 @end deftp
=20
+@defvr {Scheme Variable} lightdm-service-type
+Service type for the LightDM graphical login manager.
+It uses the @code{lightdm-gtk-greeter} as default greeter.
+See @code{lightdm-configuration} below for configuration of both lightdm
+and lightdm-gtk-greeter or even using a different greeter.
+@end defvr
+
+@deftp {Data Type} lightdm-configuration
+Data type representing the lightDM service configuration.
+
+@table @asis
+@item @code{session-directory} (default:"/run/current-system/profile/share=
/xsessions:/run/current-system/profile/share/wayland-sessions")
+Directories where LightDM will search for sessions' @code{.desktop} files.
+
+@item @code{allow-empty-passwords?} (default: @code{#f})
+Whether to allow logins with empty passwords.
+
+@item @code{greeter-name} (default: "lightdm-gtk-greeter")
+The name of the default greeter to be used by LightDM.
+
+@item @code{greeter-package} (default: @code{lightdm-gtk-greeter})
+The package containing the greeter described by @code{greeter-name}
+and that will be included in the system's profile.
+
+@item @code{greeter-assets} (default: @code{(list adwaita-icon-theme gnome=
-themes-standard)})
+A list of packages needed by the greeter: icons, themes, fonts etc.
+
+@item @code{greeter-configuration-file} (default: (lightdm-gtk-greeter-con=
figuration-file (lightdm-gtk-greeter-configuration)))
+This file will be placed in @code{/etc/xdg/lightdm/} directory.
+A @code{computed-file} is expected.
+
+@item @code{xorg-configuration} (default: @code{(xorg-configuration)})
+Configuration of the Xorg graphical server.
+
+@item @code{session-wrapper} (default: @code{(xinitrc)})
+Script to run before starting a X session.
+
+@item @code{default-session-name} (default: "")
+The name of the default @code{.desktop} file describing a session.
+If @code {autologin-user} and @code{autologin-timeout} are defined,
+LightDM logs in directly using the session described by @code{default-sess=
ion-name}.
+
+@item @code{autologin-user} (default: "")
+If @code {default-session-name} and @code{autologin-timeout} are defined,
+LightDM logs in directly as @code{autologin-user}.
+
+@item @code{autologin-timeout} (default: @code{#f})
+If @code {default-session-name} and @code{autologin-user} are defined,
+LightDM logs in automatically after @code{autologin-timeout} seconds.
+Any user activity during that time will cancel autologin
+and allow usual login through authentification.
+
+@item @code{lightdm} (default: @code{lightdm})
+The LightDM package to use.
+
+@item @code{extra-config} (default: "")
+String to append to the LightDM configuration file.
+
+@end table
+@end deftp
+
+@deftp {Data Type} lightdm-gtk-greeter-configuration
+This data type represents the configuration for ligtdm-gtk-greeter.
+Use it as an argument of lightdm-gtk-greeter-configuration-file to
+get the corresponding file.
+
+@table @asis
+@item @code{theme-name} (default: "Adwaita")
+The name of the GTK+ theme to be used.
+
+@item @code{icon-theme-name} (default: "Adwaita")
+The name of the icon theme to be used for displaying icons.
+
+@item @code{cursor-theme-name} (default: "Adwaita")
+The name of the theme to be used for the cursor.
+
+@item @code{cursor-size} (default: @code{16})
+The size of the cursor.
+
+@item @code{background} (default: "")
+Path to the background image to be used.
+
+@item @code{extra-config} (default: "")
+String to append to the @code{lightdm-gtk-greeter.conf}.
+
+@end table
+@end deftp
+
 @cindex Xorg, configuration
 @deftp {Data Type} xorg-configuration
 This data type represents the configuration of the Xorg graphical display
diff --git a/gnu/local.mk b/gnu/local.mk
index fc9030b7f9..5ab96c121e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -561,6 +561,7 @@ GNU_SYSTEM_MODULES =3D				\
   %D%/services/getmail.scm				\
   %D%/services/guix.scm			\
   %D%/services/kerberos.scm			\
+  %D%/services/lightdm.scm      		\
   %D%/services/lirc.scm				\
   %D%/services/virtualization.scm		\
   %D%/services/mail.scm				\
diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
new file mode 100644
index 0000000000..4d69daaa49
--- /dev/null
+++ b/gnu/services/lightdm.scm
@@ -0,0 +1,313 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2019,2020 L  p R n  d n   <guix@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+
+(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
+            lightdm-gtk-greeter-configuration
+            lightdm-gtk-greeter-configuration-file))
+
+;; GREETERS
+
+(define-record-type* <lightdm-gtk-greeter-configuration>
+  lightdm-gtk-greeter-configuration make-lightdm-gtk-greeter-configuration
+  lightdm-gtk-greeter-configuration?
+  (theme-name lightdm-gtk-greeter-configuration-theme-name
+              (default "Adwaita"))
+  (icon-theme-name
+   lightdm-gtk-greeter-configuration-icon-theme-name
+   (default "Adwaita"))
+  (cursor-theme-name
+   lightdm-gtk-greeter-configuration-cursor-theme-name
+   (default "Adwaita"))
+  (cursor-size lightdm-gtk-greeter-configuration-cursor-size
+               (default 16))
+  (background lightdm-gtk-greeter-configuration-background
+              (default ""))
+  (extra-config lightdm-gtk-greeter-configuration-extra-config
+                 (default "")))
+
+(define (lightdm-gtk-greeter-configuration-file config)
+  (mixed-text-file "lightdm-gtk-greeter.conf" "
+[greeter]
+theme-name =3D " (lightdm-gtk-greeter-configuration-theme-name config) "
+icon-theme-name =3D "
+(lightdm-gtk-greeter-configuration-icon-theme-name config) "
+cursor-theme-name =3D "
+(lightdm-gtk-greeter-configuration-cursor-theme-name config) "
+cursor-theme-size =3D " (number->string
+                       (lightdm-gtk-greeter-configuration-cursor-size conf=
ig))
+(if (string-null? (lightdm-gtk-greeter-configuration-background config)) ""
+    (string-append "
+background =3D " (lightdm-gtk-greeter-configuration-background config))) "
+" (lightdm-gtk-greeter-configuration-extra-config config)))
+
+;; LIGHTDM
+
+(define-record-type* <lightdm-configuration>
+  lightdm-configuration make-lightdm-configuration
+  lightdm-configuration?
+
+  (lightdm lightdm-configuration-lightdm
+           (default lightdm))
+  (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]
+  (xorg-configuration lightdm-configuration-xorg
+                      (default (xorg-configuration)))
+  (session-wrapper lightdm-configuration-session-wrapper
+                   (default (xinitrc)))
+  (default-session-name lightdm-configuration-default-session
+    (default ""))
+
+  ;; [Autologin]
+  (autologin-user lightdm-configuration-autologin-user
+                  (default ""))
+  (autologin-timeout lightdm-configuration-autologin-timeout
+                     (default #f))
+  ;; [Greeter]
+  (greeter-name lightdm-configuration-greeter-name
+                (default "lightdm-gtk-greeter"))
+  (greeter-package lightdm-configuration-greeter-package
+                   (default lightdm-gtk-greeter))
+  (greeter-assets lightdm-configuration-greeter-assets
+                  (default (list adwaita-icon-theme
+                                 gnome-themes-standard)))
+  (greeter-configuration-file lightdm-configuration-greeter-configuration-=
file
+                              (default (lightdm-gtk-greeter-configuration-=
file
+                                        (lightdm-gtk-greeter-configuration=
))))
+  (extra-config lightdm-configuration-extra-config
+                 (default "")))
+
+(define %lightdm-accounts
+  (list (user-group (name "lightdm") (system? #t))
+        (user-account
+         (name "lightdm")
+         (group "lightdm")
+         (system? #t)
+         (comment "LightDM user")
+         (home-directory "/var/lib/lightdm")
+         (shell (file-append shadow "/sbin/nologin")))))
+
+(define %lightdm-activation
+  ;; Ensure /var/lib/lightdm is owned by the "lightdm" user.
+  ;; Mimics what is done for gdm
+  ;; see a43e9157ef479e94c19951cc9d228cf153bf78ee
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (define (ensure-ownership directory)
+          (let* ((lightdm (getpwnam "lightdm"))
+                 (uid (passwd:uid lightdm))
+                 (gid (passwd:gid lightdm))
+                 (st  (stat directory #f)))
+            ;; Recurse into directory only if it has wrong ownership.
+            (when (and st
+                       (or (not (=3D uid (stat:uid st)))
+                           (not (=3D gid (stat:gid st)))))
+              (for-each (lambda (file)
+                          (chown file uid gid))
+                        (find-files "directory"
+                                    #:directories? #t)))))
+
+        (when (not (stat "/var/lib/lightdm-data" #f))
+          (mkdir-p "/var/lib/lightdm-data"))
+        (for-each ensure-ownership
+                  '("/var/lib/lightdm"
+                    "/var/lib/lightdm-data")))))
+
+(define (lightdm-configuration-file config)
+  (mixed-text-file "lightdm.conf" "
+[LightDM]
+greeter-user =3D lightdm
+greeters-directory =3D /run/current-system/profile/share/xgreeters
+sessions-directory =3D "  (lightdm-configuration-sessions-directory config=
) "
+
+
+[Seat:*]
+xserver-command =3D "  (xorg-start-command (lightdm-configuration-xorg con=
fig)) "
+greeter-session =3D "       (lightdm-configuration-greeter-name config) "
+user-session =3D "          (lightdm-configuration-default-session config)
+(if (string-null? (lightdm-configuration-autologin-user config)) ""
+    (string-append "
+autologin-user =3D " (lightdm-configuration-autologin-user config)))
+(if (string-null? (lightdm-configuration-default-session config)) ""
+    (string-append "
+autologin-session =3D " (lightdm-configuration-default-session config)))
+(if (lightdm-configuration-autologin-timeout config)
+    (string-append "
+autologin-user-timeout =3D " (number->string
+                            (lightdm-configuration-autologin-timeout confi=
g)))
+    "") "
+session-wrapper =3D " (lightdm-configuration-session-wrapper config) "
+" (lightdm-configuration-extra-config 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 #$(file-append (lightdm-configuration-lightdm config)
+                           "/sbin/lightdm")))
+=20
+  (list (shepherd-service
+         (documentation "LightDM display manager.")
+         (requirement '(dbus-system user-processes host-name))
+         (provision '(display-manager))
+         (respawn? #f)
+         (start #~(lambda ()
+                    (fork+exec-command
+                     #$lightdm-command
+                     #:environment-variables
+                     (list
+                      (string-append
+                       "PATH=3D/run/current-system/profile/sbin"
+                       ":/run/current-system/profile/bin")))))
+         (stop #~(make-kill-destructor)))))
+
+(define (lightdm-etc-service config)
+  (let ((lightdm-conf-file
+         (lightdm-configuration-file config))
+        (greeter-conf-file
+         (lightdm-configuration-greeter-configuration-file config)))
+    (if greeter-conf-file
+        (list `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
+                ,lightdm-conf-file)
+              `(,(string-append
+                  "xdg/lightdm/" (computed-file-name greeter-conf-file))
+                ,greeter-conf-file))
+        (list  `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
+                ,lightdm-conf-file)))))
+
+(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
+                (lightdm-configuration-greeter-package config))
+          (lightdm-configuration-greeter-assets config)))
+
+(define lightdm-service-type
+  (handle-xorg-configuration lightdm-configuration
+   (service-type (name 'lightdm)
+                 (extensions
+                  (list
+                   (service-extension shepherd-root-service-type
+                                      lightdm-shepherd-service)
+                   (service-extension activation-service-type
+                                      (const %lightdm-activation))
+                   (service-extension etc-service-type
+                                      lightdm-etc-service)
+                   (service-extension pam-root-service-type
+                                      lightdm-pam-services)
+                   (service-extension dbus-root-service-type
+                                      (compose list
+                                               lightdm-configuration-light=
dm))
+                   (service-extension account-service-type
+                                      (const %lightdm-accounts))
+                   (service-extension profile-service-type
+                                      lightdm-profile-service)))
+                 (default-value (lightdm-configuration))
+                 (description "Return a service that spawns the
+ LightDM graphical login manager."))))
--=20
2.25.1


--=-=-=--





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; 7 Apr 2020 17:07:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 07 13:07:03 2020
Received: from localhost ([127.0.0.1]:50788 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jLrgc-0003qb-Jy
	for submit <at> debbugs.gnu.org; Tue, 07 Apr 2020 13:07:02 -0400
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:47737)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brice@HIDDEN>) id 1jLrgP-0003mA-JL
 for 35305 <at> debbugs.gnu.org; Tue, 07 Apr 2020 13:06:49 -0400
Received: from webmail.gandi.net (webmail18.sd4.0x35.net [10.200.201.18])
 (Authenticated sender: brice@HIDDEN)
 by relay5-d.mail.gandi.net (Postfix) with ESMTPA id 87FF31C0002;
 Tue,  7 Apr 2020 17:06:34 +0000 (UTC)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Date: Tue, 07 Apr 2020 17:06:34 +0000
From: Brice Waegeneire <brice@HIDDEN>
To: guix@HIDDEN
Subject: Re: [bug#35305] LightDM service
Message-ID: <e0dd6ca666986ea18597f95873e3b1c1@HIDDEN>
X-Sender: brice@HIDDEN
User-Agent: Roundcube Webmail/1.3.8
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org
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 (-)

Hello L p R n d n,

I never did a review before but I would like to see this patch merged, 
so
bear with me.

The indentation of lightdm's origin should probably be done in the 
commit
01 not 03.

> `("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"))
This part can use a map procedure.

It would be nice if “lightdm-service-type” support 
“set-xorg-configuration”
like the other login manager now does by using 
“handle-xorg-configuration”
see 50be0da7bfd5c108697679effeb2a893d2f37598 for how it's done in GDM, 
SLIM
and co.

> +         (comment "LighDM user")
                           ^ a “t” is missing here

> +(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")))
[…]
> + (fork+exec-command
> + (list #$(file-append
> + (lightdm-configuration-lightdm config)
> + "/sbin/lightdm"))

“lightdm-command” isn't used, I get the hint it ought to be the argument 
of
“fork+exec-command.”


> +(define (lightdm-etc-service config)
> +  (list `("xdg/lightdm/lightdm.conf.d/lightdm.conf"
> +          ,(lightdm-configuration-file config))
> +        `(,(string-append "xdg/lightdm/"
> +                          (computed-file-name
> +                           
> (lightdm-configuration-greeter-configuration config)))
> +          ,(lightdm-configuration-greeter-configuration config))))

I've been told, in Guix, it's better to avoid putting configuration in
“/etc” since it cause edge case during rollback and such, specifying the
configuration by passing the “--config” argument to “lightdm” would be 
more
appropriate.

> +        (define %user
> +          (getpw "lightdm"))
> +        (let ((directory "/var/lib/lightdm-data"))
> +          (mkdir-p directory)
> +          (chown directory (passwd:uid %user) (passwd:gid %user))))))

“%user” could go in the “let”. BTW can't lightdm use its user home
directory instead of “/var/lib/lightdm-data” or the reverse; IOW does it
need to have to own two directories in “/var/lib”?

Several lines in “gnu/services/lightdm.scm” exceed the maximal line 
length.


Thank you very much for this patch series. I'm impatient seeing it in 
Guix
proper.

- Brice




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; 19 Mar 2020 11:54:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 19 07:54:54 2020
Received: from localhost ([127.0.0.1]:41874 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jEtl6-0003lk-Hj
	for submit <at> debbugs.gnu.org; Thu, 19 Mar 2020 07:54:54 -0400
Received: from mout02.posteo.de ([185.67.36.142]:43381)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1jEtl1-0003lJ-S8
 for 35305 <at> debbugs.gnu.org; Thu, 19 Mar 2020 07:54:43 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 350392400E6
 for <35305 <at> debbugs.gnu.org>; Thu, 19 Mar 2020 12:54:32 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 48jlgq5z4Cz9rxR
 for <35305 <at> debbugs.gnu.org>; Thu, 19 Mar 2020 12:54:31 +0100 (CET)
From: L  p R n  d n    <guix@HIDDEN>
To: 35305 <at> debbugs.gnu.org
Subject: Re: [bug#35305] LightDM service
References: <87zhooso9g.fsf@HIDDEN>
 <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org>
 <878srf9ava.fsf@HIDDEN>
 <878sk1e19s.fsf@HIDDEN>
Date: Thu, 19 Mar 2020 12:54:30 +0100
In-Reply-To: <878sk1e19s.fsf@HIDDEN>
 (=?utf-8?Q?=22Nicol=C3=B2?= Balzarotti"'s message of "Sun, 15 Mar 2020
 22:50:07 +0100")
Message-ID: <874kukh85l.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (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: -0.3 (/)

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

Hello,

Here is the new set of reworked patches. I tested it quickly in a
vm with xfce and gnome (login, logout, switch user) and it seems ok.
I also attach a little scm file with a simple system definition with
lightdm and xfce for those willing to test it.
(also the password is "q" without quotes).

Have a nice day,


L  p R n  d n


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

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

* gnu/packages/display-managers.scm (lightdm): Update to 1.30.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 bfe1a8f6dd..2f81f10140 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -125,16 +125,15 @@ create smooth, animated user interfaces.")
 (define-public lightdm
   (package
     (name "lightdm")
-    (version "1.24.0")
+    (version "1.30.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"))))
+                "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f ; fails when run in parallel
-- 
2.25.1


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

From a2d8e9027e12dabb0acebd3c32aff555727c4129 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 2f81f10140..1f4842bff3 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -180,6 +180,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.25.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-gnu-lightdm-Disable-python-tests-only.patch

From 356da33c8cf358757fdf39393d6edde1b702b408 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@HIDDEN>
Date: Tue, 16 Apr 2019 13:26:22 +0200
Subject: [PATCH 03/10] gnu: lightdm: Disable python tests only.

* gnu/packages/patches/lightdm-disable-python-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/display-managers.scm (lightdm)[source]: Use patch.
* gnu/packages/display-managers.scm (lightdm)[arguments]: Remove
test-python-greeter wrapping.
* gnu/packages/display-managers.scm (lightdm)[native-inputs]: Remove python
and python-gobject.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/display-managers.scm             | 30 +++++---------
 .../lightdm-disable-python-tests.patch        | 40 +++++++++++++++++++
 3 files changed, 50 insertions(+), 21 deletions(-)
 create mode 100644 gnu/packages/patches/lightdm-disable-python-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index caa73d44d4..fc9030b7f9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1144,6 +1144,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/lightdm-disable-python-tests.patch	\
   %D%/packages/patches/linkchecker-tests-require-network.patch	\
   %D%/packages/patches/linux-pam-no-setfsuid.patch		\
   %D%/packages/patches/lirc-localstatedir.patch			\
diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 1f4842bff3..56725f8302 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -127,13 +127,14 @@ create smooth, animated user interfaces.")
     (name "lightdm")
     (version "1.30.0")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/CanonicalLtd/lightdm/releases/download/"
-                    version "/lightdm-" version ".tar.xz"))
-              (sha256
-               (base32
-                "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
+             (method url-fetch)
+             (uri (string-append
+                   "https://github.com/CanonicalLtd/lightdm/releases/download/"
+                   version "/lightdm-" version ".tar.xz"))
+             (sha256
+              (base32
+               "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))
+             (patches (search-patches "lightdm-disable-python-tests.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f ; fails when run in parallel
@@ -152,19 +153,8 @@ 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)
-             (wrap-program "tests/src/test-python-greeter"
-               `("PYTHONPATH"      ":" prefix (,(getenv "PYTHONPATH")))
-               `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
-
              ;; Avoid printing locale warnings, which trip up the text
              ;; matching tests.
              (unsetenv "LC_ALL")
@@ -182,9 +172,7 @@ create smooth, animated user interfaces.")
        ("intltool" ,intltool)
        ("vala" ,vala)                   ;For vala bindings
        ;; For tests
-       ("dbus" ,dbus)
-       ("python" ,python-2)
-       ("python-pygobject" ,python2-pygobject)))
+       ("dbus" ,dbus)))
     ;; Required by liblightdm-gobject-1.pc.
     (propagated-inputs
      `(("glib" ,glib)
diff --git a/gnu/packages/patches/lightdm-disable-python-tests.patch b/gnu/packages/patches/lightdm-disable-python-tests.patch
new file mode 100644
index 0000000000..b1850f279c
--- /dev/null
+++ b/gnu/packages/patches/lightdm-disable-python-tests.patch
@@ -0,0 +1,40 @@
+ tests/Makefile.in | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 9451a6f..46c027c 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -810,29 +810,6 @@ TESTS = test-xserver-fail-start test-greeter-fail-start \
+ 	test-wayland-autologin test-wayland-greeter \
+ 	test-wayland-session test-invalid-seat \
+ 	test-seatdefaults-still-supported \
+-	test-autologin-timeout-python \
+-	test-autologin-guest-timeout-python \
+-	test-autologin-session-timeout-python \
+-	test-cancel-authentication-python test-sessions-python \
+-	test-users-python test-login-python test-login-manual-python \
+-	test-login-manual-previous-session-python \
+-	test-login-no-password-python test-login-long-username-python \
+-	test-login-long-password-python test-login-two-factor-python \
+-	test-login-new-authtok-python test-login-info-prompt-python \
+-	test-login-multi-info-prompt-python \
+-	test-login-previous-session-python \
+-	test-login-wrong-password-python \
+-	test-login-invalid-user-python \
+-	test-login-invalid-session-python test-login-logout-python \
+-	test-login-pick-session-python \
+-	test-login-remember-session-python \
+-	test-login-manual-remember-session-python \
+-	test-login-guest-python test-login-guest-pick-session-python \
+-	test-login-guest-disabled-python \
+-	test-login-guest-no-setup-script-python \
+-	test-login-guest-fail-setup-script-python \
+-	test-login-guest-logout-python \
+-	test-login-remote-session-python test-power-python \
+ 	$(am__append_1) $(am__append_2)
+ EXTRA_DIST = \
+ 	$(TESTS) \
+-- 
+2.25.1
+
-- 
2.25.1


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

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

* gnu/packages/display-manager.scm (lightdm-gtk-greeter): Update to 2.0.7.
---
 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 56725f8302..9e02eaed33 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -187,7 +187,7 @@ display manager which supports different greeters.")
 (define-public lightdm-gtk-greeter
   (package
     (name "lightdm-gtk-greeter")
-    (version "2.0.2")
+    (version "2.0.7")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -196,7 +196,7 @@ display manager which supports different greeters.")
                     "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
               (sha256
                (base32
-                "1436sdm83xqhxyr1rzqxhsl8if2xmidlvb341xcv6dv83lyxkrlf"))))
+                "1g7wc3d3vqfa7mrdhx1w9ywydgjbffla6rbrxq9k3sc62br97qms"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("exo" ,exo)
-- 
2.25.1


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

From 172167821db646e82c1fceef5dced9f2dcf49fd8 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 9e02eaed33..29f91ad1fc 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -204,7 +204,13 @@ 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 (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.25.1


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

From 5e77afbfeb70892c7065927ac3223941679e5f59 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 29f91ad1fc..ec0f685063 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -210,7 +210,17 @@ display manager which supports different greeters.")
      `(#:configure-flags
        (list (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.25.1


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

From 11ab812bca3d9c2a1a53355d4ea2710861377275 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 ec0f685063..4c2391951b 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -205,6 +205,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
@@ -220,7 +221,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.25.1


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

From d83b7241279cf8d672241cb28bd7f719619e6a61 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 4c2391951b..50a43c125f 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -166,7 +166,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.25.1


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

From 1d3f159d3b3205c118325266f1867f439d0d9a46 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index 50a43c125f..62387b14a5 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -210,7 +210,8 @@ display manager which supports different greeters.")
        ("gtk+" ,gtk+)))
     (arguments
      `(#:configure-flags
-       (list (string-append "--enable-at-spi-command="
+       (list "--disable-indicator-services-command"
+             (string-append "--enable-at-spi-command="
                             (assoc-ref %build-inputs "at-spi2-core")
                             "/libexec/at-spi-bus-launcher"))
        #:phases
-- 
2.25.1


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0010-services-Add-lightdm-service-type.patch
Content-Transfer-Encoding: quoted-printable

From 66fadb0425815c9802f06ff96f99349687313cd0 Mon Sep 17 00:00:00 2001
From: Lprndn <guix@HIDDEN>
Date: Thu, 18 Apr 2019 17:58:56 +0200
Subject: [PATCH 10/10] services: Add lightdm-service-type.

* gnu/services/lightdm.scm: Add file.
* doc/guix.texi (@deftp, @deffn): Add documentation.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 doc/guix.texi            |  81 ++++++++++++
 gnu/local.mk             |   1 +
 gnu/services/lightdm.scm | 272 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 354 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index a0920adc1c..d66cba28d1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14664,6 +14664,87 @@ auto-login session.
 @end table
 @end deftp
=20
+@defvr {Scheme Variable} lightdm-service-type
+Service type for the LightDM graphical login manager.
+It uses the @code{lightdm-gtk-greeter} as default greeter.
+See @code{lightdm-configuration} below for configuration of both lightdm
+and lightdm-gtk-greeter or even using a different greeter.
+@end defvr
+
+@deftp {Data Type} lightdm-configuration
+Data type representing the lightDM service configuration.
+
+@table @asis
+@item @code{session-directory} (default:"/run/current-system/profile/share=
/xsessions:/run/current-system/profile/share/wayland-sessions")
+Directories where LightDM will search for sessions' @code{.desktop} files.
+
+@item @code{allow-empty-passwords?} (default: @code{#f})
+Whether to allow logins with empty passwords.
+
+@item @code{greeter-name} (default: "lightdm-gtk-greeter")
+The name of the default greeter to be used by LightDM.
+
+@item @code{greeter-package} (default: @code{lightdm-gtk-greeter})
+The package containing the greeter described by @code{greeter-name}
+and that will be included in the system's profile.
+
+@item @code{greeter-assets} (default: @code{(list adwaita-icon-theme gnome=
-themes-standard)})
+A list of packages needed by the greeter: icons, themes, fonts etc.
+
+@item @code{greeter-configuration-file} (default: (lightdm-gtk-greeter-con=
figuration-file (lightdm-gtk-greeter-configuration)))
+The file that will be place in @code{/etc/xdg/lightdm/} directory.
+A @code{computed-file} is expected.
+
+@item @code{xorg-configuration} (default: @code{(xorg-configuration)})
+Configuration of the Xorg graphical server.
+
+@item @code{session-wrapper} (default: @code{(xinitrc)})
+The command to run for a session. It is run as the user and needs
+to exec the command passed in the arguments to complete running the sessio=
n.
+
+@item @code{default-session-name} (default: @code{#f})
+The name of the default @code{.desktop} file describing as session.
+If @code {autologin-user} and @code{autologin-timeout} are defined,
+LightDM logs in directly using the session described by @code{default-sess=
ion-name}.
+
+@item @code{autologin-user} (default: @code{#f})
+If @code {default-session-name} and @code{autologin-timeout} are defined,
+LightDM logs in directly as @code{autologin-user}.
+
+@item @code{autologin-timeout} (default: @code{#f})
+If @code {default-session-name} and @code{autologin-user} are defined,
+LightDM logs in automatically after @code{autologin-timeout} seconds.
+Any user activity during that time will cancel autologin
+and allow usual login through authentification.
+
+@item @code{lightdm} (default: @code{lightdm})
+The LightDM package to use.
+
+@end table
+@end deftp
+
+@deftp {Data Type} lightdm-gtk-greeter-configuration
+This data type represents the configuration for ligtdm-gtk-greeter.
+
+@table @asis
+@item @code{theme-name} (default: "Adwaita")
+The name of the GTK+ theme to be used.
+
+@item @code{icon-theme-name} (default: "Adwaita")
+The name of the icon theme to be used for displaying icons.
+
+@item @code{cursor-theme-name} (default: "Adwaita")
+The name of the theme to be used for the cursor.
+
+@item @code{cursor-size} (default: @code{16})
+The size of the cursor.
+
+@item @code{background} (default: "")
+Path to the background image to be used.
+
+@end table
+@end deftp
+
 @cindex Xorg, configuration
 @deftp {Data Type} xorg-configuration
 This data type represents the configuration of the Xorg graphical display
diff --git a/gnu/local.mk b/gnu/local.mk
index fc9030b7f9..5ab96c121e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -561,6 +561,7 @@ GNU_SYSTEM_MODULES =3D				\
   %D%/services/getmail.scm				\
   %D%/services/guix.scm			\
   %D%/services/kerberos.scm			\
+  %D%/services/lightdm.scm      		\
   %D%/services/lirc.scm				\
   %D%/services/virtualization.scm		\
   %D%/services/mail.scm				\
diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
new file mode 100644
index 0000000000..d0d6c20c2f
--- /dev/null
+++ b/gnu/services/lightdm.scm
@@ -0,0 +1,272 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2019 L  p R n  d n   <guix@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+
+(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
+            lightdm-gtk-greeter-configuration
+            lightdm-gtk-greeter-configuration-file))
+
+
+(define-record-type* <lightdm-gtk-greeter-configuration>
+  lightdm-gtk-greeter-configuration make-lightdm-gtk-greeter-configuration
+  lightdm-gtk-greeter-configuration?
+  (theme-name lightdm-gtk-greeter-configuration-theme-name
+              (default "Adwaita"))
+  (icon-theme-name
+   lightdm-gtk-greeter-configuration-icon-theme-name
+   (default "Adwaita"))
+  (cursor-theme-name
+   lightdm-gtk-greeter-configuration-cursor-theme-name
+   (default "Adwaita"))
+  (cursor-size lightdm-gtk-greeter-configuration-cursor-size
+               (default 16))
+  (background lightdm-gtk-greeter-configuration-background
+              (default "")))
+
+(define (lightdm-gtk-greeter-configuration-file config)
+  (mixed-text-file "lightdm-gtk-greeter.conf" "
+[greeter]
+theme-name =3D "        (lightdm-gtk-greeter-configuration-theme-name conf=
ig) "
+icon-theme-name =3D "   (lightdm-gtk-greeter-configuration-icon-theme-name=
 config) "
+cursor-theme-name =3D " (lightdm-gtk-greeter-configuration-cursor-theme-na=
me config) "
+cursor-theme-size =3D " (number->string
+                       (lightdm-gtk-greeter-configuration-cursor-size conf=
ig)) "
+background =3D "        (lightdm-gtk-greeter-configuration-background conf=
ig)))
+
+(define-record-type* <lightdm-configuration>
+  lightdm-configuration make-lightdm-configuration
+  lightdm-configuration?
+
+  (lightdm lightdm-configuration-lightdm
+           (default lightdm))
+  (sessions-directory lightdm-configuration-sessions-directory
+                      (default (string-append
+                                "/run/current-system/profile/share/xsessio=
ns"
+                                ":/run/current-system/profile/share/waylan=
d-sessions")))
+  (allow-empty-passwords? lightdm-configuration-allow-empty-passwords?
+                          (default #f))
+  ;; [Seat]
+  (xorg-configuration lightdm-configuration-xorg
+                      (default (xorg-configuration)))
+  (session-wrapper lightdm-configuration-session-wrapper
+                   (default (xinitrc)))
+  (default-session-name lightdm-configuration-default-session
+    (default ""))
+
+  ;; [Autologin]
+  (autologin-user lightdm-configuration-autologin-user
+                  (default #f))
+  (autologin-timeout lightdm-configuration-autologin-timeout
+                     (default #f))
+  ;; [Greeter]
+  (greeter-name lightdm-configuration-greeter-name
+                (default "lightdm-gtk-greeter"))
+  (greeter-package lightdm-configuration-greeter-package
+                   (default lightdm-gtk-greeter))
+  (greeter-assets lightdm-configuration-greeter-assets
+                  (default (list adwaita-icon-theme
+                                 gnome-themes-standard)))
+  (greeter-configuration-file lightdm-configuration-greeter-configuration
+                              (default (lightdm-gtk-greeter-configuration-=
file
+                                        (lightdm-gtk-greeter-configuration=
)))))
+
+(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 =3D lightdm
+greeters-directory =3D /run/current-system/profile/share/xgreeters
+sessions-directory =3D "  (lightdm-configuration-sessions-directory config=
) "
+
+
+[Seat:*]
+xserver-command =3D "  (xorg-start-command (lightdm-configuration-xorg con=
fig)) "
+greeter-session =3D "       (lightdm-configuration-greeter-name config) "
+user-session =3D "          (lightdm-configuration-default-session config)
+(if (lightdm-configuration-autologin-user config) (string-append "
+autologin-user =3D " (lightdm-configuration-autologin-user config)) "")
+(if (string-null? (lightdm-configuration-default-session config)) ""
+    (string-append "
+autologin-session =3D " (lightdm-configuration-default-session config)))
+(if (lightdm-configuration-autologin-timeout config) (string-append "
+autologin-user-timeout =3D " (lightdm-configuration-autologin-timeout conf=
ig)) "") "
+session-wrapper =3D " (lightdm-configuration-session-wrapper 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=3D/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))
+        `(,(string-append "xdg/lightdm/"
+                          (computed-file-name
+                           (lightdm-configuration-greeter-configuration co=
nfig)))
+          ,(lightdm-configuration-greeter-configuration 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
+                (lightdm-configuration-greeter-package config))
+          (lightdm-configuration-greeter-assets config)))
+
+(define (lightdm-activation-service config)
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (define %user
+          (getpw "lightdm"))
+        (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-l=
ightdm))
+                  (service-extension account-service-type
+                                     (const %lightdm-accounts))
+                  (service-extension profile-service-type
+                                     lightdm-profile-service)))
+                (default-value (lightdm-configuration))
+                (description "Return a service that spawns the LightDM gra=
phical login
+ manager.")))
--=20
2.25.1


--=-=-=
Content-Type: text/plain
Content-Disposition: attachment; filename=lightdm-desktop-test.scm

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu) (gnu system nss) (srfi srfi-1))
(use-service-modules desktop lightdm xorg)
(use-package-modules bootloaders certs)

(operating-system
  (host-name "antelope")
  (timezone "Europe/Paris")
  (locale "en_US.utf8")

  ;; Use the UEFI variant of GRUB with the EFI System
  ;; Partition mounted on /boot/efi.
  (bootloader (bootloader-configuration
                (bootloader grub-efi-bootloader)
                (target "/boot/efi")))

  ;; Assume the target root file system is labelled "my-root",
  ;; and the EFI System Partition has UUID 1234-ABCD.
  (file-systems (append
                 (list (file-system
                         (device (file-system-label "my-root"))
                         (mount-point "/")
                         (type "ext4"))
                       (file-system
                         (device (uuid "1234-ABCD" 'fat))
                         (mount-point "/boot/efi")
                         (type "vfat")))
                 %base-file-systems))

  (users (cons (user-account
                (name "alice")
                (comment "Bob's sister")
                ;; Password is "q" (without quotes)
                (password "a2l/LaE8AKHIY")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video")))
               %base-user-accounts))

  ;; Add a bunch of window managers; we can choose one at
  ;; the log-in screen with F1.
  (packages (append (list
                     ;; for HTTPS access
                     nss-certs)
                    %base-packages))

  ;; Use the "desktop" services, which include the X11
  ;; log-in service, networking with NetworkManager, and more.
  (services (cons*
             (service lightdm-service-type)
             (service xfce-desktop-service-type)
             (modify-services
                 (remove (lambda (service)
                           (eq? (service-kind service) gdm-service-type))
                         %desktop-services))))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

--=-=-=--




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; 16 Mar 2020 08:36:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 16 04:36:58 2020
Received: from localhost ([127.0.0.1]:36033 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jDlF4-0003NL-Eo
	for submit <at> debbugs.gnu.org; Mon, 16 Mar 2020 04:36:58 -0400
Received: from mout02.posteo.de ([185.67.36.142]:58585)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1jDlF1-0003Mw-95
 for 35305 <at> debbugs.gnu.org; Mon, 16 Mar 2020 04:36:56 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D8F722400FE
 for <35305 <at> debbugs.gnu.org>; Mon, 16 Mar 2020 09:36:48 +0100 (CET)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 48gqR35t3qz9rxS;
 Mon, 16 Mar 2020 09:36:47 +0100 (CET)
From: L  p R n  d n    <guix@HIDDEN>
To: Efraim Flashner <efraim@HIDDEN>
Subject: Re: [bug#35305] Acknowledgement ([WIP] LightDM service)
References: <87zhooso9g.fsf@HIDDEN>
 <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org>
 <878srf9ava.fsf@HIDDEN>
 <878sk1e19s.fsf@HIDDEN>
 <20200316073450.GH927@E5400>
Date: Mon, 16 Mar 2020 09:36:46 +0100
In-Reply-To: <20200316073450.GH927@E5400> (Efraim Flashner's message of "Mon, 
 16 Mar 2020 09:34:50 +0200")
Message-ID: <87pndcvgpt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org,
 =?utf-8?Q?Nicol=C3=B2?= Balzarotti <anothersms@HIDDEN>
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 (--)


Hello,

Also a rebase on latest master might be necessary. I was waiting for
staging to be merged so if I got time, I'll probably take care of this
during the week. ;)

Have a nice day,

L  p R n  d n   




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; 16 Mar 2020 07:35:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 16 03:35:31 2020
Received: from localhost ([127.0.0.1]:36019 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jDkHa-0001nL-VA
	for submit <at> debbugs.gnu.org; Mon, 16 Mar 2020 03:35:31 -0400
Received: from flashner.co.il ([178.62.234.194]:37002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <efraim@HIDDEN>) id 1jDkHY-0001n6-1p
 for 35305 <at> debbugs.gnu.org; Mon, 16 Mar 2020 03:35:28 -0400
Received: from localhost (unknown [141.226.13.108])
 by flashner.co.il (Postfix) with ESMTPSA id 89F22400E5;
 Mon, 16 Mar 2020 07:35:21 +0000 (UTC)
Date: Mon, 16 Mar 2020 09:34:50 +0200
From: Efraim Flashner <efraim@HIDDEN>
To: =?utf-8?Q?Nicol=C3=B2?= Balzarotti <anothersms@HIDDEN>
Subject: Re: [bug#35305] Acknowledgement ([WIP] LightDM service)
Message-ID: <20200316073450.GH927@E5400>
References: <87zhooso9g.fsf@HIDDEN>
 <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org>
 <878srf9ava.fsf@HIDDEN>
 <878sk1e19s.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="oyqLL/JqMvClXZi1"
Content-Disposition: inline
In-Reply-To: <878sk1e19s.fsf@HIDDEN>
X-PGP-Key-ID: 0x41AAE7DCCA3D8351
X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc
X-PGP-Fingerprint: A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 35305
Cc: 35305 <at> debbugs.gnu.org, L p R n d n <guix@HIDDEN>
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.0 (-)


--oyqLL/JqMvClXZi1
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Mar 15, 2020 at 10:50:07PM +0100, Nicol=C3=B2 Balzarotti wrote:
> Cool, I was wondering why the lightdm package was available but no
> service was provided for it.  Anything blocking this patch?
>=20
> Thanks, Nicol=C3=B2
>=20
> L  p R n  d n    <guix@HIDDEN> writes:
>=20
> > ping

I don't think anyone got around to reviewing it :/

--=20
Efraim Flashner   <efraim@HIDDEN>   =D7=90=D7=A4=D7=A8=D7=99=D7=9D =
=D7=A4=D7=9C=D7=A9=D7=A0=D7=A8
GPG key =3D A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

--oyqLL/JqMvClXZi1
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl5vLBcACgkQQarn3Mo9
g1HRzA//c0dG/HRr+a4+SzTBxYn8P0OzJFL3zNj7N2vBBqsUqLttPGa5ULcWb93q
BrRSZyKCr5i7SB45BO/ReXSufmOou+QrWwtbgOMCYBWhtyIKog/VvYdH8ZJk9i6e
x37lo1+OtG8TPTYIq5Gd+Mj9pgburKLlmqInW5c+as7L1buDD38I41xdMY8KDt0U
R/L6k5Cu6vv5VJUfk+/GijuNPdWzrbDPftLuJytp/l0ZSRFPAbXj4CSDN6H01vBg
/OjC2F3ItfZr8Uq2QxaawqBj+8f2VIuPW5Qoba+3+G73MhxoMea7x4pEajwYznZo
lb9Sh2rVeBaKf4QPsNi4YgLP/jHqikyEyb74wum4lzDEB1117WwgfvSL0rpJV5c5
W3HnbZ4cwKFN29Jxttwec88vB0Lbs2G+HEYgJJmJjgmhysetbDTPp4EsoTOkqduX
3VUtgAqGj3H/cJPRDTBtFKQinHNZe5h2aQ2W0Nsjnvl7jvmXv0XdxCUumJijHH8u
3XTOhjDP4CPhsSngWd7qS9yodcdofAPdcLiBKTTAEST/3AY1ZP4qAFB4izDThYJ0
aCbmSE4WeBC8lUQjz4bHOjxCt2EfdN0PvpR8T+e2brcspVS0dMDy6Wg3/rkSZY83
IBp+g9VYSzy3G8aXRfd0ouRZHjlClLQ1Bh3J106Orr8q9F0cmB4=
=/Qfg
-----END PGP SIGNATURE-----

--oyqLL/JqMvClXZi1--




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; 15 Mar 2020 21:50:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 15 17:50:18 2020
Received: from localhost ([127.0.0.1]:35752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jDb9G-0001L3-9H
	for submit <at> debbugs.gnu.org; Sun, 15 Mar 2020 17:50:18 -0400
Received: from mail-wm1-f51.google.com ([209.85.128.51]:40212)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <anothersms@HIDDEN>) id 1jDb9E-0001Kl-5c
 for 35305 <at> debbugs.gnu.org; Sun, 15 Mar 2020 17:50:16 -0400
Received: by mail-wm1-f51.google.com with SMTP id z12so6767129wmf.5
 for <35305 <at> debbugs.gnu.org>; Sun, 15 Mar 2020 14:50:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version
 :content-transfer-encoding;
 bh=x20KpIQmV70ojIodYFvO6y+3wPuITL1qWWRPniLaXCY=;
 b=j9eyBXt1wtvZVsOeOmVJTvh5LJHv71ht6hHbTDqEhCxgMH7Ih+aCpbXK7Qs8J+6jTQ
 HavCmBFn2DFja89giG/0TCKDD9p5ODY560NzJPwShbc3A2NNwmO6QSEAdRSg0wt6zrYE
 uFkwUK+/RP+oRTAdaJfmx7+vwDTOUO0WE09E3Y9S3oAGlA63Q70KnSDMLpI41TCjman4
 AuyiUELq23sJhZ2DuTw3HU2zngmKnctPGKJA7SI2Wg3mMEOXlO4v85oF5kZJFLpEzBLw
 UxnRX+Nt4+foJnDsUUvY9vfjdh7X96bao23xuTf4EgQYPaR78H+Ze7JPtYkghH5G1RVt
 PYqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=x20KpIQmV70ojIodYFvO6y+3wPuITL1qWWRPniLaXCY=;
 b=Ebw4tueX9+CqRqCGMtmjqL+Jh0Je3syUIAtoSGm6C/Uks07WT5in6x9sqUEjSqpTIV
 R9DPhy57ctpHYZMXekqQcbC0k8gdWj5lpL3zBAFGh9DTPuJ+bHyMNgFnDkoUrhxEBBkI
 0NZDbL08IQhtas0jTgxsQY/vzCQaj6FLfUFPcZWR3fhyMEuaPNBKTs1A16LQuR3A2nkl
 bnIETofX1S3jJQlpcaEaE7m8nKO+WB7PtkLprdxKtE37Z0LUIX6glGsq9SImw5r7tqQU
 TyTEZDdICLjpXbTSAhaWSJh0OZJ3Ya8ZdtGB/j3RMWSo+sPBBc4AjMtNilk4oQt9f2vQ
 9KXQ==
X-Gm-Message-State: ANhLgQ24DvPMYHvaJOyunyN4V69nsE7Qi5+C6Qk45oAmh4T3xC265peo
 KC9vKRZJcmYTZXcLAYoYI9bpRiWF
X-Google-Smtp-Source: ADFU+vtHVC+4rfQ/7CVAdaS4s+XQpX//iozZVLu2NKhL0YMsN19RwoKxsQC3hlnMnmHQwgsYE4iMBQ==
X-Received: by 2002:a05:600c:2193:: with SMTP id
 e19mr19075646wme.142.1584309009942; 
 Sun, 15 Mar 2020 14:50:09 -0700 (PDT)
Received: from guixSD (host241-136-dynamic.40-79-r.retail.telecomitalia.it.
 [79.40.136.241])
 by smtp.gmail.com with ESMTPSA id h10sm16782636wrb.24.2020.03.15.14.50.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 15 Mar 2020 14:50:09 -0700 (PDT)
From: =?utf-8?Q?Nicol=C3=B2?= Balzarotti <anothersms@HIDDEN>
To: L  p R n  d n <guix@HIDDEN>, 35305 <at> debbugs.gnu.org
Subject: Re: [bug#35305] Acknowledgement ([WIP] LightDM service)
In-Reply-To: <878srf9ava.fsf@HIDDEN>
References: <87zhooso9g.fsf@HIDDEN>
 <handler.35305.B.155550391014002.ack <at> debbugs.gnu.org>
 <878srf9ava.fsf@HIDDEN>
Date: Sun, 15 Mar 2020 22:50:07 +0100
Message-ID: <878sk1e19s.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
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.0 (-)

Cool, I was wondering why the lightdm package was available but no
service was provided for it.  Anything blocking this patch?

Thanks, Nicol=C3=B2

L  p R n  d n    <guix@HIDDEN> writes:

> ping




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; 26 Aug 2019 15:59:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 26 11:59:04 2019
Received: from localhost ([127.0.0.1]:47114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i2HOY-0003ih-Nm
	for submit <at> debbugs.gnu.org; Mon, 26 Aug 2019 11:59:04 -0400
Received: from mout01.posteo.de ([185.67.36.141]:37446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1i2HOU-0003iB-LX
 for 35305 <at> debbugs.gnu.org; Mon, 26 Aug 2019 11:58:59 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id DC8EB160061
 for <35305 <at> debbugs.gnu.org>; Mon, 26 Aug 2019 17:58:51 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 46HGrp3MgFz6tmB
 for <35305 <at> debbugs.gnu.org>; Mon, 26 Aug 2019 17:58:50 +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: Mon, 26 Aug 2019 17:58:49 +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: <878srf9ava.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.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: -0.4 (/)

ping




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; 23 May 2019 09:05:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 23 05:05:11 2019
Received: from localhost ([127.0.0.1]:43898 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hTjep-0001ek-28
	for submit <at> debbugs.gnu.org; Thu, 23 May 2019 05:05:11 -0400
Received: from mout02.posteo.de ([185.67.36.142]:34163)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1hTjem-0001eB-34
 for 35305 <at> debbugs.gnu.org; Thu, 23 May 2019 05:05:01 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id A70F12400FD
 for <35305 <at> debbugs.gnu.org>; Thu, 23 May 2019 11:04:52 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 458k8p3Bhnz9s02
 for <35305 <at> debbugs.gnu.org>; Thu, 23 May 2019 11:04:39 +0200 (CEST)
From: L  p R n  d n    <guix@HIDDEN>
To: 35305 <at> debbugs.gnu.org
Subject: [PATCH] LightDM service
Date: Thu, 23 May 2019 13:04:44 +0200
Message-ID: <877eahwhwz.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: -0.3 (/)

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

Hello,

New patch for adding the lightDM service replacing the previous one.
Added some doc, simplified lightdm-configuration to look a little bit
more like other display manager's services and use xorg-configuration.
We can always add more options later if needed.
I also made an attempt at factoring out the lightdm-gtk-greeter
configuration. It should be easier to add configuration of other greeter
but there might be better ways.
I'm open to suggestions but otherwise it should be mergeable.
Thanks,

Have a nice day,

L  p R n  d n


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0010-services-Add-lightdm-service-type.patch
Content-Transfer-Encoding: quoted-printable

From 90d8f29625eedfce9acf62ad2589498eddf1679e Mon Sep 17 00:00:00 2001
From: L  p R n  d n <guix@HIDDEN>
Date: Thu, 18 Apr 2019 17:58:56 +0200
Subject: [PATCH 10/10] services: Add lightdm-service-type.

* gnu/services/lightdm.scm: Add file.
* doc/guix.texi (@deftp, @deffn): Add documentation.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 doc/guix.texi            |  81 ++++++++++++
 gnu/local.mk             |   1 +
 gnu/services/lightdm.scm | 272 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 354 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index 3f50bf77fe..03f50718d9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13680,6 +13680,87 @@ type @code{<sddm-configuration>}.
 @end example
 @end deffn
=20
+@defvr {Scheme Variable} lightdm-service-type
+Service type for the LightDM graphical login manager.
+It uses the @code{lightdm-gtk-greeter} as default greeter.
+See @code{lightdm-configuration} below for configuration of both lightdm
+and lightdm-gtk-greeter or even using a different greeter.
+@end defvr
+
+@deftp {Data Type} lightdm-configuration
+Data type representing the lightDM service configuration.
+
+@table @asis
+@item @code{session-directory} (default:"/run/current-system/profile/share=
/xsessions:/run/current-system/profile/share/wayland-sessions")
+Directories where LightDM will search for sessions' @code{.desktop} files.
+
+@item @code{allow-empty-passwords?} (default: @code{#f})
+Whether to allow logins with empty passwords.
+
+@item @code{greeter-name} (default: "lightdm-gtk-greeter")
+The name of the default greeter to be used by LightDM.
+
+@item @code{greeter-package} (default: @code{lightdm-gtk-greeter})
+The package containing the greeter described by @code{greeter-name}
+and that will be included in the system's profile.
+
+@item @code{greeter-assets} (default: @code{(list adwaita-icon-theme gnome=
-themes-standard)})
+A list of packages needed by the greeter: icons, themes, fonts etc.
+
+@item @code{greeter-configuration-file} (default: (lightdm-gtk-greeter-con=
figuration-file (lightdm-gtk-greeter-configuration)))
+The file that will be place in @code{/etc/xdg/lightdm/} directory.
+A @code{computed-file} is expected.
+
+@item @code{xorg-configuration} (default: @code{(xorg-configuration)})
+Configuration of the Xorg graphical server.
+
+@item @code{session-wrapper} (default: @code{(xinitrc)})
+The command to run for a session. It is run as the user and needs
+to exec the command passed in the arguments to complete running the sessio=
n.
+
+@item @code{default-session-name} (default: @code{#f})
+The name of the default @code{.desktop} file describing as session.
+If @code {autologin-user} and @code{autologin-timeout} are defined,
+LightDM logs in directly using the session described by @code{default-sess=
ion-name}.
+
+@item @code{autologin-user} (default: @code{#f})
+If @code {default-session-name} and @code{autologin-timeout} are defined,
+LightDM logs in directly as @code{autologin-user}.
+
+@item @code{autologin-timeout} (default: @code{#f})
+If @code {default-session-name} and @code{autologin-user} are defined,
+LightDM logs in automatically after @code{autologin-timeout} seconds.
+Any user activity during that time will cancel autologin
+and allow usual login through authentification.
+
+@item @code{lightdm} (default: @code{lightdm})
+The LightDM package to use.
+
+@end table
+@end deftp
+
+@deftp {Data Type} lightdm-gtk-greeter-configuration
+This data type represents the configuration for ligtdm-gtk-greeter.
+
+@table @asis
+@item @code{theme-name} (default: "Adwaita")
+The name of the GTK+ theme to be used.
+
+@item @code{icon-theme-name} (default: "Adwaita")
+The name of the icon theme to be used for displaying icons.
+
+@item @code{cursor-theme-name} (default: "Adwaita")
+The name of the theme to be used for the cursor.
+
+@item @code{cursor-size} (default: @code{16})
+The size of the cursor.
+
+@item @code{background} (default: "")
+Path to the background image to be used.
+
+@end table
+@end ftp
+
 @cindex Xorg, configuration
 @deftp {Data Type} xorg-configuration
 This data type represents the configuration of the Xorg graphical display
diff --git a/gnu/local.mk b/gnu/local.mk
index 133293aad3..782e71f0df 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -514,6 +514,7 @@ GNU_SYSTEM_MODULES =3D				\
   %D%/services/authentication.scm		\
   %D%/services/games.scm			\
   %D%/services/kerberos.scm			\
+  %D%/services/lightdm.scm      		\
   %D%/services/lirc.scm				\
   %D%/services/virtualization.scm		\
   %D%/services/mail.scm				\
diff --git a/gnu/services/lightdm.scm b/gnu/services/lightdm.scm
new file mode 100644
index 0000000000..d0d6c20c2f
--- /dev/null
+++ b/gnu/services/lightdm.scm
@@ -0,0 +1,272 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2019 L  p R n  d n   <guix@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+
+(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
+            lightdm-gtk-greeter-configuration
+            lightdm-gtk-greeter-configuration-file))
+
+
+(define-record-type* <lightdm-gtk-greeter-configuration>
+  lightdm-gtk-greeter-configuration make-lightdm-gtk-greeter-configuration
+  lightdm-gtk-greeter-configuration?
+  (theme-name lightdm-gtk-greeter-configuration-theme-name
+              (default "Adwaita"))
+  (icon-theme-name
+   lightdm-gtk-greeter-configuration-icon-theme-name
+   (default "Adwaita"))
+  (cursor-theme-name
+   lightdm-gtk-greeter-configuration-cursor-theme-name
+   (default "Adwaita"))
+  (cursor-size lightdm-gtk-greeter-configuration-cursor-size
+               (default 16))
+  (background lightdm-gtk-greeter-configuration-background
+              (default "")))
+
+(define (lightdm-gtk-greeter-configuration-file config)
+  (mixed-text-file "lightdm-gtk-greeter.conf" "
+[greeter]
+theme-name =3D "        (lightdm-gtk-greeter-configuration-theme-name conf=
ig) "
+icon-theme-name =3D "   (lightdm-gtk-greeter-configuration-icon-theme-name=
 config) "
+cursor-theme-name =3D " (lightdm-gtk-greeter-configuration-cursor-theme-na=
me config) "
+cursor-theme-size =3D " (number->string
+                       (lightdm-gtk-greeter-configuration-cursor-size conf=
ig)) "
+background =3D "        (lightdm-gtk-greeter-configuration-background conf=
ig)))
+
+(define-record-type* <lightdm-configuration>
+  lightdm-configuration make-lightdm-configuration
+  lightdm-configuration?
+
+  (lightdm lightdm-configuration-lightdm
+           (default lightdm))
+  (sessions-directory lightdm-configuration-sessions-directory
+                      (default (string-append
+                                "/run/current-system/profile/share/xsessio=
ns"
+                                ":/run/current-system/profile/share/waylan=
d-sessions")))
+  (allow-empty-passwords? lightdm-configuration-allow-empty-passwords?
+                          (default #f))
+  ;; [Seat]
+  (xorg-configuration lightdm-configuration-xorg
+                      (default (xorg-configuration)))
+  (session-wrapper lightdm-configuration-session-wrapper
+                   (default (xinitrc)))
+  (default-session-name lightdm-configuration-default-session
+    (default ""))
+
+  ;; [Autologin]
+  (autologin-user lightdm-configuration-autologin-user
+                  (default #f))
+  (autologin-timeout lightdm-configuration-autologin-timeout
+                     (default #f))
+  ;; [Greeter]
+  (greeter-name lightdm-configuration-greeter-name
+                (default "lightdm-gtk-greeter"))
+  (greeter-package lightdm-configuration-greeter-package
+                   (default lightdm-gtk-greeter))
+  (greeter-assets lightdm-configuration-greeter-assets
+                  (default (list adwaita-icon-theme
+                                 gnome-themes-standard)))
+  (greeter-configuration-file lightdm-configuration-greeter-configuration
+                              (default (lightdm-gtk-greeter-configuration-=
file
+                                        (lightdm-gtk-greeter-configuration=
)))))
+
+(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 =3D lightdm
+greeters-directory =3D /run/current-system/profile/share/xgreeters
+sessions-directory =3D "  (lightdm-configuration-sessions-directory config=
) "
+
+
+[Seat:*]
+xserver-command =3D "  (xorg-start-command (lightdm-configuration-xorg con=
fig)) "
+greeter-session =3D "       (lightdm-configuration-greeter-name config) "
+user-session =3D "          (lightdm-configuration-default-session config)
+(if (lightdm-configuration-autologin-user config) (string-append "
+autologin-user =3D " (lightdm-configuration-autologin-user config)) "")
+(if (string-null? (lightdm-configuration-default-session config)) ""
+    (string-append "
+autologin-session =3D " (lightdm-configuration-default-session config)))
+(if (lightdm-configuration-autologin-timeout config) (string-append "
+autologin-user-timeout =3D " (lightdm-configuration-autologin-timeout conf=
ig)) "") "
+session-wrapper =3D " (lightdm-configuration-session-wrapper 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=3D/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))
+        `(,(string-append "xdg/lightdm/"
+                          (computed-file-name
+                           (lightdm-configuration-greeter-configuration co=
nfig)))
+          ,(lightdm-configuration-greeter-configuration 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
+                (lightdm-configuration-greeter-package config))
+          (lightdm-configuration-greeter-assets config)))
+
+(define (lightdm-activation-service config)
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (define %user
+          (getpw "lightdm"))
+        (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-l=
ightdm))
+                  (service-extension account-service-type
+                                     (const %lightdm-accounts))
+                  (service-extension profile-service-type
+                                     lightdm-profile-service)))
+                (default-value (lightdm-configuration))
+                (description "Return a service that spawns the LightDM gra=
phical login
+ manager.")))
--=20
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 14:05:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 10:05:34 2019
Received: from localhost ([127.0.0.1]:42248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hH7fL-0006Tc-MS
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2019 10:05:33 -0400
Received: from mout02.posteo.de ([185.67.36.142]:48091)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1hH7fF-0006T2-4N
 for 35305 <at> debbugs.gnu.org; Thu, 18 Apr 2019 10:05:26 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 431D42400FF
 for <35305 <at> debbugs.gnu.org>; Thu, 18 Apr 2019 16:05:13 +0200 (CEST)
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 44lLTg4Q6Zz9rxR
 for <35305 <at> debbugs.gnu.org>; Thu, 18 Apr 2019 16:05:11 +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>
 <87r29zwiu8.fsf@HIDDEN>
Date: Thu, 18 Apr 2019 18:03:08 +0200
In-Reply-To: <87r29zwiu8.fsf@HIDDEN> (L. p. R. n. d. n.'s message of
 "Thu, 18 Apr 2019 15:20:31 +0200")
Message-ID: <87imvbwbb7.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: -0.3 (/)

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


New patch for addinf lightdm service replacing previous one.
Now with local.mk changes.

Have a nice day,

L  p R n  d n


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

From 9472d86e06306a66cccbc5f3a0043071f0d9c540 Mon Sep 17 00:00:00 2001
From: L  p R n  d n <guix@HIDDEN>
Date: Thu, 18 Apr 2019 17:58:56 +0200
Subject: [PATCH 10/10] services: Add lightdm-service-type.

* gnu/services/lightdm.scm: Add file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk             |   1 +
 gnu/services/lightdm.scm | 235 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 236 insertions(+)
 create mode 100644 gnu/services/lightdm.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index df96b98f07..9dafda9833 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -513,6 +513,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/services/authentication.scm		\
   %D%/services/games.scm			\
   %D%/services/kerberos.scm			\
+  %D%/services/lightdm.scm      		\
   %D%/services/lirc.scm				\
   %D%/services/virtualization.scm		\
   %D%/services/mail.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: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: Tue, 14 Apr 2020 09:45:02 UTC

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