2025-07-06 01:35:03 +02:00
{
username ,
config ,
pkgs ,
. . .
} :
2025-07-01 16:29:21 +02:00
{
services . mpd = {
enable = true ;
musicDirectory = " / d a n d e l i o n / h o m e / l i v / m u s i c " ;
extraConfig = ''
audio_output {
type " p i p e w i r e "
name " p i p e w i r e "
}
'' ;
user = " ${ username } " ; # PipeWire requires this as it runs as the normal user and mpd normally runs as a system user.
# Optional:
# network.listenAddress = "any"; # if you want to allow non-localhost connections
network . startWhenNeeded = false ; # systemd feature: only start MPD service upon connection to its socket
} ;
systemd . services . mpd . environment = {
# see: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
XDG_RUNTIME_DIR = " / r u n / u s e r / ${ toString config . users . users . userRunningPipeWire . uid } " ; # User-id must match above user. MPD will look inside this directory for the PipeWire socket.
} ;
2025-07-06 01:35:03 +02:00
home . packages = with pkgs ; [
mpdris2
] ;
2025-07-01 16:29:21 +02:00
}