services: gnome: Add udev rules.

Fixes: <https://issues.guix.gnu.org/32166>.

* gnu/services/desktop.scm (gnome-packages, gnome-udev-rules): New procedures.
(gnome-polkit-settings): Use the gnome-packages procedure.
(gnome-desktop-service-type): Add an udev service extension.
This commit is contained in:
Mathieu Othacehe 2022-01-03 20:22:02 +01:00
parent 2e691011bf
commit cd4092b7a3
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -868,22 +868,34 @@ (define-record-type* <gnome-desktop-configuration> gnome-desktop-configuration
gnome-desktop-configuration?
(gnome gnome-package (default gnome)))
(define (gnome-polkit-settings config)
"Return the list of GNOME dependencies that provide polkit actions and
rules."
(define (gnome-packages config packages)
"Return the list of GNOME dependencies from CONFIG which names are part of
the given PACKAGES list."
(let ((gnome (gnome-package config)))
(map (lambda (name)
((package-direct-input-selector name) gnome))
'("gnome-settings-daemon"
"gnome-control-center"
"gnome-system-monitor"
"gvfs"))))
packages)))
(define (gnome-udev-rules config)
"Return the list of GNOME dependencies that provide udev rules."
(gnome-packages config '("gnome-settings-daemon")))
(define (gnome-polkit-settings config)
"Return the list of GNOME dependencies that provide polkit actions and
rules."
(gnome-packages config
'("gnome-settings-daemon"
"gnome-control-center"
"gnome-system-monitor"
"gvfs")))
(define gnome-desktop-service-type
(service-type
(name 'gnome-desktop)
(extensions
(list (service-extension polkit-service-type
(list (service-extension udev-service-type
gnome-udev-rules)
(service-extension polkit-service-type
gnome-polkit-settings)
(service-extension profile-service-type
(compose list