From 00767d967d2f70d53bb7494ac09e0e7c44323697 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:01 +0000 Subject: services: desktop: Deprecate 'elogind-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Desktop Services): Replace 'elogind-service' with 'elogind-service-type'. * gnu/services/desktop.scm (elogind-service): Deprecate procedure. (desktop-services-for-system): Use elogind-service-type. * gnu/tests/lightdm.scm (minimal-desktop-services): Ditto. Signed-off-by: Ludovic Courtès --- gnu/tests/lightdm.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/tests') diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index 57d029a75a..25fa06a9f1 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -48,7 +48,7 @@ (service upower-service-type) (accountsservice-service) (service polkit-service-type) - (elogind-service) + (service elogind-service-type) (dbus-service) x11-socket-directory-service)) -- cgit 1.4.1 From c3dc13e29c624609b851ef50db343074fad2d7cb Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:03 +0000 Subject: services: desktop: Deprecate 'accountsservice-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Desktop Services): Replace 'accountsservice-service' with 'accountsservice-service-type'. * gnu/services/desktop.scm (accountsservice-service): Deprecate procedure. (desktop-services-for-system): Use accountsservice-service-type. * gnu/tests/lightdm.scm (minimal-desktop-services): Ditto. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 15 +++++++-------- gnu/services/desktop.scm | 8 +++++--- gnu/tests/lightdm.scm | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'gnu/tests') diff --git a/doc/guix.texi b/doc/guix.texi index e0563f493f..0530b9a45b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23428,18 +23428,17 @@ Data type representing the configuration of @command{elogind}. @end table @end deftp -@deffn {Scheme Procedure} accountsservice-service @ - [#:accountsservice @var{accountsservice}] -Return a service that runs AccountsService, a system service that can +@defvar accountsservice-service-type +Type for the service that runs AccountsService, a system service that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to acquire the capability to modify their system configuration. -@uref{https://www.freedesktop.org/wiki/Software/AccountsService/, the -accountsservice web site} for more information. +See @url{https://www.freedesktop.org/wiki/Software/AccountsService/, +AccountsService} for more information. -The @var{accountsservice} keyword argument is the @code{accountsservice} -package to expose as a service. -@end deffn +The value for this service is a file-like object, by default it is +set to @code{accountsservice} (the package object for AccountsService). +@end defvar @deffn {Scheme Procedure} polkit-service @ [#:polkit @var{polkit}] diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 634b240af2..4a790fbdc4 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -126,7 +126,7 @@ fontconfig-file-system-service accountsservice-service-type - accountsservice-service + accountsservice-service ; deprecated cups-pk-helper-service-type sane-service-type @@ -1295,7 +1295,9 @@ over D-Bus that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to acquire the capability to modify their system configuration."))) -(define* (accountsservice-service #:key (accountsservice accountsservice)) +(define-deprecated + (accountsservice-service #:key (accountsservice accountsservice)) + accountsservice-service-type "Return a service that runs AccountsService, a system service that can list available accounts, change their passwords, and so on. AccountsService integrates with PolicyKit to enable unprivileged users to @@ -1858,7 +1860,7 @@ applications needing access to be root.") (service avahi-service-type) (udisks-service) (service upower-service-type) - (accountsservice-service) + (service accountsservice-service-type) (service cups-pk-helper-service-type) (service colord-service-type) (geoclue-service) diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index 25fa06a9f1..aa97a96939 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -46,7 +46,7 @@ (define minimal-desktop-services (list polkit-wheel-service (service upower-service-type) - (accountsservice-service) + (service accountsservice-service-type) (service polkit-service-type) (service elogind-service-type) (dbus-service) -- cgit 1.4.1 From ffc5d42fc2589c349579c00e9dd11fabdff2663b Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:04 +0000 Subject: services: dbus: Deprecate 'polkit-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- doc/guix.texi | 14 +++++++++----- gnu/services/dbus.scm | 6 ++++-- gnu/tests/docker.scm | 2 +- gnu/tests/virtualization.scm | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'gnu/tests') diff --git a/doc/guix.texi b/doc/guix.texi index 0530b9a45b..4ff5622ad3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -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). @end defvar -@deffn {Scheme Procedure} polkit-service @ - [#:polkit @var{polkit}] -Return a service that runs the -@uref{https://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege +@defvar polkit-service-type +Type for the service that runs the +@url{https://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege management service}, which allows system administrators to grant access to privileged operations in a structured way. By querying the Polkit service, a privileged system component can know when it should grant additional 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. -@end deffn + +The value for this service is a @code{} object. +@end defvar + +@c TODO: Document , preferably by refactoring this to use +@c define-configuration and generating documentation from it. @defvar polkit-wheel-service Service that adds the @code{wheel} group as admins to the Polkit diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 5efd6bdadf..ea2593501f 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -28,6 +28,7 @@ #:use-module ((gnu packages glib) #:select (dbus)) #:use-module (gnu packages polkit) #:use-module (gnu packages admin) + #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module ((guix packages) #:select (package-name)) #:use-module (guix records) @@ -43,7 +44,7 @@ polkit-configuration polkit-configuration? polkit-service-type - polkit-service)) + polkit-service)) ; deprecated ;;; ;;; 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 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 @uref{http://www.freedesktop.org/wiki/Software/polkit/, Polkit privilege management service}, which allows system administrators to grant access to diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index 4267ff89a8..e464ec587e 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -49,7 +49,7 @@ (simple-operating-system (service dhcp-client-service-type) (dbus-service) - (polkit-service) + (service polkit-service-type) (service elogind-service-type) (service docker-service-type))) diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm index 60789fbb5b..6749ade4bd 100644 --- a/gnu/tests/virtualization.scm +++ b/gnu/tests/virtualization.scm @@ -50,7 +50,7 @@ (simple-operating-system (service dhcp-client-service-type) (dbus-service) - (polkit-service) + (service polkit-service-type) (service libvirt-service-type))) (define (run-libvirt-test) -- cgit 1.4.1 From c6cbce9ad8ee5fa7b51d8abea83ddc3dd07fa3c6 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:08 +0000 Subject: services: mail: Deprecate 'dovecot-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Mail Services): Replace 'dovecot-service' with 'dovecot-service-type'. * gnu/services/mail.scm (dovecot-service-type): Set default value. (dovecot-service): Deprecate procedure. * gnu/tests/mail.scm (%dovecot-os): Use dovecot-service-type. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 13 +++++++------ gnu/services/mail.scm | 9 ++++++--- gnu/tests/mail.scm | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'gnu/tests') diff --git a/doc/guix.texi b/doc/guix.texi index dabd71f18c..af15894d49 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24709,9 +24709,10 @@ in the subsections below. @subsubheading Dovecot Service -@deffn {Scheme Procedure} dovecot-service [#:config (dovecot-configuration)] -Return a service that runs the Dovecot IMAP/POP3/LMTP mail server. -@end deffn +@defvar dovecot-service-type +Type for the service that runs the Dovecot IMAP/POP3/LMTP mail server, +whose value is a @code{} object. +@end defvar By default, Dovecot does not need much configuration; the default configuration object created by @code{(dovecot-configuration)} will @@ -24726,9 +24727,9 @@ For example, to specify that mail is located at @code{maildir~/.mail}, one would instantiate the Dovecot service like this: @lisp -(dovecot-service #:config - (dovecot-configuration - (mail-location "maildir:~/.mail"))) +(service dovecot-service-type + (dovecot-configuration + (mail-location "maildir:~/.mail"))) @end lisp The available configuration parameters follow. Each parameter diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 6f588679b1..bf4948dcfb 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -35,6 +35,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages dav) #:use-module (gnu packages tls) + #:use-module (guix deprecation) #:use-module (guix modules) #:use-module (guix records) #:use-module (guix packages) @@ -42,7 +43,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (srfi srfi-1) - #:export (dovecot-service + #:export (dovecot-service ; deprecated dovecot-service-type dovecot-configuration opaque-dovecot-configuration @@ -1601,9 +1602,11 @@ greyed out, instead of only later giving \"not selectable\" popup error. (service-extension activation-service-type %dovecot-activation))) (description "Run Dovecot, a mail server that can run POP3, -IMAP, and LMTP."))) +IMAP, and LMTP.") + (default-value (dovecot-configuration)))) -(define* (dovecot-service #:key (config (dovecot-configuration))) +(define-deprecated (dovecot-service #:key (config (dovecot-configuration))) + dovecot-service-type "Return a service that runs @command{dovecot}, a mail server that can run POP3, IMAP, and LMTP. @var{config} should be a configuration object created by @code{dovecot-configuration}. @var{config} may also be created by diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm index f13751b72f..dc1f18b3f1 100644 --- a/gnu/tests/mail.scm +++ b/gnu/tests/mail.scm @@ -293,16 +293,16 @@ acl_check_data: (define %dovecot-os (simple-operating-system (service dhcp-client-service-type) - (dovecot-service #:config - (dovecot-configuration - (disable-plaintext-auth? #f) - (ssl? "no") - (auth-mechanisms '("anonymous")) - (auth-anonymous-username "alice") - (mail-location - (string-append "maildir:~/Maildir" - ":INBOX=~/Maildir/INBOX" - ":LAYOUT=fs")))))) + (service dovecot-service-type + (dovecot-configuration + (disable-plaintext-auth? #f) + (ssl? "no") + (auth-mechanisms '("anonymous")) + (auth-anonymous-username "alice") + (mail-location + (string-append "maildir:~/Maildir" + ":INBOX=~/Maildir/INBOX" + ":LAYOUT=fs")))))) (define (run-dovecot-test) "Return a test of an OS running Dovecot service." -- cgit 1.4.1 From 2799ad44234be675f018115f99be98d2c9fd565d Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:13 +0000 Subject: services: dbus: Deprecate 'dbus-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Desktop Services): Replace with 'dbus-root-service-type'. Document dbus-configuration. * gnu/services/dbus.scm (dbus-service): Define with 'define-deprecated'. * gnu/services/desktop.scm (desktop-services-for-system): Replace with dbus-root-service-type. * gnu/system/install.scm (%installation-services): Ditto. * gnu/tests/base.scm (%avahi-os): Ditto. * gnu/tests/docker.scm (%docker-os): Ditto. * gnu/tests/lightdm.scm (minimal-desktop-services): Ditto. * gnu/tests/virtualization.scm (%libvirt-os): Ditto. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 49 ++++++++++++++++++++++++++++---------------- gnu/services/dbus.scm | 5 +++-- gnu/services/desktop.scm | 2 +- gnu/system/install.scm | 2 +- gnu/tests/base.scm | 2 +- gnu/tests/docker.scm | 2 +- gnu/tests/lightdm.scm | 2 +- gnu/tests/virtualization.scm | 2 +- 8 files changed, 40 insertions(+), 26 deletions(-) (limited to 'gnu/tests') diff --git a/doc/guix.texi b/doc/guix.texi index 704c125b10..74658dbc86 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23301,24 +23301,37 @@ The actual service definitions included in @code{%desktop-services} and provided by @code{(gnu services dbus)} and @code{(gnu services desktop)} are described below. -@deffn {Scheme Procedure} dbus-service [#:dbus @var{dbus}] [#:services '()] @ - [#:verbose?] -Return a service that runs the ``system bus'', using @var{dbus}, with -support for @var{services}. When @var{verbose?} is true, it causes the -@samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a -verbose-enabled D-Bus package such as @code{dbus-verbose} should be -provided as @var{dbus} in this scenario. The verbose output is logged -to @file{/var/log/dbus-daemon.log}. - -@uref{https://dbus.freedesktop.org/, D-Bus} is an inter-process communication -facility. Its system bus is used to allow system services to communicate -and to be notified of system-wide events. - -@var{services} must be a list of packages that provide an -@file{etc/dbus-1/system.d} directory containing additional D-Bus configuration -and policy files. For example, to allow avahi-daemon to use the system bus, -@var{services} must be equal to @code{(list avahi)}. -@end deffn +@defvar dbus-root-service-type +Type for a service that runs the D-Bus ``system bus''. +@footnote{@uref{https://dbus.freedesktop.org/, D-Bus} is an inter-process +communication facility. Its system bus is used to allow system services +to communicate and to be notified of system-wide events.} + +The value for this service type is a @code{} record. +@end defvar + +@deftp {Data Type} dbus-configuration +Data type representing the configuration for @code{dbus-root-service-type}. + +@table @asis +@item @code{dbus} (default: @code{dbus}) (type: file-like) +Package object for dbus. + +@item @code{services} (default: @code{()}) (type: list) +List of packages that provide an @file{etc/dbus-1/system.d} directory +containing additional D-Bus configuration and policy files. +For example, to allow avahi-daemon to use the system bus, @var{services} +must be equal to @code{(list avahi)}. + +@item @code{verbose?} (default: @code{#f}) (type: boolean) +When @code{#t}, D-Bus is launched with environment variable +@samp{DBUS_VERBOSE} set to @samp{1}. A verbose-enabled D-Bus package +such as @code{dbus-verbose} should be provided to @var{dbus} in this +scenario. The verbose output is logged to +@file{/var/log/dbus-daemon.log}. + +@end table +@end deftp @subsubheading Elogind diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index ea2593501f..e9c9346f56 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -38,7 +38,7 @@ #:export (dbus-configuration dbus-configuration? dbus-root-service-type - dbus-service + dbus-service ; deprecated wrapped-dbus-service polkit-configuration @@ -245,7 +245,8 @@ includes the @code{etc/dbus-1/system.d} directories of each package listed in bus. It allows programs and daemons to communicate and is also responsible for spawning (@dfn{activating}) D-Bus services on demand."))) -(define* (dbus-service #:key (dbus dbus) (services '()) verbose?) +(define-deprecated (dbus-service #:key (dbus dbus) (services '()) verbose?) + dbus-root-service-type "Return a service that runs the \"system bus\", using @var{dbus}, with support for @var{services}. When @var{verbose?} is true, it causes the @samp{DBUS_VERBOSE} environment variable to be set to @samp{1}; a diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 3ec746cdbd..8026778ea5 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1880,7 +1880,7 @@ applications needing access to be root.") (service geoclue-service-type) (service polkit-service-type) (service elogind-service-type) - (dbus-service) + (service dbus-root-service-type) (service ntp-service-type) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index dd965f312b..7a68c19606 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -442,7 +442,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m (list %loopback-static-networking)) (service wpa-supplicant-service-type) - (dbus-service) + (service dbus-root-service-type) (service connman-service-type (connman-configuration (disable-vpn? #t))) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 3e72e193d7..97edbbc6ad 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -962,7 +962,7 @@ non-ASCII names from /tmp.") (name-service-switch %mdns-host-lookup-nss) (services (cons* (service avahi-service-type (avahi-configuration (debug? #t))) - (dbus-service) + (service dbus-root-service-type) (service dhcp-client-service-type) ;needed for multicast ;; Enable heavyweight debugging output. diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index e464ec587e..0276e398a7 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -48,7 +48,7 @@ (define %docker-os (simple-operating-system (service dhcp-client-service-type) - (dbus-service) + (service dbus-root-service-type) (service polkit-service-type) (service elogind-service-type) (service docker-service-type))) diff --git a/gnu/tests/lightdm.scm b/gnu/tests/lightdm.scm index aa97a96939..dda472bd74 100644 --- a/gnu/tests/lightdm.scm +++ b/gnu/tests/lightdm.scm @@ -49,7 +49,7 @@ (service accountsservice-service-type) (service polkit-service-type) (service elogind-service-type) - (dbus-service) + (service dbus-root-service-type) x11-socket-directory-service)) (define %lightdm-os diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm index 6749ade4bd..effdeb4cfa 100644 --- a/gnu/tests/virtualization.scm +++ b/gnu/tests/virtualization.scm @@ -49,7 +49,7 @@ (define %libvirt-os (simple-operating-system (service dhcp-client-service-type) - (dbus-service) + (service dbus-root-service-type) (service polkit-service-type) (service libvirt-service-type))) -- cgit 1.4.1