{ config, lib, ... }:
{
  config = lib.mkIf config.home.desktop.enable {
    services = {
      mpd = {
        enable = true;
        network.startWhenNeeded = true;
        musicDirectory = "${config.home.homeDirectory}/Network/Midas/Music/NixBops";
        playlistDirectory = "${config.services.mpd.musicDirectory}/Playlists";
        extraConfig = ''
          audio_output {
            type "pipewire"
            name "Local Pipewire"
          }
        '';
      };
      mpd-mpris.enable = true;
      mpd-discord-rpc.enable = true;
    };

    home.persistence."/persist${config.home.homeDirectory}".directories = [ ".local/share/mpd" ];
  };
}
