zoekt: 3.7.2-2-unstable-2024-10-24 -> 3.7.2-2-unstable-2024-12-09 (#363818)
[NixPkgs.git] / pkgs / desktops / gnome / extensions / extensionOverrides.nix
blob0ddd47c12e47a9154512b1a5e57b29ba30e83a0c
1 { lib
2 , fetchzip
3 , ddcutil
4 , easyeffects
5 , gjs
6 , glib
7 , nautilus
8 , gobject-introspection
9 , gsound
10 , hddtemp
11 , libgda
12 , libgtop
13 , libhandy
14 , liquidctl
15 , lm_sensors
16 , netcat-gnu
17 , nvme-cli
18 , procps
19 , smartmontools
20 , substituteAll
21 , touchegg
22 , util-linux
23 , vte
24 , wrapGAppsHook3
25 , xdg-utils
27 let
28   # Helper method to reduce redundancy
29   patchExtension = name: override: super: (super // {
30     ${name} = super.${name}.overrideAttrs override;
31   });
33 # A set of overrides for automatically packaged extensions that require some small fixes.
34 # The input must be an attribute set with the extensions' UUIDs as keys and the extension
35 # derivations as values. Output is the same, but with patches applied.
37 # Note that all source patches refer to the built extension as published on extensions.gnome.org, and not
38 # the upstream repository's sources.
39 super: lib.trivial.pipe super [
40   (patchExtension "caffeine@patapon.info" (old: {
41     meta.maintainers = with lib.maintainers; [ eperuffo ];
42   }))
44   (patchExtension "dash-to-dock@micxgx.gmail.com" (old: {
45     meta.maintainers = with lib.maintainers; [ rhoriguchi ];
46   }))
48   (patchExtension "ddterm@amezin.github.com" (old: {
49     nativeBuildInputs = [ gobject-introspection wrapGAppsHook3 ];
50     buildInputs = [ vte libhandy gjs ];
51     postFixup = ''
52       patchShebangs "$out/share/gnome-shell/extensions/ddterm@amezin.github.com/bin/com.github.amezin.ddterm"
53       wrapGApp "$out/share/gnome-shell/extensions/ddterm@amezin.github.com/bin/com.github.amezin.ddterm"
54     '';
55   }))
57   (patchExtension "display-brightness-ddcutil@themightydeity.github.com" (old: {
58     # Make glib-compile-schemas available
59     nativeBuildInputs = [ glib ];
60     # Has a hard-coded path to a run-time dependency
61     # https://github.com/NixOS/nixpkgs/issues/136111
62     postPatch = ''
63       substituteInPlace "schemas/org.gnome.shell.extensions.display-brightness-ddcutil.gschema.xml" \
64         --replace-fail "/usr/bin/ddcutil" ${lib.getExe ddcutil}
65     '';
66     postFixup = ''
67       rm "$out/share/gnome-shell/extensions/display-brightness-ddcutil@themightydeity.github.com/schemas/gschemas.compiled"
68       glib-compile-schemas "$out/share/gnome-shell/extensions/display-brightness-ddcutil@themightydeity.github.com/schemas"
69     '';
70   }))
72   (patchExtension "eepresetselector@ulville.github.io" (old: {
73     patches = [
74       # Needed to find the currently set preset
75       (substituteAll {
76         src = ./extensionOverridesPatches/eepresetselector_at_ulville.github.io.patch;
77         easyeffects_gsettings_path = "${glib.getSchemaPath easyeffects}";
78       })
79     ];
80   }))
82   (patchExtension "freon@UshakovVasilii_Github.yahoo.com" (old: {
83     patches = [
84       (substituteAll {
85         src = ./extensionOverridesPatches/freon_at_UshakovVasilii_Github.yahoo.com.patch;
86         inherit hddtemp liquidctl lm_sensors procps smartmontools;
87         netcat = netcat-gnu;
88         nvmecli = nvme-cli;
89       })
90     ];
91   }))
93   (patchExtension "gnome-shell-screenshot@ttll.de" (old: {
94     # Requires gjs
95     # https://github.com/NixOS/nixpkgs/issues/136112
96     postPatch = ''
97       for file in *.js; do
98         substituteInPlace $file --replace "gjs" "${gjs}/bin/gjs"
99       done
100     '';
101   }))
103   (patchExtension "gtk4-ding@smedius.gitlab.com" (old: {
104     nativeBuildInputs = [ wrapGAppsHook3 ];
105     patches = [
106       (substituteAll {
107         inherit gjs;
108         util_linux = util-linux;
109         xdg_utils = xdg-utils;
110         src = ./extensionOverridesPatches/gtk4-ding_at_smedius.gitlab.com.patch;
111         nautilus_gsettings_path = "${glib.getSchemaPath nautilus}";
112       })
113     ];
114   }))
116   (patchExtension "pano@elhan.io" (final: prev: {
117     version = "v23-alpha3";
118     src = fetchzip {
119       url = "https://github.com/oae/gnome-shell-pano/releases/download/${final.version}/pano@elhan.io.zip";
120       hash = "sha256-LYpxsl/PC8hwz0ZdH5cDdSZPRmkniBPUCqHQxB4KNhc=";
121       stripRoot = false;
122     };
123     preInstall = ''
124       substituteInPlace extension.js \
125         --replace-fail "import Gda from 'gi://Gda?version>=5.0'" "imports.gi.GIRepository.Repository.prepend_search_path('${libgda}/lib/girepository-1.0'); const Gda = (await import('gi://Gda')).default" \
126         --replace-fail "import GSound from 'gi://GSound'" "imports.gi.GIRepository.Repository.prepend_search_path('${gsound}/lib/girepository-1.0'); const GSound = (await import('gi://GSound')).default"
127     '';
128   }))
130   (patchExtension "system-monitor@gnome-shell-extensions.gcampax.github.com" (old: {
131     patches = [
132       (substituteAll {
133         src = ./extensionOverridesPatches/system-monitor_at_gnome-shell-extensions.gcampax.github.com.patch;
134         gtop_path = "${libgtop}/lib/girepository-1.0";
135       })
136     ];
137   }))
139   (patchExtension "system-monitor-next@paradoxxx.zero.gmail.com" (old: {
140     patches = [
141       (substituteAll {
142         src = ./extensionOverridesPatches/system-monitor-next_at_paradoxxx.zero.gmail.com.patch;
143         gtop_path = "${libgtop}/lib/girepository-1.0";
144       })
145     ];
146     meta.maintainers = with lib.maintainers; [ andersk ];
147   }))
149   (patchExtension "tophat@fflewddur.github.io" (old: {
150     patches = [
151       (substituteAll {
152         src = ./extensionOverridesPatches/tophat_at_fflewddur.github.io.patch;
153         gtop_path = "${libgtop}/lib/girepository-1.0";
154       })
155     ];
156   }))
158   (patchExtension "Vitals@CoreCoding.com" (old: {
159     patches = [
160       (substituteAll {
161         src = ./extensionOverridesPatches/vitals_at_corecoding.com.patch;
162         gtop_path = "${libgtop}/lib/girepository-1.0";
163       })
164     ];
165   }))
167   (patchExtension "x11gestures@joseexposito.github.io" (old: {
168     # Extension can't find Touchegg
169     # https://github.com/NixOS/nixpkgs/issues/137621
170     postPatch = ''
171       substituteInPlace "src/touchegg/ToucheggConfig.js" \
172         --replace "GLib.build_filenamev([GLib.DIR_SEPARATOR_S, 'usr', 'share', 'touchegg', 'touchegg.conf'])" "'${touchegg}/share/touchegg/touchegg.conf'"
173     '';
174   }))