{config, ...}: {
  services.mpd = {
    enable = true;
    network.listenAddress = "0.0.0.0";
    extraConfig = ''
      audio_output {
      type "fifo"
      name "snapcast"
      path "${config.services.snapserver.streams.mpd.location}"
      format "${config.services.snapserver.streams.mpd.sampleFormat}"
      mixer_type "software"
      }
    '';
  };
  networking.firewall.allowedTCPPorts = [config.services.mpd.network.port];
  services.snapserver = {
    enable = true;
    openFirewall = true;
    buffer = 1000;
    streams.mpd = {
      type = "pipe";
      location = "/run/snapserver/mpd";
      sampleFormat = "44100:16:2";
      codec = "pcm";
    };
  };
}
