From 0bbf04fabe1fb93ca642b904005db23e9edfc189 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Wed, 13 Dec 2023 02:53:45 +0800 Subject: [PATCH] home: configure mpv --- .../home-manager/applications/mpv/default.nix | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/users/guanranwang/home-manager/applications/mpv/default.nix b/users/guanranwang/home-manager/applications/mpv/default.nix index 589159c..fde3d19 100644 --- a/users/guanranwang/home-manager/applications/mpv/default.nix +++ b/users/guanranwang/home-manager/applications/mpv/default.nix @@ -1,3 +1,29 @@ -_: { - programs.mpv.enable = true; +{pkgs, ...}: { + programs.mpv = { + enable = true; + config = { + hwdec = "auto-safe"; + vo = "gpu-next"; + profile = "gpu-hq"; + osc = "no"; + }; + scripts = with pkgs.mpvScripts; [ + mpris + thumbfast + ]; + }; + + # for scripts that is not in nixpkgs + xdg.configFile = let + modernX = pkgs.fetchFromGitHub { + owner = "zydezu"; + repo = "modernX"; + rev = "10f74d29f86cbfb307181ecfa564402f993b073d"; + hash = "sha256-ozbOsVGdllB+E4UtERynhe5Eng3nKnL/IIEtT4yVdOI="; + }; + in { + "mpv/scripts/modernx.lua".source = "${modernX}/modernx.lua"; + "mpv/fonts/Material-Design-Iconic-Font.ttf".source = "${modernX}/Material-Design-Iconic-Font.ttf"; + "mpv/fonts/Material-Design-Iconic-Round.ttf".source = "${modernX}/Material-Design-Iconic-Round.ttf"; + }; }