{ config, lib, userName, pkgs, sources, ... }: { home-manager.users.${userName}.programs.mpv = { enable = true; bindings = { # "CTRL+n" = "af toggle \"lavfi=[dynaudnorm=f=100:g=31:s=20.0]\""; }; config = { ytdl = true; sub = false; osd-font = "DejaVu Sans"; # vo = "gpu"; hwdec = "auto"; force-window = "yes"; # af = "lavfi=[dynaudnorm=f=100:g=31:s=20.0]"; script-opts = lib.concatStringsSep "," [ "osc-layout=topbar" "vidscale=no" "deadzonesize=0.9" "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp" "chapterskip-skip=sponsor" "chapterskip-categories=sponsor>%[SponsorBlock%]: Sponsor" ]; }; scripts = [ (pkgs.stdenv.mkDerivation (sources.mpv-reload // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 reload.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "reload.lua"; })) (pkgs.stdenv.mkDerivation (sources.mpv-createchapter // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 createchapter.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "createchapter.lua"; })) (pkgs.stdenv.mkDerivation (sources.mpv-autosave // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 autosave.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "autosave.lua"; })) (pkgs.stdenv.mkDerivation (sources.mpv-mpris // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 mpris.so $out/share/mpv/scripts/${passthru.scriptName} ''; nativeBuildInputs = with pkgs; [ pkgconfig glib mpv ]; passthru.scriptName = "mpris.so"; })) (pkgs.stdenv.mkDerivation (sources.mpv-chapterskip // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 chapterskip.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "chapterskip.lua"; })) ]; }; }