diff --git a/home/mpv/default.nix b/home/mpv/default.nix new file mode 100644 index 00000000..828d8414 --- /dev/null +++ b/home/mpv/default.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: let + mpvScripts = import ./scripts pkgs; +in { + programs.mpv = { + enable = true; + + scripts = with mpvScripts; [ + modernx + ]; + }; +} diff --git a/home/mpv/scripts/default.nix b/home/mpv/scripts/default.nix new file mode 100644 index 00000000..bb88ce7c --- /dev/null +++ b/home/mpv/scripts/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: let + buildLua = + pkgs.callPackage + "${pkgs.path}/pkgs/applications/video/mpv/scripts/buildLua.nix" {}; +in + pkgs.recurseIntoAttrs { + modernx = pkgs.callPackage ./modernx.nix {inherit buildLua;}; + } diff --git a/home/mpv/scripts/modernx.nix b/home/mpv/scripts/modernx.nix new file mode 100644 index 00000000..122416c0 --- /dev/null +++ b/home/mpv/scripts/modernx.nix @@ -0,0 +1,29 @@ +{ + fetchFromGitHub, + makeFontsConf, + buildLua, +}: +buildLua (finalAttrs: { + pname = "modernx"; + version = "unstable"; + + src = fetchFromGitHub { + owner = "cyl0"; + repo = "ModernX"; + rev = "d053ea602d797bdd85d8b2275d7f606be067dc21"; + hash = "sha256-Gpofl529VbmdN7eOThDAsNfNXNkUDDF82Rd+csXGOQg="; + }; + + # Make font available to script + postInstall = '' + mkdir -p $out/share/fonts + cp -r ./Material-Design-Iconic-Font.ttf $out/share/fonts + ''; + passthru.extraWrapperArgs = [ + "--set" + "FONTCONFIG_FILE" + (toString (makeFontsConf { + fontDirectories = ["${finalAttrs.finalPackage}/share/fonts"]; + })) + ]; +}) diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 97a2a4b8..dee378ad 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -43,6 +43,7 @@ in { imports = [ ../../home/alacritty.nix ../../home/dconf.nix + ../../home/mpv ../../home/obs.nix ../../home/swaylock.nix ../../home/theme.nix @@ -225,7 +226,6 @@ in { thunderbird # TODO: use programs.thunderbird spotifywm photoqt - mpv nextcloud-client jellyfin-media-player xournalpp