Mopidy: Difference between revisions

From NixOS Wiki
Create Mopidy page with instructions for configuring mopidy-youtube with yt-dlp
 
Klinger (talk | contribs)
m Category:Server
Line 19: Line 19:
  <nowiki> </nowiki> <nowiki>''</nowiki>;
  <nowiki> </nowiki> <nowiki>''</nowiki>;
  }
  }
[[Category:Server]]

Revision as of 05:49, 10 May 2024

Mopidy is an MPD-compatible music server written in Python.

On NixOS, Mopidy is configured via the services.mopidy options.

Extensions

Mopidy extensions are installed by adding their package to services.mopidy.extensionPackages.

mopidy-youtube

By default, the mopidy-youtube extension relies on youtube-dl as the backend for downloading from YouTube, but it can be configured to use a compatible alternative backend such as yt-dlp. Due to the way Mopidy extensions are implemented in nixpkgs, to add another module to the Python environment of mopidy-youtube, the mopidy package set must be overridden like so:

services.mopidy = let
  mopidyPackagesOverride = pkgs.mopidyPackages.overrideScope (prev: final: { extraPkgs = pkgs: [ pkgs.yt-dlp ]; });
in {
  extensionPackages = with mopidyPackagesOverride; [
    mopidy-youtube
  ];
  configuration = ''
    [youtube]
    youtube_dl_package = yt_dlp
  '';
}