From 85d1debfeeb3c83ff7213c94058fcf292fc608ca Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Tue, 16 Jan 2024 11:31:36 +0800 Subject: [PATCH] home: mpv: use mpvScripts.modernx --- .../home-manager/applications/mpv/default.nix | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/users/guanranwang/home-manager/applications/mpv/default.nix b/users/guanranwang/home-manager/applications/mpv/default.nix index 9d603cd..2a38bfa 100644 --- a/users/guanranwang/home-manager/applications/mpv/default.nix +++ b/users/guanranwang/home-manager/applications/mpv/default.nix @@ -1,6 +1,7 @@ { pkgs, lib, + inputs, ... }: { programs.mpv = { @@ -13,26 +14,21 @@ profile = "gpu-hq"; osc = "no"; }; - scripts = with pkgs.mpvScripts; - [ + scripts = + (with pkgs.mpvScripts; [ thumbfast - ] + ]) + ++ (with inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.mpvScripts; [ + modernx + ]) ++ lib.optionals (!pkgs.stdenv.hostPlatform.isDarwin) (with pkgs.mpvScripts; [ mpris ]); }; - # 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"; + # I dont know how to handle the font + xdg.configFile = with inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.mpvScripts; { + "mpv/fonts/Material-Design-Iconic-Font.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Font.ttf"; + "mpv/fonts/Material-Design-Iconic-Round.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Round.ttf"; }; }