Subject: [bug#54986] [PATCH 0/2] services: mpd: Refactor MPD service

From: mirai <[email-masked]>
Date: Fri, 9 Dec 2022 13:44:58 +0000

On 2022-12-08 13:35, Liliana Marie Prikler wrote:
> This doesn't work for #54986, which makes it so that in-file addresses
> are ignored in favour of handing over the sockets directly through
> shepherd.  Looking at [4], it appears the meaning of "port" is closer
> to that of a default port, as addresses can have ports in them.  But I
> would still prefer addresses to be "endpoints", which if they happen to
> be a list of strings are taken as MPD addresses and if they happen to
> be shepherd endpoints are passed on to the shepherd service.

Are you proposing for the 'addresses' field to be a
"maybe-list-of-string-or-shepherd-endpoint"? (more of a xor as they can't
be used simultaneously)
Example:

--8<---------------cut here---------------start------------->8---
;; should fire a error message during guix system reconfigure
(mpd-configuration
  (addresses `("[::]:6645"  
               ,(shepherd-endpoint
                  (address "/var/run/mpd-shepherd-socket")))))
--8<---------------cut here---------------end--------------->8---

I don't think it breaks backward compatibility to introduce this
after #59866 is merged.
The type of field 'addresses' could be changed transparently to something like:

--8<---------------cut here---------------start------------->8---
(define list-of-addresses (list-of (lambda (x) (or (string? x) (shepherd-endpoint? x)))))
--8<---------------cut here---------------end--------------->8---