feat: add mpv module with custom scripts

This commit is contained in:
matt1432 2023-12-16 16:03:36 -05:00
parent 73d4ab96db
commit ae75463df5
4 changed files with 49 additions and 1 deletions

11
home/mpv/default.nix Normal file
View file

@ -0,0 +1,11 @@
{pkgs, ...}: let
mpvScripts = import ./scripts pkgs;
in {
programs.mpv = {
enable = true;
scripts = with mpvScripts; [
modernx
];
};
}

View file

@ -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;};
}

View file

@ -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"];
}))
];
})

View file

@ -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