services: mpd: Use proper records for user and group fields.

Deprecate using strings for these fields and prefer user-account
(resp. user-group) instead to avoid duplication within account-service-type.

Fixes #61570 <https://issues.guix.gnu.org/61570>.

* gnu/services/audio.scm (%mpd-user, %mpd-group)
(mpd-serialize-user-account, mpd-serialize-user-group)
(mpd-user-sanitizer, mpd-group-sanitizer): New variables.
(mpd-configuration)[user]: Use user-account as value type.
Sanitize via mpd-user-sanitizer.
[group]: Use user-group as value type.
Sanitize via mpd-group-sanitizer.
(mpd-shepherd-service): Adjust accordingly.
(mpd-accounts): Likewise.
* doc/guix.texi (Audio Services)[Music Player Daemon]: Likewise.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Bruno Victal 2023-03-26 19:41:32 +01:00 committed by Maxim Cournoyer
parent 420adff18e
commit 865df7f080
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -140,6 +140,14 @@ (define (uglify-field-name field-name)
(define list-of-symbol?
(list-of symbol?))
;; Helpers for deprecated field types, to be removed later.
(define %lazy-group (make-symbol "%lazy-group"))
(define (%set-user-group user group)
(user-account
(inherit user)
(group (user-group-name group))))
;;;
;;; MPD