Subject: bug#63082: [PATCH v3 01/16] services: mpd: Add auto-update? field to mpd-configuration.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 5 May 2023 14:28:56 -0400

* gnu/services/audio.scm (mpd-configuration) [auto-update?]: New field.
* doc/guix.texi (Audio Services): Update doc.
---
 doc/guix.texi          | 39 ++++++++++++++++++++++++++-------------
 gnu/services/audio.scm |  5 +++++
 2 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 55221a10c3..66eb44812d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33579,24 +33579,22 @@ Audio Services
 The service type for @command{mpd}
 @end defvar
 
+@c %start of fragment
 @deftp {Data Type} mpd-configuration
-Data type representing the configuration of @command{mpd}.
+Available @code{mpd-configuration} fields are:
 
 @table @asis
 @item @code{package} (default: @code{mpd}) (type: file-like)
 The MPD package.
 
-@item @code{user} (default: @code{%mpd-user}) (type: user-account)
+@item @code{user} (type: user-account)
 The user to run mpd as.
 
-The default @code{%mpd-user} is a system user with the name ``mpd'',
-who is a part of the group @var{group} (see below).
-@item @code{group} (default: @code{%mpd-group}) (type: user-group)
+@item @code{group} (type: user-group)
 The group to run mpd as.
 
-The default @code{%mpd-group} is a system group with name ``mpd''.
 @item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbol)
-A list of symbols naming Shepherd services that this service
+This is a list of symbols naming Shepherd services that this service
 will depend on.
 
 @item @code{environment-variables} (default: @code{("PULSE_CLIENTCONFIG=/etc/pulse/client.conf" "PULSE_CONFIG=/etc/pulse/daemon.conf")}) (type: list-of-strings)
@@ -33615,9 +33613,15 @@ Audio Services
 @item @code{music-directory} (type: maybe-string)
 The directory to scan for music files.
 
+@item @code{music-dir} (type: maybe-string)
+The directory to scan for music files.
+
 @item @code{playlist-directory} (type: maybe-string)
 The directory to store playlists.
 
+@item @code{playlist-dir} (type: maybe-string)
+The directory to store playlists.
+
 @item @code{db-file} (type: maybe-string)
 The location of the music database.
 
@@ -33627,15 +33631,19 @@ Audio Services
 @item @code{sticker-file} (type: maybe-string)
 The location of the sticker database.
 
-@item @code{default-port} (default: @code{6600}) (type: maybe-integer)
+@item @code{default-port} (default: @code{6600}) (type: maybe-port)
 The default port to run mpd on.
 
 @item @code{endpoints} (type: maybe-list-of-strings)
-The addresses that mpd will bind to.  A port different from @var{default-port}
-may be specified, e.g. @code{localhost:6602} and IPv6 addresses must be
-enclosed in square brackets when a different port is used.
-To use a Unix domain socket, an absolute path or a path starting with @code{~}
-can be specified here.
+The addresses that mpd will bind to.  A port different from
+@var{default-port} may be specified, e.g.  @code{localhost:6602} and
+IPv6 addresses must be enclosed in square brackets when a different port
+is used.  To use a Unix domain socket, an absolute path or a path
+starting with @code{~} can be specified here.
+
+@item @code{address} (type: maybe-string)
+The address that mpd will bind to.  To use a Unix domain socket, an
+absolute path can be specified here.
 
 @item @code{database} (type: maybe-mpd-plugin)
 MPD database plugin configuration.
@@ -33652,6 +33660,10 @@ Audio Services
 @item @code{archive-plugins} (default: @code{()}) (type: list-of-mpd-plugin)
 List of MPD archive plugin configurations.
 
+@item @code{auto-update?} (type: maybe-boolean)
+Whether to automatically update the music database when files are
+changed in the @var{music-directory}.
+
 @item @code{input-cache-size} (type: maybe-string)
 MPD input cache size.
 
@@ -33677,6 +33689,7 @@ Audio Services
 
 @end table
 @end deftp
+@c %end of fragment
 
 @deftp {Data Type} mpd-plugin
 Data type representing a @command{mpd} plugin.
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 690409b7a1..8c061da47f 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -514,6 +514,11 @@ (define-configuration mpd-configuration
    (serializer (lambda (_ x)
                  (mpd-serialize-list-of-mpd-plugin "archive_plugin" x))))
 
+  (auto-update?
+   maybe-boolean
+   "Whether to automatically update the music database when files are changed
+in the @var{music-directory}.")
+
   (input-cache-size
    maybe-string
    "MPD input cache size."
-- 
2.39.2