{ config, lib, pkgs, ... }: with lib; let cfg = config.sydnix.mpd; in { options = { sydnix.mpd = { enable = mkEnableOption "Music Player Daemon"; musicDirectory = mkOption { default = "${config.home.homeDirectory}/Music"; type = types.path; }; scrobbling = { enable = mkOption { description = "Enable scrobbling for MPD via mpdscribble."; type = types.bool; default = cfg.enable; }; endpoints = mkOption { type = types.attrsOf (types.submodule ({ ... }: { options = { passwordFile = mkOption { type = types.path; }; username = mkOption { type = types.str; }; }; })); }; }; discord = { enable = mkOption { description = "Enable Discord integration for MPD via mpd-discord-rpc."; type = types.bool; default = cfg.enable; }; }; }; }; config = mkIf cfg.enable { services.mpd = { enable = true; musicDirectory = cfg.musicDirectory; extraConfig = '' audio_output { type "pipewire" name "My PipeWire Output" } ''; # if you want to allow non-localhost connections network.listenAddress = "any"; }; services.mpd-discord-rpc = mkIf cfg.discord.enable { enable = true; }; # services.mpdscribble = mkIf cfg.scrobbling.enable { # enable = true; # endpoints = { # "last.fm" = { # passwordFile = "/etc/insecure-bullshit/lastfm-password.lol"; # username = "crumb1"; # }; # "libre.fm" = { # passwordFile = "/etc/insecure-bullshit/librefm-password.lol"; # username = "crumbtoo"; # }; # }; # }; }; }