I’m using mpd and I used the code on the wiki for pipe wire with its workarounds. The only issue is with pipewire
here’s my setup for mpd and pipewire respectively:
services.mpd.user = “hammoud”;
systemd.services.mpd.environment = {
# Fails if ran without XDG_RUNTIME_DIR (#609) · Issues · PipeWire / pipewire · GitLab
XDG_RUNTIME_DIR = “/run/user/${toString config.users.users.hammoud.uid}”; # User-id must match above user. MPD will look inside this directory for the PipeWire socket.
};
services.mpd = {
enable = true;
musicDirectory = “/home/hammoud/Music”;
extraConfig = ‘’
audio_output {
type “pipewire”
name “My PipeWire Output”
}
‘’;
# Optional:
network.listenAddress = "any"; # if you want to allow non-localhost connections
startWhenNeeded = true; # systemd feature: only start MPD service upon connection to its socket
};
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
here’s the systemctl for mpd:
15 12:18:15 nixos systemd[1]: Starting Music Player Daemon…
15 12:18:15 nixos mpd[14321]: zeroconf: No global port, disabling zeroconf
15 12:18:15 nixos systemd[1]: Started Music Player Daemon.
15 12:18:23 nixos mpd[14321]: exception: Failed to open “My PipeWire Output” (pipewire); Failed to connect stream: Host is down
and for pipe wire:
○ pipewire.service
Loaded: masked (Reason: Unit pipewire.service is masked.)
Active: inactive (dead)