aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/mopidy.nix
blob: 844a3873157a2954e04a2b29a304ca830584442f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  pkgs,
  config,
  lib,
  ...
}: let
  cfg = config.collinux.services.mopidy;
in {
  config = lib.mkIf cfg.enable {
    services.mopidy = {
      enable = true;
      extensionPackages = with pkgs; [mopidy-youtube mopidy-mpd mopidy-local];
      settings = {
        mpd = {
          enabled = true;
          hostname = "0.0.0.0";
          port = cfg.port;
        };

        # disable default plugins
        file.enabled = false;
        http.enabled = false; # only use mpd

        local = {
          enabled = true;
          media_dir = "/media/library/music";
        };

        youtube = {
          enabled = true;
          allow_cache = true;
          musicapi_enabled = true;
          youtube_dl_package = "yt_dlp";
          autoplay_enabled = true;
          strict_autoplay = false;
          search_results = 15;
        };
      };
    };
  };
}