don't rebuild half the world for the gtk3 patch

This commit is contained in:
Henry Hiles 2026-12-01 11:50:00 -05:00
commit fb5e14091e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -14,23 +14,36 @@
android_sdk.accept_license = true; android_sdk.accept_license = true;
allowUnfree = true; allowUnfree = true;
}; };
overlays = [
(_: prev: {
# Without this, GTK3 can't create a GL context on Mesa builds without GLES 1
# (Flathub's since 26.2.8). Drop once nixpkgs has a GTK3 release with it.
gtk3 = prev.gtk3.overrideAttrs (old: {
patches = old.patches or [ ] ++ [ ./patches/gtk3-egl-renderable-type.patch ];
});
})
];
}; };
packages = packages =
let let
default = pkgs.callPackage ./pkg { unpatched = pkgs.callPackage ./pkg {
src = self; src = self;
commit = self.shortRev or self.dirtyShortRev; commit = self.shortRev or self.dirtyShortRev;
}; };
# Without this, GTK3 can't create a GL context on Mesa builds without GLES 1
# (Flathub's since 26.2.8). Drop once nixpkgs has a GTK3 release with it.
# Swapped into the finished closure, as an overlay would rebuild half of nixpkgs
withPatchedGtk =
drv:
pkgs.replaceDependencies {
inherit drv;
replacements = [
{
oldDependency = pkgs.gtk3;
newDependency = pkgs.gtk3.overrideAttrs (old: {
patches = old.patches or [ ] ++ [ ./patches/gtk3-egl-renderable-type.patch ];
});
}
];
}
// {
inherit (drv) pname version meta;
};
default = withPatchedGtk unpatched;
in in
{ {
inherit default; inherit default;
@ -41,12 +54,14 @@
appId = "nexus.federated.nexus"; appId = "nexus.federated.nexus";
# The runtime's GStreamer gets loaded instead of ours, and it can't # The runtime's GStreamer gets loaded instead of ours, and it can't
# load our plugins, so keep wrapGAppsHook from pointing it at them # load our plugins, so keep wrapGAppsHook from pointing it at them
package = default.overrideAttrs (old: { package = withPatchedGtk (
unpatched.overrideAttrs (old: {
postInstall = '' postInstall = ''
unset GST_PLUGIN_SYSTEM_PATH_1_0 unset GST_PLUGIN_SYSTEM_PATH_1_0
'' ''
+ old.postInstall; + old.postInstall;
}); })
);
runtime = "org.gnome.Platform/51"; runtime = "org.gnome.Platform/51";
permissions = { permissions = {
share = [ "network" ]; share = [ "network" ];