firefox/wrapper: inject gsettings schema paths into XDG_DATA_DIRS

614574d1b0 ("firefox/wrapper: enable
strictDeps") was backported to release-26.05 to allow to backport a new
Thunderbird ESR release.

This broke injection of gsettings schema paths into XDG_DATA_DIRS for
both Thunderbird and Firefox (on Linux). This resulted in empty menus
with no text or icons in both apps when running with Wayland (X11 seems
to be not affected).

The issue is not present on master which has a fix to gapps wrapper
hook: a0ee897044 ("wrapGAppsHook: prepare
for structuredAttrs") that fixes incorrect output being wrapped for
mozilla wrapped apps (among other things).

We can pursue a backport of the wrapGAppsHook fix in 26.05:
https://github.com/NixOS/nixpkgs/pull/546281

But since it will take some time for it to arrive to release-26.05, this
patch attempts to fix the immediate issue in the firefox wrapper
instead.

Fixes #546204

Not-cherry-picked-because: wrapGAppsHook is already fixed on master.
This commit is contained in:
Ihar Hrachyshka
2026-07-27 08:25:47 -04:00
parent f7a2e428f5
commit bffe6b0982

View File

@@ -6,6 +6,7 @@
lndir,
config,
buildPackages,
gsettings-desktop-schemas,
jq,
xdg-utils,
writeText,
@@ -134,6 +135,12 @@ let
++ pkcs11Modules
++ lib.optionals (!isDarwin) gtk_modules;
gtk_modules = lib.optionals (!isDarwin) [ libcanberra-gtk3 ];
# strictDeps prevents buildInputs from populating GSETTINGS_SCHEMAS_PATH.
# Revert when https://github.com/NixOS/nixpkgs/pull/546281 hits stable.
gsettingsSchemaPaths = lib.optionals (!isDarwin) [
"${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
"${browser.gtk3}/share/gsettings-schemas/${browser.gtk3.name}"
];
# Darwin does not rename bundled binaries
launcherName = "${applicationName}${lib.optionalString (!isDarwin) nameSuffix}";
@@ -339,6 +346,11 @@ let
":"
"${adwaita-icon-theme}/share"
"--prefix"
"XDG_DATA_DIRS"
":"
(lib.concatStringsSep ":" gsettingsSchemaPaths)
"--set-default"
"MOZ_ENABLE_WAYLAND"
"1"
@@ -486,9 +498,6 @@ let
mv "$executablePath" "$oldExe"
fi
''
+ lib.optionalString (!isDarwin) ''
appendToVar makeWrapperArgs --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
''
+ ''
concatTo makeWrapperArgs oldWrapperArgs