{ config, lib, pkgs, ... }:

with lib;
let
  cfg = config.modules.software.tools.mpv;
in {
  options.modules.software.tools.mpv = {
    enable = mkEnableOption "Enable mpv, a lightweight video player";
  };

  config = mkIf cfg.enable {
    hm.programs.mpv = {
      enable = true;

      config = {
        hwdec = "auto";
        osc = "no";
        border = "no";
      };
    
      scripts = with pkgs.mpvScripts; [
        mpris
        modernx
        thumbfast
        visualizer
      ];
    };
  };
}