[PATCH 00/27] Deprecate old-style services.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Bruno Victal
Owner
unassigned
Submitted by
Bruno Victal
Severity
normal
B
B
Bruno Victal wrote on 25 Feb 2023 19:53
(address . guix-patches@gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
cover.1677350249.git.mirai@makinata.eu
Should completely deprecate every old-style service from Guix.
Some had conflicting default values and some had to be rewritten.

For some services the documentation is _still_ incomplete but should still result in an improvement over the status quo.


Note: #60756 also deprecates one such old-style service but is not included
in this patch series.


*** BLURB HERE ***

Bruno Victal (27):
services: base: Deprecate 'host-name-service' procedure.
services: base: Deprecate 'login-service' procedure.
services: base: Deprecate 'mingetty-service' procedure.
services: base: Deprecate 'agetty-service' procedure.
doc: kmscon-service-type: Use @defvar @-command.
services: base: Deprecate 'nscd-service' procedure.
services: base: Deprecate 'syslog-service' procedure.
services: base: Deprecate 'udev-service' procedure.
services: base: Deprecate 'rngd-service' procedure.
services: base: Deprecate 'pam-limits-service' procedure.
services: tor: Deprecate 'tor-hidden-service' procedure.
services: ssh: Deprecate 'lsh-service' procedure.
services: ssh: Deprecate 'dropbear-service' procedure.
services: xorg: Deprecate 'screen-locker-service' procedure.
services: desktop: Deprecate 'elogind-service' procedure.
services: elogind-configuration: Do not ignore 'handle-hibernate-key'
by default.
services: desktop: Deprecate 'accountsservice-service' procedure.
services: dbus: Deprecate 'polkit-service' procedure.
services: desktop: Deprecate 'udisks-service' procedure.
services: desktop: Deprecate 'geoclue-service' procedure.
services: desktop: Deprecate 'bluetooth-service' procedure.
services: mail: Deprecate 'dovecot-service' procedure.
services: vpn: Deprecate 'openvpn-client-service' &
'openvpn-server-service' procedures.
services: lirc: Deprecate 'lirc-service' procedure.
services: spice: Deprecate 'spice-vdagent-service' procedure.
services: dict: Deprecate 'dicod-service' procedure.
services: dbus: Deprecate 'dbus-service' procedure.

doc/guix.texi | 831 +++++++++++++---------
gnu/packages/benchmark.scm | 2 +-
gnu/packages/kde-multimedia.scm | 4 +-
gnu/services/base.scm | 155 ++--
gnu/services/dbus.scm | 11 +-
gnu/services/desktop.scm | 107 +--
gnu/services/dict.scm | 6 +-
gnu/services/lirc.scm | 18 +-
gnu/services/mail.scm | 9 +-
gnu/services/networking.scm | 47 +-
gnu/services/spice.scm | 7 +-
gnu/services/ssh.scm | 74 +-
gnu/services/vpn.scm | 19 +-
gnu/services/xorg.scm | 47 +-
gnu/system.scm | 2 +-
gnu/system/examples/beaglebone-black.tmpl | 14 +-
gnu/system/hurd.scm | 2 +-
gnu/system/install.scm | 25 +-
gnu/tests/base.scm | 2 +-
gnu/tests/docker.scm | 4 +-
gnu/tests/lightdm.scm | 6 +-
gnu/tests/mail.scm | 20 +-
gnu/tests/virtualization.scm | 4 +-
23 files changed, 835 insertions(+), 581 deletions(-)


base-commit: 7b40cb7c6e310652c118f339422e3ab9f87d67eb
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 01/27] services: base: Deprecate 'host-name-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
08a1b5a6e81b4b9b9600ddfd24465978eada34bb.1677350249.git.mirai@makinata.eu
* doc/guix.texi (operating-system Reference): Reorder cross-reference.
Add an anchor to be used ...
(Base services): ... here by host-name-service-type. Document
host-name-service-type.
* gnu/services/base.scm: Export host-name-service-type.
(host-name-service): Deprecate procedure.
* gnu/system.scm (operating-system-default-essential-services): Use
host-name-service-type.
---
doc/guix.texi | 16 ++++++++++------
gnu/services/base.scm | 6 ++++--
gnu/system.scm | 2 +-
3 files changed, 15 insertions(+), 9 deletions(-)

Toggle diff (76 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a7ef00f421..9d5dd495c0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -16640,12 +16640,14 @@ operating-system Reference
@item @code{services} (default: @code{%base-services})
A list of service objects denoting system services. @xref{Services}.
+@anchor{operating-system-essential-services}
@cindex essential services
@item @code{essential-services} (default: ...)
The list of ``essential services''---i.e., things like instances of
-@code{system-service-type} and @code{host-name-service-type} (@pxref{Service
-Reference}), which are derived from the operating system definition itself.
-As a user you should @emph{never} need to touch this field.
+@code{system-service-type} (@pxref{Service Reference}) and
+@code{host-name-service-type}, which are derived from the operating
+system definition itself. As a user you should @emph{never} need to
+touch this field.
@item @code{pam-services} (default: @code{(base-pam-services)})
@cindex PAM
@@ -18018,9 +18020,11 @@ Base Services
@end lisp
@end deffn
-@deffn {Scheme Procedure} host-name-service @var{name}
-Return a service that sets the host name to @var{name}.
-@end deffn
+@defvar host-name-service-type
+Type of the service that sets the system host name, whose value
+is a string. This service is included in @code{operating-system} by
+default (@pxref{operating-system-essential-services,@code{essential-services}}).
+@end defvar
@defvar console-font-service-type
Install the given fonts on the specified ttys (fonts are per
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 7ad1e765bd..c471107883 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -99,7 +99,8 @@ (define-module (gnu services base)
file-system-service-type
file-system-utilities
swap-service
- host-name-service
+ host-name-service ; deprecated
+ host-name-service-type
%default-console-font
console-font-service-type
console-font-service
@@ -778,7 +779,8 @@ (define host-name-service-type
(one-shot? #t)))
(description "Initialize the machine's host name.")))
-(define (host-name-service name)
+(define-deprecated (host-name-service name)
+ host-name-service-type
"Return a service that sets the host name to @var{name}."
(service host-name-service-type name))
diff --git a/gnu/system.scm b/gnu/system.scm
index 53f3c62bb0..bb26d7c9a5 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -782,7 +782,7 @@ (define (operating-system-default-essential-services os)
(operating-system-file-systems os)))
(session-environment-service
(operating-system-environment-variables os))
- (host-name-service host-name)
+ (service host-name-service-type host-name)
procs root-fs
(service setuid-program-service-type
(operating-system-setuid-programs os))
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 02/27] services: base: Deprecate 'login-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
3f2d8fea6e785811c1a139f4fb0efc17a6b4be44.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace with login-service-type.
* gnu/services/base.scm (login-service): Deprecate procedure.
* gnu/system/install.scm (%installation-services): Use login-service-type.
---
doc/guix.texi | 12 ++++++------
gnu/services/base.scm | 5 +++--
gnu/system/install.scm | 5 +++--
3 files changed, 12 insertions(+), 10 deletions(-)

Toggle diff (66 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 9d5dd495c0..cb0d18ebdc 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18101,14 +18101,14 @@ Base Services
host names.
@end defun
-@deffn {Scheme Procedure} login-service @var{config}
-Return a service to run login according to @var{config}, a
-@code{<login-configuration>} object, which specifies the message of the day,
-among other things.
-@end deffn
+@defvar login-service-type
+Type of the service that provides a console login service, whose value
+is a @code{<login-configuration>} object.
+@end defvar
@deftp {Data Type} login-configuration
-This is the data type representing the configuration of login.
+Data type representing the configuration of login, which specifies the
+@acronym{MOTD, message of the day}, among other things.
@table @asis
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index c471107883..8dfd92aacf 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -158,7 +158,7 @@ (define-module (gnu services base)
login-configuration
login-configuration?
login-service-type
- login-service
+ login-service ; deprecated
agetty-configuration
agetty-configuration?
@@ -937,7 +937,8 @@ (define login-service-type
"Provide a console log-in service as specified by its
configuration value, a @code{login-configuration} object.")))
-(define* (login-service #:optional (config (login-configuration)))
+(define-deprecated (login-service #:optional (config (login-configuration)))
+ login-service-type
"Return a service configure login according to @var{config}, which specifies
the message of the day, among other things."
(service login-service-type config))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index b3cf7a1bd8..8c7585f188 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -347,8 +347,9 @@ (define* (%installation-services #:key (system (or (and=>
(virtual-terminal "tty1")
(login-program (installer-program))))
- (login-service (login-configuration
- (motd motd)))
+ (service login-service-type
+ (login-configuration
+ (motd motd)))
;; Documentation. The manual is in UTF-8, but
;; 'console-font-service' sets up Unicode support and loads a font
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 07/27] services: base: Deprecate 'syslog-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
7adf5f5b68372e7b590c1af7e92c3823e748752e.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace syslog-service with syslog-service-type.
* gnu/services/base.scm (%default-syslog.conf): Place before <syslog-configuration>.
(syslog-service-type): Set default value.
(syslog-service): Deprecate procedure.
(%base-services): Use syslog-service-type.
* gnu/system/hurd.scm (%base-services/hurd): Ditto.
* gnu/system/install.scm (%installation-services): Ditto.
---
doc/guix.texi | 19 ++++++-------
gnu/services/base.scm | 61 +++++++++++++++++++++---------------------
gnu/system/hurd.scm | 2 +-
gnu/system/install.scm | 2 +-
4 files changed, 41 insertions(+), 43 deletions(-)

Toggle diff (168 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 86edc58b40..5072bcc11f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18494,11 +18494,15 @@ Base Services
external name servers do not even need to be queried.
@end defvar
-@anchor{syslog-configuration-type}
@cindex syslog
@cindex logging
+@defvar syslog-service-type
+Type of the service that runs the syslog daemon, whose value is a
+@code{<syslog-configuration>} object.
+@end defvar
+
@deftp {Data Type} syslog-configuration
-This data type represents the configuration of the syslog daemon.
+Data type representing the configuration of the syslog daemon.
@table @asis
@item @code{syslogd} (default: @code{#~(string-append #$inetutils "/libexec/syslogd")})
@@ -18506,19 +18510,12 @@ Base Services
@item @code{config-file} (default: @code{%default-syslog.conf})
The syslog configuration file to use.
+@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more
+information on the configuration file syntax.
@end table
@end deftp
-@anchor{syslog-service}
-@cindex syslog
-@deffn {Scheme Procedure} syslog-service @var{config}
-Return a service that runs a syslog daemon according to @var{config}.
-
-@xref{syslogd invocation,,, inetutils, GNU Inetutils}, for more
-information on the configuration file syntax.
-@end deffn
-
@defvar guix-service-type
This is the type of the service that runs the build daemon,
@command{guix-daemon} (@pxref{Invoking guix-daemon}). Its value must be a
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 423a38e39d..45e6c5f448 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -190,7 +190,7 @@ (define-module (gnu services base)
syslog-configuration
syslog-configuration?
- syslog-service
+ syslog-service ; deprecated
syslog-service-type
%default-syslog.conf
@@ -1511,6 +1511,32 @@ (define-deprecated (nscd-service #:optional (config (nscd-configuration)))
Service Switch}, for an example."
(service nscd-service-type config))
+;; Snippet adapted from the GNU inetutils manual.
+(define %default-syslog.conf
+ (plain-file "syslog.conf" "
+ # Log all error messages, authentication messages of
+ # level notice or higher and anything of level err or
+ # higher to the console.
+ # Don't log private authentication messages!
+ *.alert;auth.notice;authpriv.none -/dev/console
+
+ # Log anything (except mail) of level info or higher.
+ # Don't log private authentication messages!
+ *.info;mail.none;authpriv.none -/var/log/messages
+
+ # Log \"debug\"-level entries and nothing else.
+ *.=debug -/var/log/debug
+
+ # Same, in a different place.
+ *.info;mail.none;authpriv.none -/dev/tty12
+
+ # The authpriv file has restricted access.
+ # 'fsync' the file after each line (hence the lack of a leading dash).
+ authpriv.* /var/log/secure
+
+ # Log all the mail messages in one place.
+ mail.* -/var/log/maillog
+"))
(define-record-type* <syslog-configuration>
syslog-configuration make-syslog-configuration
@@ -1540,37 +1566,12 @@ (define syslog-service-type
(umask mask)
pid))))
(stop #~(make-kill-destructor))))
+ (syslog-configuration)
(description "Run the syslog daemon, @command{syslogd}, which is
responsible for logging system messages.")))
-;; Snippet adapted from the GNU inetutils manual.
-(define %default-syslog.conf
- (plain-file "syslog.conf" "
- # Log all error messages, authentication messages of
- # level notice or higher and anything of level err or
- # higher to the console.
- # Don't log private authentication messages!
- *.alert;auth.notice;authpriv.none -/dev/console
-
- # Log anything (except mail) of level info or higher.
- # Don't log private authentication messages!
- *.info;mail.none;authpriv.none -/var/log/messages
-
- # Log \"debug\"-level entries and nothing else.
- *.=debug -/var/log/debug
-
- # Same, in a different place.
- *.info;mail.none;authpriv.none -/dev/tty12
-
- # The authpriv file has restricted access.
- # 'fsync' the file after each line (hence the lack of a leading dash).
- authpriv.* /var/log/secure
-
- # Log all the mail messages in one place.
- mail.* -/var/log/maillog
-"))
-
-(define* (syslog-service #:optional (config (syslog-configuration)))
+(define-deprecated (syslog-service #:optional (config (syslog-configuration)))
+ syslog-service-type
"Return a service that runs @command{syslogd} and takes
@var{<syslog-configuration>} as a parameter.
@@ -3294,7 +3295,7 @@ (define %base-services
(cons tty %default-console-font))
'("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
- (syslog-service)
+ (service syslog-service-type)
(service agetty-service-type (agetty-configuration
(extra-options '("-L")) ; no carrier detect
(term "vt100")
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 24fc6dbcae..20dc4ae735 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -93,7 +93,7 @@ (define %base-services/hurd
`(("/bin/sh" ,(file-append bash "/bin/sh"))
("/usr/bin/env" ,(file-append coreutils
"/bin/env"))))
- (syslog-service))
+ (service syslog-service-type))
(map (lambda (n)
(service hurd-getty-service-type
(hurd-getty-configuration
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index f7de0d6a09..8c7752df0e 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -367,7 +367,7 @@ (define* (%installation-services #:key (system (or (and=>
(normal-tty "tty6")
;; The usual services.
- (syslog-service)
+ (service syslog-service-type)
;; Use the Avahi daemon to discover substitute servers on the local
;; network. It can be faster than fetching from remote servers.
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 05/27] doc: kmscon-service-type: Use @defvar @-command.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
1e095fa1c35ed14562ffa5cb9581de2028c70484.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Use @defvar @-command for kmscon-service-type.
---
doc/guix.texi | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

Toggle diff (32 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index cab42d46e4..f4bdb6b211 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18342,18 +18342,17 @@ Base Services
@end table
@end deftp
-@deffn {Scheme Procedure} kmscon-service-type @var{config}
-Return a service to run @uref{https://www.freedesktop.org/wiki/Software/kmscon,kmscon}
-according to @var{config}, a @code{<kmscon-configuration>} object, which
-specifies the tty to run, among other things.
-@end deffn
+@defvar kmscon-service-type
+Type of the service that runs @uref{https://www.freedesktop.org/wiki/Software/kmscon,kmscon},
+which implements virtual console log-in. The value for this service is a
+@code{<kmscon-configuration>} object.
+@end defvar
@deftp {Data Type} kmscon-configuration
-This is the data type representing the configuration of Kmscon, which
-implements virtual console log-in.
+Data type representing the configuration of Kmscon, which specifies the
+tty to run, among other things.
@table @asis
-
@item @code{virtual-terminal}
The name of the console this Kmscon runs on---e.g., @code{"tty1"}.
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 11/27] services: tor: Deprecate 'tor-hidden-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
55d9d97eabbb72cf59713b31015e654d028d8623.1677350249.git.mirai@makinata.eu
Due to (now renamed) 'hidden-service' record type not being exported,
the only way hidden services could have worked is through the now deprecated
'tor-hidden-service' procedure which also had the issue that it can only
be used once since the returned service always had the same name.

This commit fixes the Tor service documentation and
deprecates 'tor-hidden-service' procedure, correcting some inconsistencies along the way.

* doc/guix.texi (Networking Services): Add examples for Tor hidden services.
Document <tor-hidden-service-configuration>. Remove mention of 'tor-hidden-service' procedure.
* gnu/services/networking.scm: Export tor-configuration-tor, tor-configuration-config-file,
tor-configuration-hidden-services, tor-configuration-socks-socket-type,
tor-configuration-control-socket-path, tor-hidden-service-configuration,
tor-hidden-service-configuration?, tor-hidden-service-configuration-name,
tor-hidden-service-configuration-mapping.
(<tor-configuration>)[control-socket?]: Rename accessor.
(<hidden-service>): Rename to ...
(<tor-hidden-service-configuration>): ... this.
(tor-configuration->torrc): Update record-type name.
(tor-activation): Ditto.
(tor-service-type): Tweak comment.
(tor-hidden-service-type): Remove variable.
(tor-hidden-service): Deprecate procedure.
---
doc/guix.texi | 55 +++++++++++++++++++++++--------------
gnu/services/networking.scm | 47 +++++++++++++++++--------------
2 files changed, 61 insertions(+), 41 deletions(-)

Toggle diff (199 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index f9ca809e47..eeb2efa488 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20494,11 +20494,21 @@ Networking Services
@cindex Tor
@defvar tor-service-type
-This is the type for a service that runs the @uref{https://torproject.org,
-Tor} anonymous networking daemon. The service is configured using a
+Type for a service that runs the @uref{https://torproject.org, Tor}
+anonymous networking daemon. The service is configured using a
@code{<tor-configuration>} record. By default, the Tor daemon runs as the
@code{tor} unprivileged user, which is a member of the @code{tor} group.
+In addition to adding Tor @dfn{hidden service}s records to the service
+configuration directly, this service can be extended by other services to add
+hidden services, as in this example:
+
+@lisp
+(simple-service 'my-extra-hidden-service tor-service-type
+ (list (tor-hidden-service-configuration
+ (name "extra-hidden-service")
+ (mapping '((80 "127.0.0.1:8080"))))))
+@end lisp
@end defvar
@deftp {Data Type} tor-configuration
@@ -20517,11 +20527,10 @@ Networking Services
syntax.
@item @code{hidden-services} (default: @code{'()})
-The list of @code{<hidden-service>} records to use. For any hidden service
-you include in this list, appropriate configuration to enable the hidden
-service will be automatically added to the default configuration file. You
-may conveniently create @code{<hidden-service>} records using the
-@code{tor-hidden-service} procedure described below.
+The list of @code{<tor-hidden-service-configuration>} records to use.
+For any hidden service you include in this list, appropriate
+configuration to enable the hidden service will be automatically added to
+the default configuration file.
@item @code{socks-socket-type} (default: @code{'tcp})
The default socket type that Tor should use for its SOCKS socket. This must
@@ -20546,26 +20555,32 @@ Networking Services
@end table
@end deftp
-@cindex hidden service
-@deffn {Scheme Procedure} tor-hidden-service @var{name} @var{mapping}
-Define a new Tor @dfn{hidden service} called @var{name} and implementing
-@var{mapping}. @var{mapping} is a list of port/host tuples, such as:
+@cindex hidden service, tor
+@deftp {Data Type} tor-hidden-service-configuration
+Data Type representing a Tor @dfn{hidden service} configuration.
+See @uref{https://www.torproject.org/docs/tor-hidden-service.html.en, the Tor
+project's documentation} for more information.
+
+@table @asis
+@item @code{name} (type: string)
+Name for the Tor @dfn{hidden service}.
+This creates a @file{/var/lib/tor/hidden-services/@var{name}} directory,
+where the @file{hostname} file contains the @samp{.onion} host name for
+the hidden service.
+
+@item @code{mapping} (type: list-of-list)
+List of host---@dfn{hidden-service} port mappings, such as:
@example
- '((22 "127.0.0.1:22")
- (80 "127.0.0.1:8080"))
+'((22 "127.0.0.1:22")
+ (80 "127.0.0.1:8080"))
@end example
In this example, port 22 of the hidden service is mapped to local port 22, and
port 80 is mapped to local port 8080.
-This creates a @file{/var/lib/tor/hidden-services/@var{name}} directory, where
-the @file{hostname} file contains the @code{.onion} host name for the hidden
-service.
-
-See @uref{https://www.torproject.org/docs/tor-hidden-service.html.en, the Tor
-project's documentation} for more information.
-@end deffn
+@end table
+@end deftp
The @code{(gnu services rsync)} module provides the following services:
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index dacf64c2d1..d6e1877ef5 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -138,7 +138,16 @@ (define-module (gnu services networking)
tor-configuration
tor-configuration?
- tor-hidden-service
+ tor-configuration-tor
+ tor-configuration-config-file
+ tor-configuration-hidden-services
+ tor-configuration-socks-socket-type
+ tor-configuration-control-socket-path
+ tor-hidden-service-configuration
+ tor-hidden-service-configuration?
+ tor-hidden-service-configuration-name
+ tor-hidden-service-configuration-mapping
+ tor-hidden-service ; deprecated
tor-service-type
network-manager-configuration
@@ -919,7 +928,7 @@ (define-record-type* <tor-configuration>
(default '()))
(socks-socket-type tor-configuration-socks-socket-type ; 'tcp or 'unix
(default 'tcp))
- (control-socket? tor-control-socket-path
+ (control-socket? tor-configuration-control-socket-path
(default #f)))
(define %tor-accounts
@@ -933,11 +942,11 @@ (define %tor-accounts
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
-(define-record-type <hidden-service>
- (hidden-service name mapping)
- hidden-service?
- (name hidden-service-name) ;string
- (mapping hidden-service-mapping)) ;list of port/address tuples
+(define-record-type <tor-hidden-service-configuration>
+ (tor-hidden-service-configuration name mapping)
+ tor-hidden-service-configuration?
+ (name tor-hidden-service-configuration-name) ;string
+ (mapping tor-hidden-service-configuration-mapping)) ;list of port/address tuples
(define (tor-configuration->torrc config)
"Return a 'torrc' file for CONFIG."
@@ -977,7 +986,7 @@ (define (tor-configuration->torrc config)
tcp-port host))
ports hosts)))
'#$(map (match-lambda
- (($ <hidden-service> name mapping)
+ (($ <tor-hidden-service-configuration> name mapping)
(cons name mapping)))
hidden-services))
@@ -1064,7 +1073,7 @@ (define (tor-activation config)
(chmod "/var/lib" #o755)
(for-each initialize
- '#$(map hidden-service-name
+ '#$(map tor-hidden-service-configuration-name
(tor-configuration-hidden-services config)))))
(define tor-service-type
@@ -1077,7 +1086,7 @@ (define tor-service-type
(service-extension activation-service-type
tor-activation)))
- ;; This can be extended with hidden services.
+ ;; This can be extended with tor hidden services.
(compose concatenate)
(extend (lambda (config services)
(tor-configuration
@@ -1090,15 +1099,8 @@ (define tor-service-type
"Run the @uref{https://torproject.org, Tor} anonymous
networking daemon.")))
-(define tor-hidden-service-type
- ;; A type that extends Tor with hidden services.
- (service-type (name 'tor-hidden-service)
- (extensions
- (list (service-extension tor-service-type list)))
- (description
- "Define a new Tor @dfn{hidden service}.")))
-
-(define (tor-hidden-service name mapping)
+(define-deprecated (tor-hidden-service name mapping)
+ #f
"Define a new Tor @dfn{hidden service} called @var{name} and implementing
@var{mapping}. @var{mapping} is a list of port/host tuples, such as:
@@ -1116,8 +1118,11 @@ (define (tor-hidden-service name mapping)
See @uref{https://www.torproject.org/docs/tor-hidden-service.html.en, the Tor
project's documentation} for more information."
- (service tor-hidden-service-type
- (hidden-service name mapping)))
+ (simple-service 'tor-hidden-service
+ tor-service-type
+ (list (tor-hidden-service-configuration
+ (name name)
+ (mapping mapping)))))
;;;
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 14/27] services: xorg: Deprecate 'screen-locker-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
9e2b1d0ac1148daefe99a9075fdd99b440f11f74.1677350249.git.mirai@makinata.eu
* doc/guix.texi (X Window): Replace 'screen-locker-service' with 'screen-locker-service-type'.
Document <screen-locker-configuration>.
* gnu/services/desktop.scm (desktop-services-for-system): Use screen-locker-service-type.
* gnu/services/xorg.scm: Export accessors for <screen-locker-configuration>.
(<screen-locker>): Rename to ...
(<screen-locker-configuration>): ... this.
(<screen-locker-configuration>)[empty?]: Rename to ...
(<screen-locker-configuration>)[allow-empty-password?]: ... this.
(screen-locker-pam-services): Update record name.
(screen-locker-setuid-programs): Update accessor name.
(screen-locker-service): Deprecate procedure.
---
doc/guix.texi | 32 ++++++++++++++++++++++-----
gnu/services/desktop.scm | 8 +++++--
gnu/services/xorg.scm | 47 +++++++++++++++++++++++++---------------
3 files changed, 62 insertions(+), 25 deletions(-)

Toggle diff (158 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 9f6f1f8794..05900d514a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -22221,18 +22221,38 @@ X Window
@end deffn
-@deffn {Scheme Procedure} screen-locker-service @var{package} [@var{program}]
-Add @var{package}, a package for a screen locker or screen saver whose
-command is @var{program}, to the set of setuid programs and add a PAM entry
-for it. For example:
+@defvar screen-locker-service-type
+Type for a service that adds a package for a screen locker or screen
+saver to the set of setuid programs and add a PAM entry for it. The
+value for this service is a @code{<screen-locker-configuration>} object.
+
+For example, to make XlockMore usable:
@lisp
-(screen-locker-service xlockmore "xlock")
+(service screen-locker-service-type
+ (screen-locker-configuration
+ "xlock" (file-append xlockmore "/bin/xlock") #f))
@end lisp
makes the good ol' XlockMore usable.
-@end deffn
+@end defvar
+@deftp {Data Type} screen-locker-configuration
+Data type representing the configuration of
+@code{screen-locker-service-type}.
+
+@table @asis
+@item @code{name} (type: string)
+Name of the screen locker.
+
+@item @code{program} (type: gexp)
+Path to the executable for the screen locker as a G-Expression.
+
+@item @code{allow-empty-password?} (type: boolean)
+Whether to allow empty passwords.
+
+@end table
+@end deftp
@node Printing Services
@subsection Printing Services
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index fe1f0fd20a..d4ac88311f 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1755,8 +1755,12 @@ (define* (desktop-services-for-system #:optional
(service sddm-service-type))
;; Screen lockers are a pretty useful thing and these are small.
- (screen-locker-service slock)
- (screen-locker-service xlockmore "xlock")
+ (service screen-locker-service-type
+ (screen-locker-configuration
+ "slock" (file-append slock "/bin/slock") #f))
+ (service screen-locker-service-type
+ (screen-locker-configuration
+ "xlock" (file-append xlockmore "/bin/xlock") #f))
;; Add udev rules for MTP devices so that non-root users can access
;; them.
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index 5f073d05d3..c4745cecf5 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -107,10 +107,13 @@ (define-module (gnu services xorg)
slim-service-type
- screen-locker
- screen-locker?
+ screen-locker-configuration
+ screen-locker-configuration?
+ screen-locker-configuration-name
+ screen-locker-configuration-program
+ screen-locker-configuration-allow-empty-password?
screen-locker-service-type
- screen-locker-service
+ screen-locker-service ; deprecated
localed-configuration
localed-configuration?
@@ -683,21 +686,30 @@ (define slim-service-type
;;; Screen lockers & co.
;;;
-(define-record-type <screen-locker>
- (screen-locker name program empty?)
+(define-record-type <screen-locker-configuration>
+ (screen-locker-configuration name program allow-empty-password?)
+ screen-locker-configuration?
+ (name screen-locker-configuration-name) ;string
+ (program screen-locker-configuration-program) ;gexp
+ (allow-empty-password?
+ screen-locker-configuration-allow-empty-password?)) ;Boolean
+
+(define-deprecated/public-alias
+ screen-locker
+ screen-locker-configuration)
+
+(define-deprecated/public-alias
screen-locker?
- (name screen-locker-name) ;string
- (program screen-locker-program) ;gexp
- (empty? screen-locker-allows-empty-passwords?)) ;Boolean
+ screen-locker-configuration?)
(define screen-locker-pam-services
(match-lambda
- (($ <screen-locker> name _ empty?)
+ (($ <screen-locker-configuration> name _ empty?)
(list (unix-pam-service name
#:allow-empty-passwords? empty?)))))
(define screen-locker-setuid-programs
- (compose list file-like->setuid-program screen-locker-program))
+ (compose list file-like->setuid-program screen-locker-configuration-program))
(define screen-locker-service-type
(service-type (name 'screen-locker)
@@ -711,10 +723,11 @@ (define screen-locker-service-type
the graphical server by making it setuid-root, so it can authenticate users,
and by creating a PAM service for it.")))
-(define* (screen-locker-service package
- #:optional
- (program (package-name package))
- #:key allow-empty-passwords?)
+(define-deprecated (screen-locker-service package
+ #:optional
+ (program (package-name package))
+ #:key allow-empty-passwords?)
+ screen-locker-service-type
"Add @var{package}, a package for a screen locker or screen saver whose
command is @var{program}, to the set of setuid programs and add a PAM entry
for it. For example:
@@ -725,9 +738,9 @@ (define* (screen-locker-service package
makes the good ol' XlockMore usable."
(service screen-locker-service-type
- (screen-locker program
- (file-append package "/bin/" program)
- allow-empty-passwords?)))
+ (screen-locker-configuration program
+ (file-append package "/bin/" program)
+ allow-empty-passwords?)))
;;;
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 03/27] services: base: Deprecate 'mingetty-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
1d46c585596ea41630eb7e388035ad45079e3ad3.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace mingetty-service with
mingetty-service-type.
* gnu/services/base.scm (mingetty-service): Deprecate procedure.
---
doc/guix.texi | 15 +++++++--------
gnu/services/base.scm | 5 +++--
gnu/system/install.scm | 7 ++++---
3 files changed, 14 insertions(+), 13 deletions(-)

Toggle diff (73 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index cb0d18ebdc..2225b25a47 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18123,18 +18123,17 @@ Base Services
@end table
@end deftp
-@deffn {Scheme Procedure} mingetty-service @var{config}
-Return a service to run mingetty according to @var{config}, a
-@code{<mingetty-configuration>} object, which specifies the tty to run, among
-other things.
-@end deffn
+@defvar mingetty-service-type
+Type of the service that runs Mingetty, an implementation of the
+virtual console log-in. The value for this service is a
+@code{<mingetty-configuration>} object.
+@end defvar
@deftp {Data Type} mingetty-configuration
-This is the data type representing the configuration of Mingetty, which
-provides the default implementation of virtual console log-in.
+Data type representing the configuration of Mingetty, which specifies
+the tty to run, among other things.
@table @asis
-
@item @code{tty}
The name of the console this Mingetty runs on---e.g., @code{"tty1"}.
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 8dfd92aacf..c762485054 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -173,7 +173,7 @@ (define-module (gnu services base)
mingetty-configuration-clear-on-logout?
mingetty-configuration-mingetty
mingetty-configuration?
- mingetty-service
+ mingetty-service ; deprecated
mingetty-service-type
%nscd-default-caches
@@ -1275,7 +1275,8 @@ (define mingetty-service-type
"Provide console login using the @command{mingetty}
program.")))
-(define* (mingetty-service config)
+(define-deprecated (mingetty-service config)
+ mingetty-service-type
"Return a service to run mingetty according to @var{config}, which specifies
the tty to run, among other things."
(service mingetty-service-type config))
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 8c7585f188..1b05a862c6 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -331,9 +331,10 @@ (define* (%installation-services #:key (system (or (and=>
Access documentation at any time by pressing Alt-F2.\x1b[0m
")))
(define (normal-tty tty)
- (mingetty-service (mingetty-configuration (tty tty)
- (auto-login "root")
- (login-pause? #t))))
+ (service mingetty-service-type
+ (mingetty-configuration (tty tty)
+ (auto-login "root")
+ (login-pause? #t))))
(define bare-bones-os
(load "examples/bare-bones.tmpl"))
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 09/27] services: base: Deprecate 'rngd-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f028db7c7ad8acb5d865607f753d12907ea012bc.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace rngd-service with rngd-service-type.
Document <rngd-configuration>.
* gnu/services/base.scm (<rngd-configuration>): Set default values from
the values in the now deprecated 'rngd-service' procedure.
(rngd-service): Deprecate procedure.
(rngd-service-type): Set default value.
---
doc/guix.texi | 25 ++++++++++++++++++-------
gnu/services/base.scm | 15 +++++++++------
2 files changed, 27 insertions(+), 13 deletions(-)

Toggle diff (81 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 283524245a..ec6f2d9c31 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18919,13 +18919,24 @@ Base Services
@end table
@end deftp
-@anchor{rngd-service}
-@deffn {Scheme Procedure} rngd-service [#:rng-tools @var{rng-tools}] @
- [#:device "/dev/hwrng"]
-Return a service that runs the @command{rngd} program from @var{rng-tools}
-to add @var{device} to the kernel's entropy pool. The service will fail if
-@var{device} does not exist.
-@end deffn
+@defvar rngd-service-type
+Type of the service that runs rng-tools rngd, whose value is a
+@code{<rngd-configuration>} object.
+@end defvar
+
+@deftp {Data Type} rngd-configuration
+Data type representing the configuration of rngd.
+
+@table @asis
+@item @code{rng-tools} (default: @code{rng-tools}) (type: file-like)
+Package object of the rng-tools rngd.
+
+@item @code{device} (default: @var{"/dev/hwrng"}) (type: string)
+Path of the device to add to the kernel's entropy pool. The service
+will fail if @var{device} does not exist.
+
+@end table
+@end deftp
@anchor{pam-limits-service}
@cindex session limits
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b183cf58c1..1423ab6767 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -239,7 +239,7 @@ (define-module (gnu services base)
rngd-configuration
rngd-configuration?
rngd-service-type
- rngd-service
+ rngd-service ; deprecated
kmscon-configuration
kmscon-configuration?
@@ -662,8 +662,10 @@ (define urandom-seed-service-type
(define-record-type* <rngd-configuration>
rngd-configuration make-rngd-configuration
rngd-configuration?
- (rng-tools rngd-configuration-rng-tools) ;file-like
- (device rngd-configuration-device)) ;string
+ (rng-tools rngd-configuration-rng-tools ;file-like
+ (default rng-tools))
+ (device rngd-configuration-device ;string
+ (default "/dev/hwrng")))
(define rngd-service-type
(shepherd-service-type
@@ -682,12 +684,13 @@ (define rngd-service-type
(provision '(trng))
(start #~(make-forkexec-constructor '#$rngd-command))
(stop #~(make-kill-destructor))))
+ (rngd-configuration)
(description "Run the @command{rngd} random number generation daemon to
supply entropy to the kernel's pool.")))
-(define* (rngd-service #:key
- (rng-tools rng-tools)
- (device "/dev/hwrng"))
+(define-deprecated (rngd-service #:key (rng-tools rng-tools)
+ (device "/dev/hwrng"))
+ rngd-service-type
"Return a service that runs the @command{rngd} program from @var{rng-tools}
to add @var{device} to the kernel's entropy pool. The service will fail if
@var{device} does not exist."
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 12/27] services: ssh: Deprecate 'lsh-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
2f88379eaa173fea422efe9a60175d73bbc4123e.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Networking Services): Remove mention of lsh-service.
Document lsh-service-type and lsh-service-configuration.
* gnu/services/ssh.scm (<lsh-configuration>): Set default values based
on the now deprecated 'lsh-service' procedure.
(lsh-service-type): Set default value.
(lsh-service): Deprecate procedure.
---
doc/guix.texi | 98 +++++++++++++++++++++++++++++---------------
gnu/services/ssh.scm | 68 ++++++++++++++++++------------
2 files changed, 106 insertions(+), 60 deletions(-)

Toggle diff (214 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index eeb2efa488..50ac49e65f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20740,41 +20740,71 @@ Networking Services
@cindex SSH
@cindex SSH server
-@deffn {Scheme Procedure} lsh-service [#:host-key "/etc/lsh/host-key"] @
- [#:daemonic? #t] [#:interfaces '()] [#:port-number 22] @
- [#:allow-empty-passwords? #f] [#:root-login? #f] @
- [#:syslog-output? #t] [#:x11-forwarding? #t] @
- [#:tcp/ip-forwarding? #t] [#:password-authentication? #t] @
- [#:public-key-authentication? #t] [#:initialize? #t]
-Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}.
-@var{host-key} must designate a file containing the host key, and readable
-only by root.
-
-When @var{daemonic?} is true, @command{lshd} will detach from the
-controlling terminal and log its output to syslogd, unless one sets
-@var{syslog-output?} to false. Obviously, it also makes lsh-service
-depend on existence of syslogd service. When @var{pid-file?} is true,
-@command{lshd} writes its PID to the file called @var{pid-file}.
-
-When @var{initialize?} is true, automatically create the seed and host key
-upon service activation if they do not exist yet. This may take long and
-require interaction.
-
-When @var{initialize?} is false, it is up to the user to initialize the
-randomness generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create
-a key pair with the private key stored in file @var{host-key} (@pxref{lshd
-basics,,, lsh, LSH Manual}).
-
-When @var{interfaces} is empty, lshd listens for connections on all the
-network interfaces; otherwise, @var{interfaces} must be a list of host names
-or addresses.
-
-@var{allow-empty-passwords?} specifies whether to accept log-ins with empty
-passwords, and @var{root-login?} specifies whether to accept log-ins as
-root.
+@defvar lsh-service-type
+Type of the service that runs the GNU@tie{}lsh secure shell (SSH)
+daemon, @command{lshd}. The value for this service is a
+@code{<lsh-configuration>} object.
+@end defvar
-The other options should be self-descriptive.
-@end deffn
+@deftp {Data Type} lsh-configuration
+Data type representing the configuration of @command{lshd}.
+
+@table @asis
+@item @code{lsh} (default: @code{lsh}) (type: file-like)
+The package object of the GNU@tie{}lsh secure shell (SSH) daemon.
+
+@item @code{daemonic?} (default: @code{#t}) (type: boolean)
+Whether to detach from the controlling terminal.
+
+@item @code{host-key} (default: @code{"/etc/lsh/host-key"}) (type: string)
+File containing the @dfn{host key}. This file must be readable by
+root only.
+
+@item @code{interfaces} (default: @code{()}) (type: list)
+List of host names or addresses that @command{lshd} will listen on.
+If empty, @command{lshd} listens for connections on all the network
+interfaces.
+
+@item @code{port-number} (default: @code{22}) (type: integer)
+Port to listen on.
+
+@item @code{allow-empty-passwords?} (default: @code{#f}) (type: boolean)
+Whether to accept log-ins with empty passwords.
+
+@item @code{root-login?} (default: @code{#f}) (type: boolean)
+Whether to accept log-ins as root.
+
+@item @code{syslog-output?} (default: @code{#t}) (type: boolean)
+Whether to log @command{lshd} standard output to syslogd.
+This will make the service depend on the existence of a syslogd service.
+
+@item @code{pid-file?} (default: @code{#f}) (type: boolean)
+When @code{#t}, @command{lshd} writes its PID to the file specified in
+@var{pid-file}.
+
+@item @code{pid-file} (default: @code{"/var/run/lshd.pid"}) (type: string)
+File that @command{lshd} will write its PID to.
+
+@item @code{x11-forwarding?} (default: @code{#t}) (type: boolean)
+Whether to enable X11 forwarding.
+
+@item @code{tcp/ip-forwarding?} (default: @code{#t}) (type: boolean)
+Whether to enable TCP/IP forwarding.
+
+@item @code{password-authentication?} (default: @code{#t}) (type: boolean)
+Whether to accept log-ins using password authentication.
+
+@item @code{public-key-authentication?} (default: @code{#t}) (type: boolean)
+Whether to accept log-ins using public key authentication.
+
+@item @code{initialize?} (default: @code{#t}) (type: boolean)
+When @code{#f}, it is up to the user to initialize the randomness
+generator (@pxref{lsh-make-seed,,, lsh, LSH Manual}), and to create
+a key pair with the private key stored in file @var{host-key}
+(@pxref{lshd basics,,, lsh, LSH Manual}).
+
+@end table
+@end deftp
@cindex SSH
@cindex SSH server
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 7b038e6ac6..3baa55731d 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -42,7 +42,7 @@ (define-module (gnu services ssh)
#:use-module (ice-9 vlist)
#:export (lsh-configuration
lsh-configuration?
- lsh-service
+ lsh-service ; deprecated
lsh-service-type
openssh-configuration
@@ -74,20 +74,34 @@ (define-record-type* <lsh-configuration>
lsh-configuration?
(lsh lsh-configuration-lsh
(default lsh))
- (daemonic? lsh-configuration-daemonic?)
- (host-key lsh-configuration-host-key)
- (interfaces lsh-configuration-interfaces)
- (port-number lsh-configuration-port-number)
- (allow-empty-passwords? lsh-configuration-allow-empty-passwords?)
- (root-login? lsh-configuration-root-login?)
- (syslog-output? lsh-configuration-syslog-output?)
- (pid-file? lsh-configuration-pid-file?)
- (pid-file lsh-configuration-pid-file)
- (x11-forwarding? lsh-configuration-x11-forwarding?)
- (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?)
- (password-authentication? lsh-configuration-password-authentication?)
- (public-key-authentication? lsh-configuration-public-key-authentication?)
- (initialize? lsh-configuration-initialize?))
+ (daemonic? lsh-configuration-daemonic?
+ (default #t))
+ (host-key lsh-configuration-host-key
+ (default "/etc/lsh/host-key"))
+ (interfaces lsh-configuration-interfaces
+ (default '()))
+ (port-number lsh-configuration-port-number
+ (default 22))
+ (allow-empty-passwords? lsh-configuration-allow-empty-passwords?
+ (default #f))
+ (root-login? lsh-configuration-root-login?
+ (default #f))
+ (syslog-output? lsh-configuration-syslog-output?
+ (default #t))
+ (pid-file? lsh-configuration-pid-file?
+ (default #f))
+ (pid-file lsh-configuration-pid-file
+ (default "/var/run/lshd.pid"))
+ (x11-forwarding? lsh-configuration-x11-forwarding?
+ (default #t))
+ (tcp/ip-forwarding? lsh-configuration-tcp/ip-forwarding?
+ (default #t))
+ (password-authentication? lsh-configuration-password-authentication?
+ (default #t))
+ (public-key-authentication? lsh-configuration-public-key-authentication?
+ (default #t))
+ (initialize? lsh-configuration-initialize?
+ (default #t)))
(define %yarrow-seed
"/var/spool/lsh/yarrow-seed-file")
@@ -203,19 +217,20 @@ (define (lsh-pam-services config)
(lsh-configuration-allow-empty-passwords? config))))
(define lsh-service-type
- (service-type (name 'lsh)
- (description
- "Run the GNU@tie{}lsh secure shell (SSH) daemon,
+ (service-type
+ (name 'lsh)
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ lsh-shepherd-service)
+ (service-extension pam-root-service-type
+ lsh-pam-services)
+ (service-extension activation-service-type
+ lsh-activation)))
+ (description "Run the GNU@tie{}lsh secure shell (SSH) daemon,
@command{lshd}.")
- (extensions
- (list (service-extension shepherd-root-service-type
- lsh-shepherd-service)
- (service-extension pam-root-service-type
- lsh-pam-services)
- (service-extension activation-service-type
- lsh-activation)))))
+ (default-value (lsh-configuration))))
-(define* (lsh-service #:key
+(define-deprecated (lsh-service #:key
(lsh lsh)
(daemonic? #t)
(host-key "/etc/lsh/host-key")
@@ -231,6 +246,7 @@ (define* (lsh-service #:key
(password-authentication? #t)
(public-key-authentication? #t)
(initialize? #t))
+ lsh-service-type
"Run the @command{lshd} program from @var{lsh} to listen on port @var{port-number}.
@var{host-key} must designate a file containing the host key, and readable
only by root.
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 17/27] services: desktop: Deprecate 'accountsservice-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
c7360e9597bd8e1821cccbe4002c433af8729a34.1677350249.git.mirai@makinata.eu
* 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.
---
doc/guix.texi | 15 +++++++--------
gnu/services/desktop.scm | 8 +++++---
gnu/tests/lightdm.scm | 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)

Toggle diff (78 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 2d69f94aa0..1831528ef3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23420,18 +23420,17 @@ Desktop Services
@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 cd3d8efa55..24d9d9f0c3 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -124,7 +124,7 @@ (define-module (gnu services desktop)
fontconfig-file-system-service
accountsservice-service-type
- accountsservice-service
+ accountsservice-service ; deprecated
cups-pk-helper-service-type
sane-service-type
@@ -1281,7 +1281,9 @@ (define accountsservice-service-type
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
@@ -1799,7 +1801,7 @@ (define* (desktop-services-for-system #:optional
(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-module (gnu tests lightdm)
(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)
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 24/27] services: lirc: Deprecate 'lirc-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f25067f771fd09c074d2d25272ceddc3d73fc3ea.1677350250.git.mirai@makinata.eu
* doc/guix.texi (Miscellaneous Services): Replace 'lirc-service' with 'lirc-service-type'.
Document <lirc-configuration>.
* gnu/services/lirc.scm (<lirc-configuration>): Set default values based on
the arguments from the now deprecated 'lirc-service' procedure.
(lirc-service-type): Set default value.
(lirc-service): Deprecate procedure.
---
doc/guix.texi | 40 +++++++++++++++++++++++++++-------------
gnu/services/lirc.scm | 18 ++++++++++++------
2 files changed, 39 insertions(+), 19 deletions(-)

Toggle diff (109 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 880972d112..466c6c98c9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37718,24 +37718,38 @@ Miscellaneous Services
@end table
@end deftp
-@cindex lirc
-@subsubheading Lirc Service
+@cindex LIRC
+@subsubheading LIRC Service
The @code{(gnu services lirc)} module provides the following service.
-@deffn {Scheme Procedure} lirc-service [#:lirc lirc] @
- [#:device #f] [#:driver #f] [#:config-file #f] @
- [#:extra-options '()]
-Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that
-decodes infrared signals from remote controls.
+@defvar lirc-service-type
+Type for a service that runs @url{http://www.lirc.org, LIRC}, a daemon
+that decodes infrared signals from remote controls.
-Optionally, @var{device}, @var{driver} and @var{config-file}
-(configuration file name) may be specified. See @command{lircd} manual
-for details.
+The value for this service is a @code{<lirc-configuration>} object.
+@end defvar
-Finally, @var{extra-options} is a list of additional command-line options
-passed to @command{lircd}.
-@end deffn
+@deftp {Data Type} lirc-configuration
+Data type representing the configuration of @command{lircd}.
+
+@table @asis
+@item @code{lirc} (default: @code{lirc}) (type: file-like)
+Package object for @command{lirc}.
+
+@item @code{device} (default: @code{#f}) (type: string)
+@itemx @code{driver} (default: @code{#f}) (type: string)
+@itemx @code{config-file} (default: @code{#f}) (type: string-or-file-like)
+TODO. See @command{lircd} manual for details.
+
+@item @code{extra-options} (default: @code{'()}) (type: list-of-string)
+Additional command-line options to pass to @command{lircd}.
+
+@end table
+@end deftp
+
+@c TODO: Document <lirc-configuration>, preferably by refactoring this to use
+@c define-configuration and generating documentation from it.
@cindex spice
@subsubheading Spice Service
diff --git a/gnu/services/lirc.scm b/gnu/services/lirc.scm
index 492d77defa..92784b65ca 100644
--- a/gnu/services/lirc.scm
+++ b/gnu/services/lirc.scm
@@ -21,12 +21,13 @@ (define-module (gnu services lirc)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (gnu packages lirc)
+ #:use-module (guix deprecation)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (ice-9 match)
#:export (lirc-configuration
lirc-configuation?
- lirc-service
+ lirc-service ; deprecated
lirc-service-type))
;;; Commentary:
@@ -40,9 +41,12 @@ (define-record-type* <lirc-configuration>
lirc-configuation?
(lirc lirc-configuration-lirc ;file-like
(default lirc))
- (device lirc-configuration-device) ;string
- (driver lirc-configuration-driver) ;string
- (config-file lirc-configuration-file) ;string | file-like object
+ (device lirc-configuration-device ;string
+ (default #f))
+ (driver lirc-configuration-driver ;string
+ (default #f))
+ (config-file lirc-configuration-file ;string | file-like object
+ (default #f))
(extra-options lirc-configuration-options ;list of strings
(default '())))
@@ -81,11 +85,13 @@ (define lirc-service-type
(service-extension activation-service-type
(const %lirc-activation))))
(description "Run LIRC, a daemon that decodes infrared signals
-from remote controls.")))
+from remote controls.")
+ (default-value (lirc-configuration))))
-(define* (lirc-service #:key (lirc lirc)
+(define-deprecated (lirc-service #:key (lirc lirc)
device driver config-file
(extra-options '()))
+ lirc-service-type
"Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that
decodes infrared signals from remote controls.
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 19/27] services: desktop: Deprecate 'udisks-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
bb7698cfb4410a477c13de4a5dea121a1c7f914d.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Desktop Services): Replace 'udisks-service' with 'udisks-service-type'.
Document <udisks-configuration>.
* gnu/packages/kde-multimedia.scm (k3b)[description]: Replace 'udisks-service' with 'udisks-service-type'.
* gnu/services/desktop.scm (udisks-service-type): Set default value.
(udisks-service): Deprecate procedure.
(desktop-services-for-system): Use udisks-service-type.
---
doc/guix.texi | 21 +++++++++++++++++----
gnu/packages/kde-multimedia.scm | 4 ++--
gnu/services/desktop.scm | 10 ++++++----
3 files changed, 25 insertions(+), 10 deletions(-)

Toggle diff (92 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4ed77d6715..2c9f55cd19 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23529,9 +23529,10 @@ Desktop Services
@end table
@end deftp
-@deffn {Scheme Procedure} udisks-service [#:udisks @var{udisks}]
-Return a service for @uref{https://udisks.freedesktop.org/docs/latest/,
-UDisks}, a @dfn{disk management} daemon that provides user interfaces
+@defvar udisks-service-type
+Type for the service that runs
+@uref{https://udisks.freedesktop.org/docs/latest/, UDisks},
+a @dfn{disk management} daemon that provides user interfaces
with notifications and ways to mount/unmount disks. Programs that talk
to UDisks include the @command{udisksctl} command, part of UDisks, and
GNOME Disks. Note that Udisks relies on the @command{mount} command, so
@@ -23539,7 +23540,19 @@ Desktop Services
system profile. For example if you want to be able to mount NTFS
file-systems in read and write fashion, you'll need to have
@code{ntfs-3g} installed system-wide.
-@end deffn
+
+The value for this service is a @code{<udisks-configuration>} object.
+@end defvar
+
+@deftp {Data Type} udisks-configuration
+Data type representing the configuration for @code{udisks-service-type}.
+
+@table @asis
+@item @code{udisks} (default: @code{udisks}) (type: file-like)
+Package object for UDisks.
+
+@end table
+@end deftp
@defvar colord-service-type
This is the type of the service that runs @command{colord}, a system
diff --git a/gnu/packages/kde-multimedia.scm b/gnu/packages/kde-multimedia.scm
index d635eca26d..e3de6db432 100644
--- a/gnu/packages/kde-multimedia.scm
+++ b/gnu/packages/kde-multimedia.scm
@@ -460,8 +460,8 @@ (define-public k3b
from .WAV and .MP3 audio files, configuring external programs and configuring
devices.
-The @code{udisks-service} should be enabled for @command{k3b} to discover the
-available CD drives.")
+The @code{udisks-service-type} should be enabled for @command{k3b} to discover
+the available CD drives.")
(license ;; GPL for programs, FDL for documentation
(list license:gpl2+ license:fdl1.2+))))
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 24d9d9f0c3..701c64a75d 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -95,7 +95,7 @@ (define-module (gnu services desktop)
udisks-configuration
udisks-configuration?
- udisks-service
+ udisks-service ; deprecated
udisks-service-type
colord-service-type
@@ -931,9 +931,11 @@ (define udisks-service-type
(description "Run UDisks, a @dfn{disk management} daemon
that provides user interfaces with notifications and ways to mount/unmount
disks. Programs that talk to UDisks include the @command{udisksctl} command,
-part of UDisks, and GNOME Disks."))))
+part of UDisks, and GNOME Disks.")
+ (default-value (udisks-configuration)))))
-(define* (udisks-service #:key (udisks udisks))
+(define-deprecated (udisks-service #:key (udisks udisks))
+ udisks-service-type
"Return a service for @uref{http://udisks.freedesktop.org/docs/latest/,
UDisks}, a @dfn{disk management} daemon that provides user interfaces with
notifications and ways to mount/unmount disks. Programs that talk to UDisks
@@ -1799,7 +1801,7 @@ (define* (desktop-services-for-system #:optional
;; The D-Bus clique.
(service avahi-service-type)
- (udisks-service)
+ (service udisks-service-type)
(service upower-service-type)
(service accountsservice-service-type)
(service cups-pk-helper-service-type)
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 04/27] services: base: Deprecate 'agetty-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
9e10d3396829a145398ae0e762d85e2a2c3fa3ec.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace agetty-service with
agetty-service-type.
* gnu/services/base.scm (agetty-service): Deprecate procedure.
* gnu/system/examples/beaglebone-black.tmpl
(operating-system)[services]: Use agetty-service-type.
---
doc/guix.texi | 17 ++++++++---------
gnu/services/base.scm | 5 +++--
gnu/system/examples/beaglebone-black.tmpl | 14 +++++++-------
3 files changed, 18 insertions(+), 18 deletions(-)

Toggle diff (79 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 2225b25a47..cab42d46e4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18160,19 +18160,18 @@ Base Services
@end table
@end deftp
-@deffn {Scheme Procedure} agetty-service @var{config}
-Return a service to run agetty according to @var{config}, an
-@code{<agetty-configuration>} object, which specifies the tty to run,
-among other things.
-@end deffn
+@defvar agetty-service-type
+Type of the service that runs agetty, which implements virtual and
+serial console log-in. The value for this service is a
+@code{<agetty-configuration>} object.
+@end defvar
@deftp {Data Type} agetty-configuration
-This is the data type representing the configuration of agetty, which
-implements virtual and serial console log-in. See the @code{agetty(8)}
-man page for more information.
+Data type representing the configuration of agetty, which specifies the
+tty to run, among other things@footnote{See the @code{agetty(8)}
+man page for more information.}.
@table @asis
-
@item @code{tty}
The name of the console this agetty runs on, as a string---e.g.,
@code{"ttyS0"}. This argument is optional, it will default to
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index c762485054..c5fd0cf5b4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -162,7 +162,7 @@ (define-module (gnu services base)
agetty-configuration
agetty-configuration?
- agetty-service
+ agetty-service ; deprecated
agetty-service-type
mingetty-configuration
@@ -1210,7 +1210,8 @@ (define agetty-service-type
"Provide console login using the @command{agetty}
program.")))
-(define* (agetty-service config)
+(define-deprecated (agetty-service config)
+ agetty-service-type
"Return a service to run agetty according to @var{config}, which specifies
the tty to run, among other things."
(service agetty-service-type config))
diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl
index 40d0a76a37..18bbb2723c 100644
--- a/gnu/system/examples/beaglebone-black.tmpl
+++ b/gnu/system/examples/beaglebone-black.tmpl
@@ -48,10 +48,10 @@
(services (append (list (service dhcp-client-service-type)
;; mingetty does not work on serial lines.
;; Use agetty with board-specific serial parameters.
- (agetty-service
- (agetty-configuration
- (extra-options '("-L"))
- (baud-rate "115200")
- (term "vt100")
- (tty "ttyO0"))))
- %base-services)))
+ (service agetty-service-type
+ (agetty-configuration
+ (extra-options '("-L"))
+ (baud-rate "115200")
+ (term "vt100")
+ (tty "ttyO0"))))
+ %base-services)))
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 08/27] services: base: Deprecate 'udev-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
09d5091f0636e7fd4eb5d63184e0fb5ca962227c.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace udev-service with udev-service-type.
Document <udev-configuration>. Use @defun @-commands for udev-rules-service,
udev-rule and file->udev-rule.
* gnu/services/base.scm (udev-service): Deprecate procedure.
* gnu/system/install.scm (%installation-services): Use udev-service-type.
---
doc/guix.texi | 52 +++++++++++++++++++++++++++---------------
gnu/services/base.scm | 5 ++--
gnu/system/install.scm | 4 +++-
3 files changed, 39 insertions(+), 22 deletions(-)

Toggle diff (132 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 5072bcc11f..283524245a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18675,15 +18675,30 @@ Base Services
@end table
@end deftp
-@deffn {Scheme Procedure} udev-service [#:udev @var{eudev} #:rules @code{'()}]
-Run @var{udev}, which populates the @file{/dev} directory dynamically.
-udev rules can be provided as a list of files through the @var{rules}
-variable. The procedures @code{udev-rule}, @code{udev-rules-service}
-and @code{file->udev-rule} from @code{(gnu services base)} simplify the
-creation of such rule files.
-@end deffn
+@defvar udev-service-type
+Type of the service that runs udev, a service which populates the
+@file{/dev} directory dynamically, whose value is a
+@code{<udev-configuration>} object.
+
+This service type can be @emph{extended} using procedures
+@code{udev-rules-service} along with @code{file->udev-rule} or
+@code{udev-rule} which simplify the process of writing udev rules.
+@end defvar
-@deffn {Scheme Procedure} udev-rule [@var{file-name} @var{contents}]
+@deftp {Data Type} udev-configuration
+Data type representing the configuration of udev.
+
+@table @asis
+@item @code{udev} (default: @code{eudev}) (type: file-like)
+Package object of the udev service.
+
+@item @code{rules} (default: @var{'()}) (type: list-of-file-like)
+List of file-like objects denoting udev-rule files.
+
+@end table
+@end deftp
+
+@defun udev-rule @var{file-name} @var{contents}
Return a udev-rule file named @var{file-name} containing the rules
defined by the @var{contents} literal.
@@ -18699,18 +18714,17 @@ Base Services
"ATTR@{product@}==\"Example\", "
"RUN+=\"/path/to/script\"")))
@end lisp
-@end deffn
+@end defun
-@deffn {Scheme Procedure} udev-rules-service [@var{name} @var{rules}] @
- [#:groups @var{groups}]
-Return a service that extends @code{udev-service-type } with @var{rules}
+@defun udev-rules-service @var{name} @var{rules} [#:groups '()]
+Return a service that extends @code{udev-service-type} with @var{rules}
and @code{account-service-type} with @var{groups} as system groups.
This works by creating a singleton service type
@code{@var{name}-udev-rules}, of which the returned service is an
instance.
-Here we show how it can be used to extend @code{udev-service-type} with the
-previously defined rule @code{%example-udev-rule}.
+Here we show how it can be used to extend @code{udev-service-type}
+with the previously defined rule @code{%example-udev-rule}.
@lisp
(operating-system
@@ -18719,11 +18733,11 @@ Base Services
(cons (udev-rules-service 'usb-thing %example-udev-rule)
%desktop-services)))
@end lisp
-@end deffn
+@end defun
-@deffn {Scheme Procedure} file->udev-rule [@var{file-name} @var{file}]
-Return a udev file named @var{file-name} containing the rules defined
-within @var{file}, a file-like object.
+@defun file->udev-rule @var{file-name} @var{file}
+Return a udev-rule file named @var{file-name} containing the rules
+defined within @var{file}, a file-like object.
The following example showcases how we can use an existing rule file.
@@ -18743,7 +18757,7 @@ Base Services
(sha256
(base32 "0lmmagpyb6xsq6zcr2w1cyx9qmjqmajkvrdbhjx32gqf1d9is003"))))))
@end lisp
-@end deffn
+@end defun
Additionally, Guix package definitions can be included in @var{rules} in
order to extend the udev rules with the definitions found under their
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 45e6c5f448..b183cf58c1 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -150,7 +150,7 @@ (define-module (gnu services base)
udev-configuration?
udev-configuration-rules
udev-service-type
- udev-service
+ udev-service ; deprecated
udev-rule
file->udev-rule
udev-rules-service
@@ -2351,7 +2351,8 @@ (define udev-service-type
directory dynamically. Get extra rules from the packages listed in the
@code{rules} field of its value, @code{udev-configuration} object.")))
-(define* (udev-service #:key (udev eudev) (rules '()))
+(define-deprecated (udev-service #:key (udev eudev) (rules '()))
+ udev-service-type
"Run @var{udev}, which populates the @file{/dev} directory dynamically. Get
extra rules from the packages listed in @var{rules}."
(service udev-service-type
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 8c7752df0e..dd965f312b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -388,7 +388,9 @@ (define* (%installation-services #:key (system (or (and=>
;; Start udev so that useful device nodes are available.
;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
;; regulations-compliant WiFi access.
- (udev-service #:rules (list lvm2 crda))
+ (service udev-service-type
+ (udev-configuration
+ (rules (list lvm2 crda))))
;; Add the 'cow-store' service, which users have to start manually
;; since it takes the installation directory as an argument.
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 23/27] services: vpn: Deprecate 'openvpn-client-service' & 'openvpn-server-service' procedures.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
7ae425083b38612fb7bf17ab532b5774dbc70fc0.1677350250.git.mirai@makinata.eu
* doc/guix.texi (VPN Services): Replace 'openvpn-client-service' & 'openvpn-server-service' procedures
with their service-type counterparts.
* gnu/services/vpn.scm (openvpn-client-service, openvpn-server-service): Deprecate procedure.
(openvpn-server-service-type, openvpn-client-service-type): Set default value.
---
doc/guix.texi | 22 ++++++++++++----------
gnu/services/vpn.scm | 19 +++++++++++++------
2 files changed, 25 insertions(+), 16 deletions(-)

Toggle diff (89 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 282c6ce276..880972d112 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31851,20 +31851,22 @@ VPN Services
It provides a @emph{client} service for your machine to connect to a
VPN, and a @emph{server} service for your machine to host a VPN@.
+Both @code{openvpn-client-service-type} and
+@code{openvpn-server-service-type} can be run simultaneously.
-@deffn {Scheme Procedure} openvpn-client-service @
- [#:config (openvpn-client-configuration)]
+@defvar openvpn-client-service-type
+Type of the service that runs @command{openvpn}, a VPN daemon, as a client.
-Return a service that runs @command{openvpn}, a VPN daemon, as a client.
-@end deffn
-
-@deffn {Scheme Procedure} openvpn-server-service @
- [#:config (openvpn-server-configuration)]
+The value for this service is a @code{<openvpn-client-configuration>}
+object.
+@end defvar
-Return a service that runs @command{openvpn}, a VPN daemon, as a server.
+@defvar openvpn-server-service-type
+Type of the service that runs @command{openvpn}, a VPN daemon, as a server.
-Both can be run simultaneously.
-@end deffn
+The value for this service is a @code{<openvpn-server-configuration>}
+object.
+@end defvar
@c %automatically generated documentation
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index 4103f89ecf..a884d71eb2 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -39,11 +39,12 @@ (define-module (gnu services vpn)
#:use-module (guix records)
#:use-module (guix gexp)
#:use-module (guix i18n)
+ #:use-module (guix deprecation)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
- #:export (openvpn-client-service
- openvpn-server-service
+ #:export (openvpn-client-service ; deprecated
+ openvpn-server-service ; deprecated
openvpn-client-service-type
openvpn-server-service-type
openvpn-client-configuration
@@ -531,7 +532,8 @@ (define openvpn-server-service-type
(service-extension activation-service-type
(const %openvpn-activation))))
(description "Run the OpenVPN server, which allows you to
-@emph{host} a @acronym{VPN, virtual private network}.")))
+@emph{host} a @acronym{VPN, virtual private network}.")
+ (default-value (openvpn-server-configuration))))
(define openvpn-client-service-type
(service-type (name 'openvpn-client)
@@ -544,12 +546,17 @@ (define openvpn-client-service-type
(const %openvpn-activation))))
(description
"Run the OpenVPN client service, which allows you to connect
-to an existing @acronym{VPN, virtual private network}.")))
+to an existing @acronym{VPN, virtual private network}.")
+ (default-value (openvpn-client-configuration))))
-(define* (openvpn-client-service #:key (config (openvpn-client-configuration)))
+(define-deprecated
+ (openvpn-client-service #:key (config (openvpn-client-configuration)))
+ openvpn-client-service-type
(service openvpn-client-service-type config))
-(define* (openvpn-server-service #:key (config (openvpn-server-configuration)))
+(define-deprecated
+ (openvpn-server-service #:key (config (openvpn-server-configuration)))
+ openvpn-server-service-type
(service openvpn-server-service-type config))
(define (generate-openvpn-server-documentation)
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 18/27] services: dbus: Deprecate 'polkit-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f58c81ebfe5db5dc4400b89a9f383096ab1134cf.1677350249.git.mirai@makinata.eu
* 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.
---
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(-)

Toggle diff (89 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 1831528ef3..4ed77d6715 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23432,16 +23432,20 @@ Desktop Services
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{<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
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 @@ (define-module (gnu services dbus)
#: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 @@ (define-module (gnu services dbus)
polkit-configuration
polkit-configuration?
polkit-service-type
- polkit-service))
+ polkit-service)) ; deprecated
;;;
;;; D-Bus.
@@ -404,7 +405,8 @@ (define polkit-service-type
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 @@ (define %docker-os
(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 @@ (define %libvirt-os
(simple-operating-system
(service dhcp-client-service-type)
(dbus-service)
- (polkit-service)
+ (service polkit-service-type)
(service libvirt-service-type)))
(define (run-libvirt-test)
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 10/27] services: base: Deprecate 'pam-limits-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
dfe7a382916396d1de4f6f2e8eeccf548a8857f5.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Base Services): Replace pam-limits-service with pam-limits-service-type.
* gnu/packages/benchmark.scm (python-locust)[description]: Update index anchor to manual.
* gnu/services/base.scm (pam-limits-service-type): Accept both lists and
file-like objects for compatibility.
(pam-limits-service): Deprecate procedure.
---
doc/guix.texi | 18 ++++++++---------
gnu/packages/benchmark.scm | 2 +-
gnu/services/base.scm | 41 +++++++++++++++++++++++++++-----------
3 files changed, 39 insertions(+), 22 deletions(-)

Toggle diff (157 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index ec6f2d9c31..f9ca809e47 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18938,7 +18938,6 @@ Base Services
@end table
@end deftp
-@anchor{pam-limits-service}
@cindex session limits
@cindex ulimit
@cindex priority
@@ -18946,19 +18945,20 @@ Base Services
@cindex jackd
@cindex nofile
@cindex open file descriptors
-@deffn {Scheme Procedure} pam-limits-service [#:limits @code{'()}]
-
-Return a service that installs a configuration file for the
+@anchor{pam-limits-service-type}
+@defvar pam-limits-service-type
+Type of the service that installs a configuration file for the
@uref{http://linux-pam.org/Linux-PAM-html/sag-pam_limits.html,
-@code{pam_limits} module}. The procedure optionally takes a list of
-@code{pam-limits-entry} values, which can be used to specify
+@code{pam_limits} module}. The value for this service type is
+a list of @code{pam-limits-entry} values, which can be used to specify
@code{ulimit} limits and @code{nice} priority limits to user sessions.
+By default, the value is the empty list.
The following limits definition sets two hard and soft limits for all
login sessions of users in the @code{realtime} group:
@lisp
-(pam-limits-service
+(service pam-limits-service-type
(list
(pam-limits-entry "@@realtime" 'both 'rtprio 99)
(pam-limits-entry "@@realtime" 'both 'memlock 'unlimited)))
@@ -18973,7 +18973,7 @@ Base Services
descriptors that can be used:
@lisp
-(pam-limits-service
+(service pam-limits-service-type
(list
(pam-limits-entry "*" 'both 'nofile 100000)))
@end lisp
@@ -18984,7 +18984,7 @@ Base Services
else the users would be prevented from login in. For more information
about the Pluggable Authentication Module (PAM) limits, refer to the
@samp{pam_limits} man page from the @code{linux-pam} package.
-@end deffn
+@end defvar
@defvar greetd-service-type
@uref{https://git.sr.ht/~kennylevinsen/greetd, @code{greetd}} is a minimal and
diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm
index 33e2466da9..fd8513f41d 100644
--- a/gnu/packages/benchmark.scm
+++ b/gnu/packages/benchmark.scm
@@ -458,7 +458,7 @@ (define-public python-locust
Note: Locust will complain if the available open file descriptors limit for
the user is too low. To raise such limit on a Guix System, refer to
-@samp{info guix --index-search=pam-limits-service}.")
+@samp{info guix --index-search=pam-limits-service-type}.")
(license license:expat)))
(define-public interbench
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 1423ab6767..bda38abae3 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -40,7 +40,7 @@
(define-module (gnu services base)
#:use-module (guix store)
#:use-module (guix deprecation)
- #:autoload (guix diagnostics) (warning &fix-hint)
+ #:autoload (guix diagnostics) (warning report-error &fix-hint)
#:autoload (guix i18n) (G_)
#:use-module (guix combinators)
#:use-module (gnu services)
@@ -246,7 +246,7 @@ (define-module (gnu services base)
kmscon-service-type
pam-limits-service-type
- pam-limits-service
+ pam-limits-service ; deprecated
greetd-service-type
greetd-configuration
@@ -1584,17 +1584,13 @@ (define-deprecated (syslog-service #:optional (config (syslog-configuration)))
(define pam-limits-service-type
- (let ((security-limits
- ;; Create /etc/security containing the provided "limits.conf" file.
- (lambda (limits-file)
- `(("security/limits.conf"
- ,limits-file))))
- (pam-extension
+ (let ((pam-extension
(lambda (pam)
(let ((pam-limits (pam-entry
(control "required")
(module "pam_limits.so")
- (arguments '("conf=/etc/security/limits.conf")))))
+ (arguments
+ '("conf=/etc/security/limits.conf")))))
(if (member (pam-service-name pam)
'("login" "greetd" "su" "slim" "gdm-password" "sddm"
"sudo" "sshd"))
@@ -1602,7 +1598,26 @@ (define pam-limits-service-type
(inherit pam)
(session (cons pam-limits
(pam-service-session pam))))
- pam)))))
+ pam))))
+
+ ;; XXX: Using file-like objects is deprecated, use lists instead.
+ ;; This is to be reduced into the list? case when the deprecated
+ ;; code gets removed.
+ ;; Create /etc/security containing the provided "limits.conf" file.
+ (security-limits
+ (match-lambda
+ ((? file-like? obj)
+ (warning (G_ "Using file-like value for 'pam-limits-service-type'
+is deprecated~%"))
+ obj)
+ ((? list? lst)
+ `(("security/limits.conf"
+ ,(plain-file "limits.conf"
+ (string-join (map pam-limits-entry->string lst)
+ "\n" 'suffix)))))
+ (_ (report-error
+ (G_ "invalid input for 'pam-limits-service-type'~%"))))))
+
(service-type
(name 'limits)
(extensions
@@ -1612,9 +1627,11 @@ (define pam-limits-service-type
(description
"Install the specified resource usage limits by populating
@file{/etc/security/limits.conf} and using the @code{pam_limits}
-authentication module."))))
+authentication module.")
+ (default-value '()))))
-(define* (pam-limits-service #:optional (limits '()))
+(define-deprecated (pam-limits-service #:optional (limits '()))
+ pam-limits-service-type
"Return a service that makes selected programs respect the list of
pam-limits-entry specified in LIMITS via pam_limits.so."
(service pam-limits-service-type
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 26/27] services: dict: Deprecate 'dicod-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
78a98543d37badae1619ffd46b47f1e866606fd1.1677350250.git.mirai@makinata.eu
* doc/guix.texi (Miscellaneous Services): Remove 'dicod-service' mention.
* gnu/services/dict.scm (dicod-service): Deprecate procedure.
---
doc/guix.texi | 17 ++---------------
gnu/services/dict.scm | 6 ++++--
2 files changed, 6 insertions(+), 17 deletions(-)

Toggle diff (70 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7aa9f3a5e8..a40d88455b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37814,19 +37814,6 @@ Miscellaneous Services
implementation of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
@end defvar
-@deffn {Scheme Procedure} dicod-service [#:config (dicod-configuration)]
-Return a service that runs the @command{dicod} daemon, an implementation
-of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
-
-The optional @var{config} argument specifies the configuration for
-@command{dicod}, which should be a @code{<dicod-configuration>} object, by
-default it serves the GNU Collaborative International Dictionary of English.
-
-You can add @command{open localhost} to your @file{~/.dico} file to make
-@code{localhost} the default server for @command{dico} client
-(@pxref{Initialization File,,, dico, GNU Dico Manual}).
-@end deffn
-
@deftp {Data Type} dicod-configuration
Data type representing the configuration of dicod.
@@ -37890,10 +37877,10 @@ Miscellaneous Services
Dictionary of English using the @code{gcide} package.
@end defvar
-The following is an example @code{dicod-service} configuration.
+The following is an example @code{dicod-service-type} configuration.
@lisp
-(dicod-service #:config
+(service dicod-service-type
(dicod-configuration
(handlers (list (dicod-handler
(name "wordnet")
diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm
index 35253a0077..5a61085316 100644
--- a/gnu/services/dict.scm
+++ b/gnu/services/dict.scm
@@ -19,6 +19,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu services dict)
+ #:use-module (guix deprecation)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix modules)
@@ -34,7 +35,7 @@ (define-module (gnu services dict)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
- #:export (dicod-service
+ #:export (dicod-service ; deprecated
dicod-service-type
dicod-configuration
dicod-handler
@@ -202,7 +203,8 @@ (define dicod-service-type
implements the standard DICT protocol supported by clients such as
@command{dico} and GNOME Dictionary.")))
-(define* (dicod-service #:key (config (dicod-configuration)))
+(define-deprecated (dicod-service #:key (config (dicod-configuration)))
+ dicod-service-type
"Return a service that runs the @command{dicod} daemon, an implementation
of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 20/27] services: desktop: Deprecate 'geoclue-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
37d20c1e196b03cfc432586ec58a569e65c98b9f.1677350250.git.mirai@makinata.eu
* doc/guix.texi (Desktop Services): Replace 'geoclue-service' with 'geoclue-service-type'.
* gnu/services/desktop.scm (<geoclue-configuration>): Set default values
based on the values from the now deprecated geoclue-service procedure.
(geoclue-service): Deprecate procedure.
(desktop-services-for-system): Use geoclue-service-type.
---
doc/guix.texi | 26 ++++++++---------
gnu/services/desktop.scm | 61 ++++++++++++++++++++++++----------------
2 files changed, 48 insertions(+), 39 deletions(-)

Toggle diff (139 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 2c9f55cd19..f9fb891df0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23625,20 +23625,18 @@ Desktop Services
know the user's location.
@end defvar
-@deffn {Scheme Procedure} geoclue-service [#:colord @var{colord}] @
- [#:whitelist '()] @
- [#:wifi-geolocation-url "https://location.services.mozilla.com/v1/geolocate?key=geoclue"] @
- [#:submit-data? #f]
- [#:wifi-submission-url "https://location.services.mozilla.com/v1/submit?key=geoclue"] @
- [#:submission-nick "geoclue"] @
- [#:applications %standard-geoclue-applications]
-Return a service that runs the GeoClue location service. This service
-provides a D-Bus interface to allow applications to request access to a
-user's physical location, and optionally to add information to online
-location databases. See
-@uref{https://wiki.freedesktop.org/www/Software/GeoClue/, the GeoClue
-web site} for more information.
-@end deffn
+@defvar geoclue-service-type
+Type for the service that runs the
+@url{https://wiki.freedesktop.org/www/Software/GeoClue/, GeoClue}
+location service. This service provides a D-Bus interface to allow
+applications to request access to a user's physical location, and
+optionally to add information to online location databases.
+
+The value for this service is a @code{<geoclue-configuration>} object.
+@end defvar
+
+@c TODO: Document <geoclue-configuration>, preferably by refactoring this to use
+@c define-configuration and generating documentation from it.
@deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}] @
[@w{#:auto-enable? #f}]
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 701c64a75d..c5212ee9aa 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -104,7 +104,7 @@ (define-module (gnu services desktop)
geoclue-configuration
geoclue-configuration?
%standard-geoclue-applications
- geoclue-service
+ geoclue-service ; deprecated
geoclue-service-type
bluetooth-service-type
@@ -304,19 +304,6 @@ (define upower-service-type
;;; GeoClue D-Bus service.
;;;
-;; TODO: Export.
-(define-record-type* <geoclue-configuration>
- geoclue-configuration make-geoclue-configuration
- geoclue-configuration?
- (geoclue geoclue-configuration-geoclue
- (default geoclue))
- (whitelist geoclue-configuration-whitelist)
- (wifi-geolocation-url geoclue-configuration-wifi-geolocation-url)
- (submit-data? geoclue-configuration-submit-data?)
- (wifi-submission-url geoclue-configuration-wifi-submission-url)
- (submission-nick geoclue-configuration-submission-nick)
- (applications geoclue-configuration-applications))
-
(define* (geoclue-application name #:key (allowed? #t) system? (users '()))
"Configure default GeoClue access permissions for an application. NAME is
the Desktop ID of the application, without the .desktop part. If ALLOWED? is
@@ -336,6 +323,28 @@ (define %standard-geoclue-applications
(geoclue-application "epiphany" #:system? #f)
(geoclue-application "firefox" #:system? #f)))
+;; TODO: Use define-configuration and export accessors.
+(define-record-type* <geoclue-configuration>
+ geoclue-configuration make-geoclue-configuration
+ geoclue-configuration?
+ (geoclue geoclue-configuration-geoclue
+ (default geoclue))
+ (whitelist geoclue-configuration-whitelist
+ (default '()))
+ (wifi-geolocation-url
+ geoclue-configuration-wifi-geolocation-url
+ ;; Mozilla geolocation service:
+ (default "https://location.services.mozilla.com/v1/geolocate?key=geoclue"))
+ (submit-data? geoclue-configuration-submit-data?
+ (default #f))
+ (wifi-submission-url
+ geoclue-configuration-wifi-submission-url
+ (default "https://location.services.mozilla.com/v1/submit?key=geoclue"))
+ (submission-nick geoclue-configuration-submission-nick
+ (default "geoclue"))
+ (applications geoclue-configuration-applications
+ (default %standard-geoclue-applications)))
+
(define* (geoclue-configuration-file config)
"Return a geoclue configuration file."
(plain-file "geoclue.conf"
@@ -383,16 +392,18 @@ (define geoclue-service-type
access to a user's physical location, and optionally to add information to
online location databases.")))
-(define* (geoclue-service #:key (geoclue geoclue)
- (whitelist '())
- (wifi-geolocation-url
- ;; Mozilla geolocation service:
- "https://location.services.mozilla.com/v1/geolocate?key=geoclue")
- (submit-data? #f)
- (wifi-submission-url
- "https://location.services.mozilla.com/v1/submit?key=geoclue")
- (submission-nick "geoclue")
- (applications %standard-geoclue-applications))
+(define-deprecated
+ (geoclue-service #:key (geoclue geoclue)
+ (whitelist '())
+ (wifi-geolocation-url
+ ;; Mozilla geolocation service:
+ "https://location.services.mozilla.com/v1/geolocate?key=geoclue")
+ (submit-data? #f)
+ (wifi-submission-url
+ "https://location.services.mozilla.com/v1/submit?key=geoclue")
+ (submission-nick "geoclue")
+ (applications %standard-geoclue-applications))
+ geoclue-service-type
"Return a service that runs the @command{geoclue} location service. This
service provides a D-Bus interface to allow applications to request access to
a user's physical location, and optionally to add information to online
@@ -1806,7 +1817,7 @@ (define* (desktop-services-for-system #:optional
(service accountsservice-service-type)
(service cups-pk-helper-service-type)
(service colord-service-type)
- (geoclue-service)
+ (service geoclue-service-type)
(service polkit-service-type)
(service elogind-service-type)
(dbus-service)
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 21/27] services: desktop: Deprecate 'bluetooth-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
456e1b687000caec23aa261c2f68339e64df810d.1677350250.git.mirai@makinata.eu
* doc/guix.texi (Desktop Services): Remove mention of 'bluetooth-service'.
* gnu/services/desktop.scm (bluetooth-service): Deprecate procedure.
---
doc/guix.texi | 9 ---------
gnu/services/desktop.scm | 5 +++--
2 files changed, 3 insertions(+), 11 deletions(-)

Toggle diff (45 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index f9fb891df0..7bae5717df 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23638,15 +23638,6 @@ Desktop Services
@c TODO: Document <geoclue-configuration>, preferably by refactoring this to use
@c define-configuration and generating documentation from it.
-@deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}] @
- [@w{#:auto-enable? #f}]
-Return a service that runs the @command{bluetoothd} daemon, which
-manages all the Bluetooth devices and provides a number of D-Bus
-interfaces. When AUTO-ENABLE? is true, the bluetooth controller is
-powered automatically at boot, which can be useful when using a
-bluetooth keyboard or mouse.
-@end deffn
-
@defvar bluetooth-service-type
This is the type for the @uref{https://bluez.org/, Linux Bluetooth Protocol
Stack} (BlueZ) system, which generates the @file{/etc/bluetooth/main.conf}
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index c5212ee9aa..202bf1de80 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -110,7 +110,7 @@ (define-module (gnu services desktop)
bluetooth-service-type
bluetooth-configuration
bluetooth-configuration?
- bluetooth-service
+ bluetooth-service ; deprecated
elogind-configuration
elogind-configuration?
@@ -845,7 +845,8 @@ (define bluetooth-service-type
(description "Run the @command{bluetoothd} daemon, which manages all the
Bluetooth devices and provides a number of D-Bus interfaces.")))
-(define* (bluetooth-service #:key (bluez bluez) (auto-enable? #f))
+(define-deprecated (bluetooth-service #:key (bluez bluez) (auto-enable? #f))
+ bluetooth-service-type
"Return a service that runs the @command{bluetoothd} daemon, which manages
all the Bluetooth devices and provides a number of D-Bus interfaces. When
AUTO-ENABLE? is true, the bluetooth controller is powered automatically at
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 16/27] services: elogind-configuration: Do not ignore 'handle-hibernate-key' by default.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f35da1db144203b9a6f92933853887766b6358a3.1677350249.git.mirai@makinata.eu
* gnu/services/desktop.scm (<elogind-configuration>)[handle-hibernate-key]: Set default value to 'hibernate.
---
gnu/services/desktop.scm | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index bc8f4eb026..cd3d8efa55 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -964,11 +964,7 @@ (define-record-type* <elogind-configuration> elogind-configuration
(handle-suspend-key elogind-handle-suspend-key
(default 'suspend))
(handle-hibernate-key elogind-handle-hibernate-key
- ;; (default 'hibernate)
- ;; XXX Ignore it for now, since we don't
- ;; yet handle resume-from-hibernation in
- ;; our initrd.
- (default 'ignore))
+ (default 'hibernate))
(handle-lid-switch elogind-handle-lid-switch
(default 'suspend))
(handle-lid-switch-docked elogind-handle-lid-switch-docked
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 27/27] services: dbus: Deprecate 'dbus-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
2b272d95354b74a2aefeaa16a8e8485035cc3ff4.1677350250.git.mirai@makinata.eu
* 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.
---
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(-)

Toggle diff (163 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a40d88455b..2dc3ca7d1f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23293,24 +23293,37 @@ Desktop Services
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{<dbus-configuration>} 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 @@ (define-module (gnu services dbus)
#:export (dbus-configuration
dbus-configuration?
dbus-root-service-type
- dbus-service
+ dbus-service ; deprecated
wrapped-dbus-service
polkit-configuration
@@ -245,7 +245,8 @@ (define dbus-root-service-type
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 202bf1de80..2d39b4f9d1 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1821,7 +1821,7 @@ (define* (desktop-services-for-system #:optional
(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 @@ (define* (%installation-services #:key (system (or (and=>
(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 @@ (define %avahi-os
(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-module (gnu tests docker)
(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 @@ (define minimal-desktop-services
(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-module (gnu tests virtualization)
(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)))
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 15/27] services: desktop: Deprecate 'elogind-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
f33464dd5506686fec27c977ae1cd859285bc7b0.1677350249.git.mirai@makinata.eu
* 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.
---
doc/guix.texi | 166 ++++++++++++++++++++++++---------------
gnu/services/desktop.scm | 7 +-
gnu/tests/lightdm.scm | 2 +-
3 files changed, 106 insertions(+), 69 deletions(-)

Toggle diff (230 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 05900d514a..2d69f94aa0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23312,77 +23312,113 @@ Desktop Services
@var{services} must be equal to @code{(list avahi)}.
@end deffn
-@deffn {Scheme Procedure} elogind-service [#:config @var{config}]
-Return a service that runs the @code{elogind} login and
-seat management daemon. @uref{https://github.com/elogind/elogind,
-Elogind} exposes a D-Bus interface that can be used to know which users
+@subsubheading Elogind
+
+@uref{https://github.com/elogind/elogind, Elogind} is a login and seat
+management daemon that also handles most system-level power events for a
+computer, for example suspending the system when a lid is closed, or
+shutting it down when the power button is pressed.
+
+It also provides a D-Bus interface that can be used to know which users
are logged in, know what kind of sessions they have open, suspend the
system, inhibit system suspend, reboot the system, and other tasks.
-Elogind handles most system-level power events for a computer, for
-example suspending the system when a lid is closed, or shutting it down
-when the power button is pressed.
+@defvar elogind-service-type
+Type of the service that runs @command{elogind}, a login and
+seat management daemon. The value for this service is a
+@code{<elogind-configuration>} object.
+@end defvar
-The @var{config} keyword argument specifies the configuration for
-elogind, and should be the result of an @code{(elogind-configuration
-(@var{parameter} @var{value})...)} invocation. Available parameters and
-their default values are:
+@c TODO: field descriptions. This is best done by refactoring
+@c elogind-configuration to use define-configuration which embeds the
+@c descriptions in the code and then use configuration->documentation.
+@deftp {Data Type} elogind-configuration
+Data type representing the configuration of @command{elogind}.
+
+@table @asis
+@item @code{elogind} (default: @code{elogind}) (type: file-like)
+...
+
+@item @code{kill-user-processes?} (default: @code{#f}) (type: boolean)
+...
+
+@item @code{kill-only-users} (default: @code{'()}) (type: list)
+...
+
+@item @code{kill-exclude-users} (default: @code{'("root")}) (type: list-of-string)
+...
+
+@item @code{inhibit-delay-max-seconds} (default: @code{5}) (type: integer)
+...
+
+@item @code{handle-power-key} (default: @code{'poweroff}) (type: symbol)
+...
+
+@item @code{handle-suspend-key} (default: @code{'suspend}) (type: symbol)
+...
+
+@item @code{handle-hibernate-key} (default: @code{'hibernate}) (type: symbol)
+...
+
+@item @code{handle-lid-switch} (default: @code{'suspend}) (type: symbol)
+...
+
+@item @code{handle-lid-switch-docked} (default: @code{'ignore}) (type: symbol)
+...
+
+@item @code{handle-lid-switch-external-power} (default: @code{*unspecified*}) (type: symbol)
+...
+
+@item @code{power-key-ignore-inhibited?} (default: @code{#f}) (type: boolean)
+...
+
+@item @code{suspend-key-ignore-inhibited?} (default: @code{#f}) (type: boolean)
+...
+
+@item @code{hibernate-key-ignore-inhibited?} (default: @code{#f}) (type: boolean)
+...
+
+@item @code{lid-switch-ignore-inhibited?} (default: @code{#t}) (type: boolean)
+...
+
+@item @code{holdoff-timeout-seconds} (default: @code{30}) (type: integer)
+...
+
+@item @code{idle-action} (default: @code{'ignore}) (type: symbol)
+...
+
+@item @code{idle-action-seconds} (default: @code{(* 30 60)}) (type: integer)
+...
+
+@item @code{runtime-directory-size-percent} (default: @code{10}) (type: integer)
+...
+
+@item @code{runtime-directory-size} (default: @code{#f}) (type: integer)
+...
+
+@item @code{remove-ipc?} (default: @code{#t}) (type: boolean)
+...
+
+@item @code{suspend-state} (default: @code{'("mem" "standby" "freeze")}) (type: list)
+...
+
+@item @code{suspend-mode} (default: @code{'()}) (type: list)
+...
+
+@item @code{hibernate-state} (default: @code{'("disk")}) (type: list)
+...
+
+@item @code{hibernate-mode} (default: @code{'("platform" "shutdown")}) (type: list)
+...
+
+@item @code{hybrid-sleep-state} (default: @code{'("disk")}) (type: list)
+...
+
+@item @code{hybrid-sleep-mode} (default: @code{'("suspend" "platform" "shutdown")}) (type: list)
+...
-@table @code
-@item kill-user-processes?
-@code{#f}
-@item kill-only-users
-@code{()}
-@item kill-exclude-users
-@code{("root")}
-@item inhibit-delay-max-seconds
-@code{5}
-@item handle-power-key
-@code{poweroff}
-@item handle-suspend-key
-@code{suspend}
-@item handle-hibernate-key
-@code{hibernate}
-@item handle-lid-switch
-@code{suspend}
-@item handle-lid-switch-docked
-@code{ignore}
-@item handle-lid-switch-external-power
-@code{*unspecified*}
-@item power-key-ignore-inhibited?
-@code{#f}
-@item suspend-key-ignore-inhibited?
-@code{#f}
-@item hibernate-key-ignore-inhibited?
-@code{#f}
-@item lid-switch-ignore-inhibited?
-@code{#t}
-@item holdoff-timeout-seconds
-@code{30}
-@item idle-action
-@code{ignore}
-@item idle-action-seconds
-@code{(* 30 60)}
-@item runtime-directory-size-percent
-@code{10}
-@item runtime-directory-size
-@code{#f}
-@item remove-ipc?
-@code{#t}
-@item suspend-state
-@code{("mem" "standby" "freeze")}
-@item suspend-mode
-@code{()}
-@item hibernate-state
-@code{("disk")}
-@item hibernate-mode
-@code{("platform" "shutdown")}
-@item hybrid-sleep-state
-@code{("disk")}
-@item hybrid-sleep-mode
-@code{("suspend" "platform" "shutdown")}
@end table
-@end deffn
+@end deftp
@deffn {Scheme Procedure} accountsservice-service @
[#:accountsservice @var{accountsservice}]
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index d4ac88311f..bc8f4eb026 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -114,7 +114,7 @@ (define-module (gnu services desktop)
elogind-configuration
elogind-configuration?
- elogind-service
+ elogind-service ; deprecated
elogind-service-type
%gdm-file-system
@@ -1216,7 +1216,8 @@ (define elogind-service-type
their session types (graphical, console, remote, etc.). It can also clean up
after users when they log out.")))
-(define* (elogind-service #:key (config (elogind-configuration)))
+(define-deprecated (elogind-service #:key (config (elogind-configuration)))
+ elogind-service-type
"Return a service that runs the @command{elogind} login and seat management
service. The @command{elogind} service integrates with PAM to allow other
system components to know the set of logged-in users as well as their session
@@ -1807,7 +1808,7 @@ (define* (desktop-services-for-system #:optional
(service colord-service-type)
(geoclue-service)
(service polkit-service-type)
- (elogind-service)
+ (service elogind-service-type)
(dbus-service)
(service ntp-service-type)
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 @@ (define minimal-desktop-services
(service upower-service-type)
(accountsservice-service)
(service polkit-service-type)
- (elogind-service)
+ (service elogind-service-type)
(dbus-service)
x11-socket-directory-service))
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 22/27] services: mail: Deprecate 'dovecot-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
2bfcd388d8f900b67d95f5e0708d5c9bc406e899.1677350250.git.mirai@makinata.eu
* 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.
---
doc/guix.texi | 13 +++++++------
gnu/services/mail.scm | 9 ++++++---
gnu/tests/mail.scm | 20 ++++++++++----------
3 files changed, 23 insertions(+), 19 deletions(-)

Toggle diff (99 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7bae5717df..282c6ce276 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -24701,9 +24701,10 @@ Mail Services
@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{<dovecot-configuration>} object.
+@end defvar
By default, Dovecot does not need much configuration; the default
configuration object created by @code{(dovecot-configuration)} will
@@ -24718,9 +24719,9 @@ Mail Services
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 @@ (define-module (gnu services mail)
#: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 @@ (define-module (gnu services mail)
#: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 @@ (define dovecot-service-type
(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 @@ (define %test-exim
(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."
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:58
[PATCH 25/27] services: spice: Deprecate 'spice-vdagent-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
0645b758f5fb1d1b371ecd6fe57cb8ad18d768f7.1677350250.git.mirai@makinata.eu
* doc/guix.texi (Miscellaneous Services): Replace 'spice-vdagent-service' with
'spice-vdagent-service-type'. Document <spice-vdagent-configuration>.
* gnu/services/spice.scm (spice-vdagent-service): Deprecate procedure.
---
doc/guix.texi | 25 ++++++++++++++++++-------
gnu/services/spice.scm | 7 ++++---
2 files changed, 22 insertions(+), 10 deletions(-)

Toggle diff (71 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 466c6c98c9..7aa9f3a5e8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -37751,16 +37751,27 @@ Miscellaneous Services
@c TODO: Document <lirc-configuration>, preferably by refactoring this to use
@c define-configuration and generating documentation from it.
-@cindex spice
-@subsubheading Spice Service
+@cindex SPICE
+@subsubheading SPICE Service
The @code{(gnu services spice)} module provides the following service.
-@deffn {Scheme Procedure} spice-vdagent-service [#:spice-vdagent]
-Returns a service that runs @url{https://www.spice-space.org,VDAGENT}, a daemon
-that enables sharing the clipboard with a vm and setting the guest display
-resolution when the graphical console window resizes.
-@end deffn
+@defvar spice-vdagent-service-type
+Type of the service that runs @url{https://www.spice-space.org, VDAGENT},
+a daemon that enables sharing the clipboard with a vm and setting the
+guest display resolution when the graphical console window resizes.
+@end defvar
+
+@deftp {Data Type} spice-vdagent-configuration
+Data type representing the configuration of
+@code{spice-vdagent-service-type}.
+
+@table @asis
+@item @code{spice-vdagent} (default: @code{spice-vdagent}) (type: file-like)
+Package object for VDAGENT.
+
+@end table
+@end deftp
@cindex inputattach
@subsubheading inputattach Service
diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
index e5ec46b9b5..b8d2f8486e 100644
--- a/gnu/services/spice.scm
+++ b/gnu/services/spice.scm
@@ -21,12 +21,13 @@ (define-module (gnu services spice)
#:use-module (gnu packages spice)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
+ #:use-module (guix deprecation)
#:use-module (guix gexp)
#:use-module (guix records)
#:export (spice-vdagent-configuration
spice-vdagent-configuration?
spice-vdagent-service-type
- spice-vdagent-service))
+ spice-vdagent-service)) ; deprecated
(define-record-type* <spice-vdagent-configuration>
spice-vdagent-configuration make-spice-vdagent-configuration
@@ -74,8 +75,8 @@ (define spice-vdagent-service-type
from the @code{spice-vdagent} package to enable window resizing and clipboard
sharing for @acronym{VM, virtual machine} guests.")))
-(define* (spice-vdagent-service
- #:optional (config (spice-vdagent-configuration)))
+(define-deprecated (spice-vdagent-service
+ #:optional (config (spice-vdagent-configuration)))
"Start the @command{vdagentd} and @command{vdagent} daemons
from @var{spice-vdagent} to enable guest window resizing and
clipboard sharing."
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 13/27] services: ssh: Deprecate 'dropbear-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
bc004a672af8fbc67bcb37f09989cb23d964d785.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Networking Services): Replace 'dropbear-service' with
'dropbear-service-type'.
* gnu/services/ssh.scm (dropbear-service): Deprecate procedure.
---
doc/guix.texi | 17 ++++++++---------
gnu/services/ssh.scm | 6 ++++--
2 files changed, 12 insertions(+), 11 deletions(-)

Toggle diff (58 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 50ac49e65f..9f6f1f8794 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20998,19 +20998,18 @@ Networking Services
@end table
@end deftp
-@deffn {Scheme Procedure} dropbear-service [@var{config}]
-Run the @uref{https://matt.ucc.asn.au/dropbear/dropbear.html,Dropbear SSH
-daemon} with the given @var{config}, a @code{<dropbear-configuration>}
-object.
+@defvar dropbear-service-type
+Type of the service that runs the
+@url{https://matt.ucc.asn.au/dropbear/dropbear.html, Dropbear SSH daemon},
+whose value is a @code{<dropbear-configuration>} object.
-For example, to specify a Dropbear service listening on port 1234, add
-this call to the operating system's @code{services} field:
+For example, to specify a Dropbear service listening on port 1234:
@lisp
-(dropbear-service (dropbear-configuration
- (port-number 1234)))
+(service dropbear-service-type (dropbear-configuration
+ (port-number 1234)))
@end lisp
-@end deffn
+@end defvar
@deftp {Data Type} dropbear-configuration
This data type represents the configuration of a Dropbear SSH daemon.
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 3baa55731d..b76544c1a8 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -52,7 +52,7 @@ (define-module (gnu services ssh)
dropbear-configuration
dropbear-configuration?
dropbear-service-type
- dropbear-service
+ dropbear-service ; deprecated
autossh-configuration
autossh-configuration?
@@ -717,7 +717,9 @@ (define dropbear-service-type
dropbear-activation)))
(default-value (dropbear-configuration))))
-(define* (dropbear-service #:optional (config (dropbear-configuration)))
+(define-deprecated (dropbear-service #:optional
+ (config (dropbear-configuration)))
+ dropbear-service-type
"Run the @uref{https://matt.ucc.asn.au/dropbear/dropbear.html,Dropbear SSH
daemon} with the given @var{config}, a @code{<dropbear-configuration>}
object."
--
2.39.1
B
B
Bruno Victal wrote on 25 Feb 2023 19:57
[PATCH 06/27] services: base: Deprecate 'nscd-service' procedure.
(address . 61789@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
0da8efddd398e31d71fd879745c9f3da7fd735db.1677350249.git.mirai@makinata.eu
* doc/guix.texi (Application Setup): Compress @cindex entries.
(Base Services): Compress @cindex entries. Delete %nscd-default-configuration.
Replace 'nscd-service' with 'nscd-service-type'.
* gnu/services/base.scm (%nscd-default-configuration): Deprecate variable.
(nscd-service): Deprecate procedure.
* gnu/system/install.scm (%installation-services): Use nscd-service-type.
---
doc/guix.texi | 25 +++++++------------------
gnu/services/base.scm | 12 +++++++-----
gnu/system/install.scm | 5 +++--
3 files changed, 17 insertions(+), 25 deletions(-)

Toggle diff (126 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index f4bdb6b211..86edc58b40 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1976,8 +1976,7 @@ Application Setup
@cindex name service switch, glibc
@cindex NSS (name service switch), glibc
-@cindex nscd (name service caching daemon)
-@cindex name service caching daemon (nscd)
+@cindex @abbr{nscd, name service cache daemon}
When using Guix on a foreign distro, we @emph{strongly recommend} that
the system run the GNU C library's @dfn{name service cache daemon},
@command{nscd}, which should be listening on the
@@ -18390,20 +18389,17 @@ Base Services
@end table
@end deftp
-@cindex name service cache daemon
-@cindex nscd
-@deffn {Scheme Procedure} nscd-service [@var{config}] [#:glibc glibc] @
- [#:name-services '()]
-Return a service that runs the libc name service cache daemon (nscd) with the
-given @var{config}---an @code{<nscd-configuration>} object. @xref{Name
-Service Switch}, for an example.
+@cindex @abbr{nscd, name service cache daemon}
+@defvar nscd-service-type
+Type of the service that runs the libc @abbr{nscd, name service cache
+daemon}, whose value is a @code{<nscd-configuration>} object.
For convenience, the Shepherd service for nscd provides the following actions:
@table @code
@item invalidate
-@cindex cache invalidation, nscd
@cindex nscd, cache invalidation
+@cindex cache invalidation, nscd
This invalidate the given cache. For instance, running:
@example
@@ -18417,17 +18413,10 @@ Base Services
Running @command{herd statistics nscd} displays information about nscd usage
and caches.
@end table
-
-@end deffn
-
-@defvar %nscd-default-configuration
-This is the default @code{<nscd-configuration>} value (see below) used
-by @code{nscd-service}. It uses the caches defined by
-@code{%nscd-default-caches}; see below.
@end defvar
@deftp {Data Type} nscd-configuration
-This is the data type representing the name service cache daemon (nscd)
+Data type representing the @abbr{nscd, name service cache daemon}
configuration.
@table @asis
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index c5fd0cf5b4..423a38e39d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -177,7 +177,7 @@ (define-module (gnu services base)
mingetty-service-type
%nscd-default-caches
- %nscd-default-configuration
+ %nscd-default-configuration ; deprecated
nscd-configuration
nscd-configuration?
@@ -186,7 +186,7 @@ (define-module (gnu services base)
nscd-cache?
nscd-service-type
- nscd-service
+ nscd-service ; deprecated
syslog-configuration
syslog-configuration?
@@ -1343,7 +1343,8 @@ (define %nscd-default-caches
(check-files? #t) ;check /etc/services changes
(persistent? #t))))
-(define %nscd-default-configuration
+(define-deprecated %nscd-default-configuration
+ #f
;; Default nscd configuration.
(nscd-configuration))
@@ -1497,13 +1498,14 @@ (define nscd-service-type
(name-services (append
(nscd-configuration-name-services config)
name-services)))))
- (default-value %nscd-default-configuration)
+ (default-value (nscd-configuration))
(description
"Runs libc's @dfn{name service cache daemon} (nscd) with the
given configuration---an @code{<nscd-configuration>} object. @xref{Name
Service Switch}, for an example.")))
-(define* (nscd-service #:optional (config %nscd-default-configuration))
+(define-deprecated (nscd-service #:optional (config (nscd-configuration)))
+ nscd-service-type
"Return a service that runs libc's name service cache daemon (nscd) with the
given @var{config}---an @code{<nscd-configuration>} object. @xref{Name
Service Switch}, for an example."
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 1b05a862c6..f7de0d6a09 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -426,8 +426,9 @@ (define* (%installation-services #:key (system (or (and=>
;; Since this is running on a USB stick with a overlayfs as the root
;; file system, use an appropriate cache configuration.
- (nscd-service (nscd-configuration
- (caches %nscd-minimal-caches)))
+ (service nscd-service-type
+ (nscd-configuration
+ (caches %nscd-minimal-caches)))
;; Having /bin/sh is a good idea. In particular it allows Tramp
;; connections to this system to work.
--
2.39.1
L
L
Ludovic Courtès wrote on 3 Mar 2023 17:40
Re: bug#61789: [PATCH 00/27] Deprecate old-style services.
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
87r0u5vlda.fsf_-_@gnu.org
Hi,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (6 lines)
> * doc/guix.texi (Base Services): Replace pam-limits-service with pam-limits-service-type.
> * gnu/packages/benchmark.scm (python-locust)[description]: Update index anchor to manual.
> * gnu/services/base.scm (pam-limits-service-type): Accept both lists and
> file-like objects for compatibility.
> (pam-limits-service): Deprecate procedure.

[...]

Toggle quote (7 lines)
> @lisp
> -(pam-limits-service
> +(service pam-limits-service-type
> (list
> (pam-limits-entry "@@realtime" 'both 'rtprio 99)
> (pam-limits-entry "@@realtime" 'both 'memlock 'unlimited)))

Would be nice to indent the service value. :-)

Toggle quote (43 lines)
> (define pam-limits-service-type
> - (let ((security-limits
> - ;; Create /etc/security containing the provided "limits.conf" file.
> - (lambda (limits-file)
> - `(("security/limits.conf"
> - ,limits-file))))
> - (pam-extension
> + (let ((pam-extension
> (lambda (pam)
> (let ((pam-limits (pam-entry
> (control "required")
> (module "pam_limits.so")
> - (arguments '("conf=/etc/security/limits.conf")))))
> + (arguments
> + '("conf=/etc/security/limits.conf")))))
> (if (member (pam-service-name pam)
> '("login" "greetd" "su" "slim" "gdm-password" "sddm"
> "sudo" "sshd"))
> @@ -1602,7 +1598,26 @@ (define pam-limits-service-type
> (inherit pam)
> (session (cons pam-limits
> (pam-service-session pam))))
> - pam)))))
> + pam))))
> +
> + ;; XXX: Using file-like objects is deprecated, use lists instead.
> + ;; This is to be reduced into the list? case when the deprecated
> + ;; code gets removed.
> + ;; Create /etc/security containing the provided "limits.conf" file.
> + (security-limits
> + (match-lambda
> + ((? file-like? obj)
> + (warning (G_ "Using file-like value for 'pam-limits-service-type'
> +is deprecated~%"))
> + obj)
> + ((? list? lst)
> + `(("security/limits.conf"
> + ,(plain-file "limits.conf"
> + (string-join (map pam-limits-entry->string lst)
> + "\n" 'suffix)))))
> + (_ (report-error
> + (G_ "invalid input for 'pam-limits-service-type'~%"))))))

Maybe this change (from file-like to list) should be done separately,
for clarity?

Also note that ‘report-error’ prints an error but keeps going. You
probably want to use (raise (formatted-message …)) instead.

Ludo’.
L
L
Ludovic Courtès wrote on 3 Mar 2023 17:43
‘tor-hidden-service’ deprecation
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
87mt4tvl9i.fsf_-_@gnu.org
Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (8 lines)
> Due to (now renamed) 'hidden-service' record type not being exported,
> the only way hidden services could have worked is through the now deprecated
> 'tor-hidden-service' procedure which also had the issue that it can only
> be used once since the returned service always had the same name.
>
> This commit fixes the Tor service documentation and
> deprecates 'tor-hidden-service' procedure, correcting some inconsistencies along the way.

I’m also leaving this one out for now.

Could you please make it a separate patch series, with each aspect in
its own patch? I realize I’m asking you for extra boring work, but this
should help clarify the kind of changes we’re talking about.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 3 Mar 2023 17:45
‘screen-locker-service’ deprecation
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
87ilfhvl5b.fsf_-_@gnu.org
Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (12 lines)
> * doc/guix.texi (X Window): Replace 'screen-locker-service' with 'screen-locker-service-type'.
> Document <screen-locker-configuration>.
> * gnu/services/desktop.scm (desktop-services-for-system): Use screen-locker-service-type.
> * gnu/services/xorg.scm: Export accessors for <screen-locker-configuration>.
> (<screen-locker>): Rename to ...
> (<screen-locker-configuration>): ... this.
> (<screen-locker-configuration>)[empty?]: Rename to ...
> (<screen-locker-configuration>)[allow-empty-password?]: ... this.
> (screen-locker-pam-services): Update record name.
> (screen-locker-setuid-programs): Update accessor name.
> (screen-locker-service): Deprecate procedure.

Also leaving this one out: there’s a bit too much going on here, and I
think we should discuss it separately (it’s quite different from the
old-style service procedures.)

Ludo’.
L
L
Ludovic Courtès wrote on 3 Mar 2023 17:48
‘elogind-configuration’ documentation needs love
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
87edq5vl16.fsf_-_@gnu.org
Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (6 lines)
> * 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.

[...]

Toggle quote (13 lines)
> +@c TODO: field descriptions. This is best done by refactoring
> +@c elogind-configuration to use define-configuration which embeds the
> +@c descriptions in the code and then use configuration->documentation.
> +@deftp {Data Type} elogind-configuration
> +Data type representing the configuration of @command{elogind}.
> +
> +@table @asis
> +@item @code{elogind} (default: @code{elogind}) (type: file-like)
> +...
> +
> +@item @code{kill-user-processes?} (default: @code{#f}) (type: boolean)
> +...

I applied this patch but here’s to hoping someone addresses this TODO!

Ludo’.
L
L
Ludovic Courtès wrote on 3 Mar 2023 17:52
‘dicod-service’ deprecation
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
87a60tvkua.fsf_-_@gnu.org
Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (28 lines)
> * doc/guix.texi (Miscellaneous Services): Remove 'dicod-service' mention.
> * gnu/services/dict.scm (dicod-service): Deprecate procedure.
> ---
> doc/guix.texi | 17 ++---------------
> gnu/services/dict.scm | 6 ++++--
> 2 files changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 7aa9f3a5e8..a40d88455b 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -37814,19 +37814,6 @@ Miscellaneous Services
> implementation of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
> @end defvar
>
> -@deffn {Scheme Procedure} dicod-service [#:config (dicod-configuration)]
> -Return a service that runs the @command{dicod} daemon, an implementation
> -of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
> -
> -The optional @var{config} argument specifies the configuration for
> -@command{dicod}, which should be a @code{<dicod-configuration>} object, by
> -default it serves the GNU Collaborative International Dictionary of English.
> -
> -You can add @command{open localhost} to your @file{~/.dico} file to make
> -@code{localhost} the default server for @command{dico} client
> -(@pxref{Initialization File,,, dico, GNU Dico Manual}).
> -@end deffn

Could you move the documentation above under ‘dicod-service-type’?

Ludo’.
L
L
Ludovic Courtès wrote on 3 Mar 2023 18:09
Re: bug#61789: [PATCH 00/27] Deprecate old-style services.
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
871qm5vk1m.fsf@gnu.org
Hi Bruno,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (11 lines)
> Should completely deprecate every old-style service from Guix.
> Some had conflicting default values and some had to be rewritten.
>
> For some services the documentation is _still_ incomplete but should still result in an improvement over the status quo.
>
>
> Note: #60756 also deprecates one such old-style service but is not included
> in this patch series.
>
> [1]: https://issues.guix.gnu.org/60756

I pushed this series (see commits below), except for patches that I
explicitly mentioned here. I suggest that we discuss each one of them
independently in a new issue.

Thanks for taking the time to do all this work!

Ludo’.

2799ad4423 * services: dbus: Deprecate 'dbus-service' procedure.
7c23dab85c * services: spice: Deprecate 'spice-vdagent-service' procedure.
e24555234a * services: lirc: Deprecate 'lirc-service' procedure.
eddd9b1240 * services: vpn: Deprecate 'openvpn-client-service' & 'openvpn-server-service' procedures.
c6cbce9ad8 * services: mail: Deprecate 'dovecot-service' procedure.
be1435d668 * services: desktop: Deprecate 'bluetooth-service' procedure.
ae0975332c * services: desktop: Deprecate 'geoclue-service' procedure.
e8f161ea11 * services: desktop: Deprecate 'udisks-service' procedure.
ffc5d42fc2 * services: dbus: Deprecate 'polkit-service' procedure.
c3dc13e29c * services: desktop: Deprecate 'accountsservice-service' procedure.
ca3a73de3d * services: elogind-configuration: Do not ignore 'handle-hibernate-key' by default.
00767d967d * services: desktop: Deprecate 'elogind-service' procedure.
3b2e88011a * services: ssh: Deprecate 'dropbear-service' procedure.
0e21015fd2 * services: ssh: Deprecate 'lsh-service' procedure.
31b1e22926 * services: base: Deprecate 'rngd-service' procedure.
2e7516168e * services: base: Deprecate 'udev-service' procedure.
6edacf2491 * services: base: Deprecate 'syslog-service' procedure.
98e9dc6ab7 * services: base: Deprecate 'nscd-service' procedure.
5bd5e77281 * doc: kmscon-service-type: Use @defvar @-command.
4892c0186e * services: base: Deprecate 'agetty-service' procedure.
ad665a38fc * services: base: Deprecate 'mingetty-service' procedure.
6dd635b4cf * services: base: Deprecate 'login-service' procedure.
cb00e600ff * services: base: Deprecate 'host-name-service' procedure.
L
L
Ludovic Courtès wrote on 3 Mar 2023 18:09
control message for bug #61789
(address . control@debbugs.gnu.org)
87zg8tu5gv.fsf@gnu.org
close 61789
quit
B
B
Bruno Victal wrote on 5 Mar 2023 18:51
Re: ‘tor-hidden-service’ deprecation
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 61789@debbugs.gnu.org)
ddb7a49e-2f19-f6b2-44e2-518ab1bff146@makinata.eu
Hi Ludo’,

On 2023-03-03 16:43, Ludovic Courtès wrote:
Toggle quote (16 lines)
> Bruno Victal <mirai@makinata.eu> skribis:
>
>> Due to (now renamed) 'hidden-service' record type not being exported,
>> the only way hidden services could have worked is through the now deprecated
>> 'tor-hidden-service' procedure which also had the issue that it can only
>> be used once since the returned service always had the same name.
>>
>> This commit fixes the Tor service documentation and
>> deprecates 'tor-hidden-service' procedure, correcting some inconsistencies along the way.
>
> I’m also leaving this one out for now.
>
> Could you please make it a separate patch series, with each aspect in
> its own patch? I realize I’m asking you for extra boring work, but this
> should help clarify the kind of changes we’re talking about.

I think it's difficult to split this one into meaningful patches, reason being that
'tor-hidden-service-type' can't be used alone since the record constructor for a
Tor hidden service (hidden-service, which is IMO a "collision prone" name) is not exported.

The fact that it isn't exported also means that the 'hidden-services field from <tor-configuration>
was impossible to configure. Extending 'tor-service-type' was also impossible save for the
(to be deprecated) 'tor-hidden-service' procedure which provisions a 'tor-hidden-service-type'
that is simply a service extension for 'tor-service-type'.

The 'tor-hidden-service' and 'tor-hidden-service-type' are extremely misleading to what will
happen behind the scenes should more than one hidden-service be provisioned (with 'tor-hidden-service').
Since it does so via a 'tor-hidden-service-type' which has its own name, only one of the hidden-services
will get configured, which one = dice roll.

IMO this 'tor-hidden-service-type' shouldn't exist at all and tor-hidden-service can safely be
converted into a simple-service that extends tor-service-type.


Cheers,
Bruno
B
B
Bruno Victal wrote on 6 Mar 2023 15:36
Re: ‘screen-locker-service’ deprecation
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 61789@debbugs.gnu.org)
3c7ee366-4848-147c-9a51-4a65c9e63989@makinata.eu
Hi Ludo’,

On 2023-03-03 16:45, Ludovic Courtès wrote:
Toggle quote (18 lines)
> Bruno Victal <mirai@makinata.eu> skribis:
>
>> * doc/guix.texi (X Window): Replace 'screen-locker-service' with 'screen-locker-service-type'.
>> Document <screen-locker-configuration>.
>> * gnu/services/desktop.scm (desktop-services-for-system): Use screen-locker-service-type.
>> * gnu/services/xorg.scm: Export accessors for <screen-locker-configuration>.
>> (<screen-locker>): Rename to ...
>> (<screen-locker-configuration>): ... this.
>> (<screen-locker-configuration>)[empty?]: Rename to ...
>> (<screen-locker-configuration>)[allow-empty-password?]: ... this.
>> (screen-locker-pam-services): Update record name.
>> (screen-locker-setuid-programs): Update accessor name.
>> (screen-locker-service): Deprecate procedure.
>
> Also leaving this one out: there’s a bit too much going on here, and I
> think we should discuss it separately (it’s quite different from the
> old-style service procedures.)

The changes essentially amount to a rename of the configuration record-type (with backward compatibility)
and making explicit what the 'screen-locker-service' procedure does behind the scenes with 'screen-locker-service-type'.

Do you have another plan in mind to split or refactor this change?


Cheers,
Bruno
L
L
Ludovic Courtès wrote on 6 Mar 2023 17:05
Re: ‘tor-hidden-service’ deprecation
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
878rg9amrz.fsf@gnu.org
HI,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (17 lines)
> I think it's difficult to split this one into meaningful patches, reason being that
> 'tor-hidden-service-type' can't be used alone since the record constructor for a
> Tor hidden service (hidden-service, which is IMO a "collision prone" name) is not exported.
>
> The fact that it isn't exported also means that the 'hidden-services field from <tor-configuration>
> was impossible to configure. Extending 'tor-service-type' was also impossible save for the
> (to be deprecated) 'tor-hidden-service' procedure which provisions a 'tor-hidden-service-type'
> that is simply a service extension for 'tor-service-type'.
>
> The 'tor-hidden-service' and 'tor-hidden-service-type' are extremely misleading to what will
> happen behind the scenes should more than one hidden-service be provisioned (with 'tor-hidden-service').
> Since it does so via a 'tor-hidden-service-type' which has its own name, only one of the hidden-services
> will get configured, which one = dice roll.
>
> IMO this 'tor-hidden-service-type' shouldn't exist at all and tor-hidden-service can safely be
> converted into a simple-service that extends tor-service-type.

Hmm, can we still open a separate issue for it? :-)

I can’t really make up my mind right now. I think
‘tor-hidden-service-type’ brings a bit of clarity compared to
‘simple-service’, for instance when looking at ‘guix system
extension-graph’.

Then there’s the other issue that upstream calls this “onion services”
these days, so we should also change that.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 6 Mar 2023 23:32
Re: ‘screen-locker-service’ deprecation
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 61789@debbugs.gnu.org)
875ybdh5ox.fsf@gnu.org
Hi,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (24 lines)
> On 2023-03-03 16:45, Ludovic Courtès wrote:
>> Bruno Victal <mirai@makinata.eu> skribis:
>>
>>> * doc/guix.texi (X Window): Replace 'screen-locker-service' with 'screen-locker-service-type'.
>>> Document <screen-locker-configuration>.
>>> * gnu/services/desktop.scm (desktop-services-for-system): Use screen-locker-service-type.
>>> * gnu/services/xorg.scm: Export accessors for <screen-locker-configuration>.
>>> (<screen-locker>): Rename to ...
>>> (<screen-locker-configuration>): ... this.
>>> (<screen-locker-configuration>)[empty?]: Rename to ...
>>> (<screen-locker-configuration>)[allow-empty-password?]: ... this.
>>> (screen-locker-pam-services): Update record name.
>>> (screen-locker-setuid-programs): Update accessor name.
>>> (screen-locker-service): Deprecate procedure.
>>
>> Also leaving this one out: there’s a bit too much going on here, and I
>> think we should discuss it separately (it’s quite different from the
>> old-style service procedures.)
>
> The changes essentially amount to a rename of the configuration record-type (with backward compatibility)
> and making explicit what the 'screen-locker-service' procedure does behind the scenes with 'screen-locker-service-type'.
>
> Do you have another plan in mind to split or refactor this change?

Actually no. :-) Just thinking we should discuss it separately because
it looks less “obvious” to me than the other patches.

Ludo’.
?