2025-07-06 01:35:03 +02:00
|
|
|
{
|
|
|
|
|
username,
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
2025-07-01 16:29:21 +02:00
|
|
|
{
|
2025-07-17 11:49:01 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
2025-07-15 11:32:53 +02:00
|
|
|
mpc
|
|
|
|
|
mpdris2
|
|
|
|
|
ncmpcpp
|
2025-07-17 14:03:17 +02:00
|
|
|
rmpc
|
2025-07-15 11:32:53 +02:00
|
|
|
];
|
|
|
|
|
|
2025-07-01 16:29:21 +02:00
|
|
|
services.mpd = {
|
|
|
|
|
enable = true;
|
2025-07-15 11:32:53 +02:00
|
|
|
musicDirectory = "/home/${username}/Music";
|
|
|
|
|
playlistDirectory = "/home/${username}/Music/.playlists";
|
2025-07-01 16:29:21 +02:00
|
|
|
extraConfig = ''
|
2025-07-15 11:32:53 +02:00
|
|
|
restore_paused "yes"
|
|
|
|
|
auto_update "yes"
|
2025-07-17 11:49:01 +02:00
|
|
|
|
2025-07-01 16:29:21 +02:00
|
|
|
audio_output {
|
|
|
|
|
type "pipewire"
|
2025-07-17 11:49:01 +02:00
|
|
|
name "pipewire"
|
2025-07-01 16:29:21 +02:00
|
|
|
}
|
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
systemd.services.mpd.environment = {
|
|
|
|
|
# see: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
|
2025-07-17 11:49:01 +02:00
|
|
|
XDG_RUNTIME_DIR = "/run/user/1000"; # User-id must match above user. MPD will look inside this directory for the PipeWire socket.
|
2025-07-01 16:29:21 +02:00
|
|
|
};
|
|
|
|
|
}
|