Subject: [bug#77266] [PATCH] gnu: Merge xorg configurations when extending.

From: Ian Eure <[email-masked]>
Date: Tue, 15 Apr 2025 18:08:10 -0700

Ludovic Courtès <[email-masked]> writes:

> Hello Ian,
>
> Ian Eure <[email-masked]> writes:
>
>> +(define %xorg-keyboard-service
>> +  (simple-service
>> +   'xorg-keyboard
>> +   gdm-service-type
>> +   (xorg-configuration (keyboard-layout keyboard-layouut))))
>
> Could you fix the indentation and add short comments above the
> definitions?

Definitely.

>> +(operating-system
>> +  (services
>> +   (cons*
>> +    (service gdm-service-type)
>> +    %xorg-intel-service
>
> Rather:
>
>   (append (list (service gdm-service-type)
>                 %xorg-intel-service
>                 …)
>           @dots{})

Can make these changes, but I’m curious why (append (list ...) 
...) is preferred over cons*.  I default to the latter, because I 
like the removal of the extra level of indent.

> Something I had overlooked: this assumes that elements of this 
> list can
> be compared with ‘equal?’.  Typically, these are <file-append> 
> records
> that refer to <package> records, and those cannot be usefully 
> compared
> with ‘equal?’ (it’s effectively equivalent to ‘eq?’ in the case 
> of
> <package> records, but more expensive).
>
> So, what about removing ‘delete-duplicates’ from here, and 
> instead…
>
>>  (define (xorg-configuration->file config)
>>    "Compute an Xorg configuration file corresponding to CONFIG, 
>>    an
>
> … adding ‘delete-duplicates’ calls in here, on the build side.

Good catch, makes sense to me.  Will send a v3.

Thanks,
  -- Ian