services: localed: Do nothing for unconfigured keyboards.

* gnu/services/xorg.scm (localed-service-type)[package]: Return the
empty list when the 'keyboard-layout' field is #f.
[compose]: Use 'find' instead of 'first'.
This commit is contained in:
Ludovic Courtès 2019-04-05 17:51:28 +02:00
parent 3ef3bdf1cd
commit 1361584983
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -707,7 +707,12 @@ (define keyboard-layout
'()))
(define localed-service-type
(let ((package (compose list localed-configuration-localed)))
(let ((package (lambda (config)
;; Don't bother if the user didn't specify any keyboard
;; layout.
(if (localed-configuration-keyboard-layout config)
(list (localed-configuration-localed config))
'()))))
(service-type (name 'localed)
(extensions
(list (service-extension dbus-root-service-type
@ -720,7 +725,8 @@ (define localed-service-type
;; This service can be extended, typically by the X login
;; manager, to communicate the chosen Xorg keyboard layout.
(compose first)
(compose (lambda (extensions)
(find keyboard-layout? extensions)))
(extend (lambda (config keyboard-layout)
(localed-configuration
(inherit config)