From bffe6b0982f3facbceb2cfebca5b75622d1180bb Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Mon, 27 Jul 2026 08:25:47 -0400 Subject: [PATCH] firefox/wrapper: inject gsettings schema paths into XDG_DATA_DIRS 614574d1b002e82286c68fabc39ec29a95825680 ("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: a0ee89704420278abb4c28c7b974500b0d19d39c ("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. --- .../networking/browsers/firefox/wrapper.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index d945a0a3d063..3befbc5047e1 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -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