services: mpd: Do not eagerly look for a user.

Running 'guix system search mpd' would throw a backtrace because the
mpd-shepherd-service service start Gexp contained an unquoted call to
'getpwnam', which would look for a missing 'mpd' user and fail.

* gnu/services/audio.scm (mpd-shepherd-service): gexp-unquote only the
relevant variable rather than the whole expression.
This commit is contained in:
Maxim Cournoyer 2020-11-06 08:54:27 -05:00
parent 51916455d0
commit 0c5d0c57d3
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -143,11 +143,11 @@ (define (mpd-shepherd-service config)
#:pid-file #$(mpd-file-name config "pid")
#:environment-variables
;; Required to detect PulseAudio when run under a user account.
'(#$(string-append
"XDG_RUNTIME_DIR=/run/user/"
(number->string
(list (string-append
"XDG_RUNTIME_DIR=/run/user/"
(number->string
(passwd:uid
(getpwnam (mpd-configuration-user config))))))
(getpwnam #$(mpd-configuration-user config))))))
#:log-file #$(mpd-file-name config "log")))
(stop #~(make-kill-destructor))))