Subject: [bug#35305] LightDM service

From: L p R n d n <[email-masked]>
Date: Tue, 14 Apr 2020 11:38:18 +0200

Hello,

Thanks again for the feedbacks.

Brice Waegeneire <[email-masked]> writes:

[...]
> 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].

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 
> 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=true"))))))

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 
> 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:
>
> (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")))

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 “/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`.

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 
> `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 = "           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                                        "
> ")))

Way better! Preparing a patch for that.

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

Yeap!

> 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

Have a nice day!

L  p R n  d n