[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63082: [PATCH v2 13/16] services: mpd: Obsolete 'environment-variabl
From: |
Maxim Cournoyer |
Subject: |
bug#63082: [PATCH v2 13/16] services: mpd: Obsolete 'environment-variables' field. |
Date: |
Sat, 29 Apr 2023 13:21:50 -0400 |
Rationale: Services can be extended via the simple-service mechanism instead
of having to expose fields on service configurations that are not directly
connected to the service's configuration.
* gnu/services/audio.scm (mpd-environment-variables-sanitizer): New sanitizer.
(mpd-configuration): Use it.
(mpd-shepherd-service): Hard code the useful environment variables inside the
Shepherd service.
---
doc/guix.texi | 4 ++--
gnu/services/audio.scm | 17 ++++++++++++-----
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3de7405318..148ca88633 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33578,8 +33578,8 @@ Audio Services
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)
-A list of strings specifying environment variables.
+@item @code{environment-variables} (default: @code{#f}) (type: boolean)
+Obsolete. Do not use.
@item @code{log-file} (type: maybe-string)
The location of the log file. Unless specified, logs are sent to the
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 1e0a8b7f9e..dca2e8e5f6 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -249,7 +249,11 @@ (define (mpd-log-file-sanitizer value)
value)
(_ (configuration-field-error #f 'log-file value))))
-;;;
+(define (mpd-environment-variables-sanitizer value)
+ (when value
+ (warning (G_ "'environment-variables' in <mpd-configuration> is obsolete;\
+ ignoring~%")))
+ #f)
;; Generic MPD plugin record, lists only the most prevalent fields.
(define-configuration mpd-plugin
@@ -423,9 +427,9 @@ (define-configuration mpd-configuration
empty-serializer)
(environment-variables
- (list-of-strings '("PULSE_CLIENTCONFIG=/etc/pulse/client.conf"
- "PULSE_CONFIG=/etc/pulse/daemon.conf"))
- "A list of strings specifying environment variables."
+ (boolean #f)
+ "Obsolete. Do not use."
+ (sanitizer mpd-environment-variables-sanitizer)
empty-serializer)
(log-file
@@ -626,7 +630,10 @@ (define (mpd-shepherd-service config)
(make-forkexec-constructor
(list #$(file-append package "/bin/mpd") "--no-daemon"
#$config-file)
- #:environment-variables '#$environment-variables
+ #:environment-variables
+ ;; Use the system-configured pulse configuration.
+ (list "PULSE_CLIENTCONFIG=/etc/pulse/client.conf"
+ "PULSE_CONFIG=/etc/pulse/daemon.conf")
#:user #$username
#:group #$(user-account-group user)
#:supplementary-groups
--
2.39.2
- bug#63082: [PATCH v2 06/16] services: mpd; Refactor start slot directory initialization., (continued)
- bug#63082: [PATCH v2 06/16] services: mpd; Refactor start slot directory initialization., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 02/16] services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 04/16] services: mpd: Obsolete the 'group' field., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 05/16] services: mpd: List log-level in decreasing verbosity order in doc., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 11/16] services: mpd: Warn when the MPD user is not in the "audio" group., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 08/16] services: mpd: Do not rotate logs when using syslog., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 07/16] services: mpd: Log to syslog by default., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 12/16] services: mpd: Auto-detect mpd-output mixer type by default., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 09/16] services: mpd: Let Shepherd effect the user/group change., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 10/16] system: accounts: Export <user-account>., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 13/16] services: mpd: Obsolete 'environment-variables' field.,
Maxim Cournoyer <=
- bug#63082: [PATCH v2 15/16] services: mpd: Update basic example., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 14/16] services: mpd: Provision a default cache directory and set HOME., Maxim Cournoyer, 2023/04/29
- bug#63082: [PATCH v2 16/16] services: Avoid 'delete' overrides warning in audio module., Maxim Cournoyer, 2023/04/29