Subject: Re: [PATCH v6 1/3] services: greetd: Improve greeter configurations.

From: muradm <[email-masked]>
Date: Thu, 06 Feb 2025 17:02:33 +0300

Hello,

>> +@item @code{extra-shepherd-requirement} (default: @code{'()})
>> +This option can be used to provide a list of additional 
>> symbols naming Shepherd
>> +services that this service will depend on, such as 
>> @code{'seatd} or
>> +@code{'elogind} when terminal session is graphical greeter.
>
> Neat!  According to git-grep, the most common name for this 
> field is
> 'shepherd-requirement', followed by 'shepherd-requirements'.  I 
> think we
> should standardize on the former (shepherd-requirement), as this 
> gets
> passed as the 'requirement' field value of the underlying
> `shepherd-service' record.

I explicitly named field 'extra-shepherd-requirement' due to its 
implementation. Other places you mention about configure whole 
list of requirements, for instance:

--8<---------------cut here---------------start------------->8---
  (shepherd-requirement 
  mingetty-configuration-shepherd-requirement
                        ;; Since the login prompt shows the host 
                        name, wait
                        ;; for the 'host-name' service to be done. 
                        Also wait
                        ;; for udev essentially so that the tty 
                        text is not
                        ;; lost in the middle of kernel messages 
                        (XXX).
                        (default '(user-processes host-name udev
                                                  virtual-terminal))))

  ;; .... skipped

    (list
     (shepherd-service
      (documentation "Run mingetty on an tty.")
      (provision (list (symbol-append 'term- (string->symbol 
      tty))))

      (requirement shepherd-requirement)
--8<---------------cut here---------------end--------------->8---

Compared to what 'extra-shepherd-requirement' means:

--8<---------------cut here---------------start------------->8---
+  (extra-shepherd-requirement greetd-extra-shepherd-requirement 
(default '()))

-          (greetd-vt (greetd-terminal-vt tc)))
+          (greetd-vt (greetd-terminal-vt tc))
+          (greetd-requirement (greetd-extra-shepherd-requirement 
tc)))
        (shepherd-service
         (documentation "Minimal and flexible login manager 
         daemon")
-        (requirement '(pam user-processes host-name udev 
         virtual-terminal))
+        (requirement `(pam user-processes host-name udev 
virtual-terminal
+                           ,@greetd-requirement))
--8<---------------cut here---------------end--------------->8---

We add to requrements, thus 'extra-shepherd-requirement', compared 
to other overriding requirements.