services: dbus: Deprecate 'polkit-service' procedure.

* doc/guix.texi (Desktop Services): Replace 'polkit-service' with 'polkit-service-type'.
* gnu/services/dbus.scm (polkit-service): Deprecate procedure.
* gnu/tests/docker.scm (%docker-os): Use polkit-service-type.
* gnu/tests/virtualization.scm (%libvirt-os): Ditto.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Bruno Victal 2023-02-25 18:58:04 +00:00 committed by Ludovic Courtès
parent c3dc13e29c
commit ffc5d42fc2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
4 changed files with 15 additions and 9 deletions

View File

@ -23440,16 +23440,20 @@ The value for this service is a file-like object, by default it is
set to @code{accountsservice} (the package object for AccountsService). set to @code{accountsservice} (the package object for AccountsService).
@end defvar @end defvar
@deffn {Scheme Procedure} polkit-service @ @defvar polkit-service-type
[#:polkit @var{polkit}] Type for the service that runs the
Return a service that runs the @url{https://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege
@uref{https://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege
management service}, which allows system administrators to grant access to management service}, which allows system administrators to grant access to
privileged operations in a structured way. By querying the Polkit service, a privileged operations in a structured way. By querying the Polkit service, a
privileged system component can know when it should grant additional privileged system component can know when it should grant additional
capabilities to ordinary users. For example, an ordinary user can be granted capabilities to ordinary users. For example, an ordinary user can be granted
the capability to suspend the system if the user is logged in locally. the capability to suspend the system if the user is logged in locally.
@end deffn
The value for this service is a @code{<polkit-configuration>} object.
@end defvar
@c TODO: Document <polkit-configuration>, preferably by refactoring this to use
@c define-configuration and generating documentation from it.
@defvar polkit-wheel-service @defvar polkit-wheel-service
Service that adds the @code{wheel} group as admins to the Polkit Service that adds the @code{wheel} group as admins to the Polkit

View File

@ -28,6 +28,7 @@
#:use-module ((gnu packages glib) #:select (dbus)) #:use-module ((gnu packages glib) #:select (dbus))
#:use-module (gnu packages polkit) #:use-module (gnu packages polkit)
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (guix deprecation)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module ((guix packages) #:select (package-name)) #:use-module ((guix packages) #:select (package-name))
#:use-module (guix records) #:use-module (guix records)
@ -43,7 +44,7 @@
polkit-configuration polkit-configuration
polkit-configuration? polkit-configuration?
polkit-service-type polkit-service-type
polkit-service)) polkit-service)) ; deprecated
;;; ;;;
;;; D-Bus. ;;; D-Bus.
@ -404,7 +405,8 @@ management service}, which allows system administrators to grant access to
privileged operations in a structured way. Polkit is a requirement for most privileged operations in a structured way. Polkit is a requirement for most
desktop environments, such as GNOME."))) desktop environments, such as GNOME.")))
(define* (polkit-service #:key (polkit polkit)) (define-deprecated (polkit-service #:key (polkit polkit))
polkit-service-type
"Return a service that runs the "Return a service that runs the
@uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege @uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege
management service}, which allows system administrators to grant access to management service}, which allows system administrators to grant access to

View File

@ -49,7 +49,7 @@
(simple-operating-system (simple-operating-system
(service dhcp-client-service-type) (service dhcp-client-service-type)
(dbus-service) (dbus-service)
(polkit-service) (service polkit-service-type)
(service elogind-service-type) (service elogind-service-type)
(service docker-service-type))) (service docker-service-type)))

View File

@ -50,7 +50,7 @@
(simple-operating-system (simple-operating-system
(service dhcp-client-service-type) (service dhcp-client-service-type)
(dbus-service) (dbus-service)
(polkit-service) (service polkit-service-type)
(service libvirt-service-type))) (service libvirt-service-type)))
(define (run-libvirt-test) (define (run-libvirt-test)