1{
2 lib,
3 fetchFromGitHub,
4 gitUpdater,
5 makeFontsConf,
6 buildLua,
7 buildGoModule,
8}:
9
10buildLua (finalAttrs: {
11 pname = "uosc";
12 version = "5.10.0";
13 scriptPath = "src/uosc";
14
15 src = fetchFromGitHub {
16 owner = "tomasklaen";
17 repo = "uosc";
18 rev = finalAttrs.version;
19 hash = "sha256-Jj88PkP7hpyUOHsz0w0TOTTdJoQ/ShgJfHg//GUuUvM=";
20 };
21 passthru.updateScript = gitUpdater { };
22
23 tools = buildGoModule {
24 pname = "uosc-bin";
25 inherit (finalAttrs) version src;
26 vendorHash = "sha256-oRXChHeVQj6nXvKOVV125sM8wD33Dxxv0r/S7sl6SxQ=";
27 };
28
29 # the script uses custom "texture" fonts as the background for ui elements.
30 # In order for mpv to find them, we need to adjust the fontconfig search path.
31 postInstall = "cp -r src/fonts $out/share";
32 passthru.extraWrapperArgs = [
33 "--set"
34 "FONTCONFIG_FILE"
35 (toString (makeFontsConf {
36 fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
37 }))
38 "--set"
39 "MPV_UOSC_ZIGGY"
40 (lib.getExe' finalAttrs.tools "ziggy")
41 ];
42
43 meta = with lib; {
44 description = "Feature-rich minimalist proximity-based UI for MPV player";
45 homepage = "https://github.com/tomasklaen/uosc";
46 license = licenses.gpl3Only;
47 maintainers = with lib.maintainers; [ apfelkuchen6 ];
48 };
49})