about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/scripts/mpv-osc-modern.nix
blob: ce32622d64d8f999d71a18b5031c870b36fb4eb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib
, buildLua
, fetchFromGitHub
, makeFontsConf
, nix-update-script
}:
buildLua (finalAttrs: {
  pname = "mpv-osc-modern";
  version = "1.1.1";

  scriptPath = "modern.lua";
  src = fetchFromGitHub {
    owner = "maoiscat";
    repo = "mpv-osc-modern";
    rev = "v${finalAttrs.version}";
    hash = "sha256-RMUy8UpSRSCEPAbnGLpJ2NjDsDdkjq8cNsdGwsQ5ANU=";
  };

  postInstall = ''
    mkdir -p $out/share/fonts
    cp -r *.ttf $out/share/fonts
  '';
  passthru.extraWrapperArgs = [
    "--set"
    "FONTCONFIG_FILE"
    (toString (makeFontsConf {
      fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
    }))
  ];

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
    description = "Another MPV OSC Script";
    homepage = "https://github.com/maoiscat/mpv-osc-modern";
    license = licenses.lgpl21Plus;
    maintainers = with maintainers; [ Guanran928 ];
  };
})