{
  lib,
  config,
  pkgs,
  ...
}: let
  cfg = config.marleyos.services.mopidy;
in {
  options.marleyos.services.mopidy.enable = lib.mkEnableOption "mopidy";

  config = lib.mkIf cfg.enable {
    services.mopidy = {
      enable = true;

      extensionPackages = with pkgs; [
        mopidy-mpd
        # TODO: Enable once we have secrets (requires password in config)
        # mopidy-jellyfin
      ];

      configuration =
        # ini
        ''
          [mpd]
          hostname = ::
        '';
    };
  };
}
