From 22834c42cc688b4e52a96d17b0d2a71698125239 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 14 Oct 2022 06:38:35 -0700 Subject: [PATCH] gnome.nautilus: use the gtk4 FileChooser settings schema (fixes crash-on-start) upstream PR for more context: with the recent nixpkgs bump from GNOME 42 -> 43, we build nautilus with gtk4 (as upstream expects). if the user has nothing else in their environment providing gtk3, then nautilus fails to locate a gtk3 gsettings schema it depends on. i.e. ```console $ nautilus (org.gnome.Nautilus): GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed ``` we could solve this on our end by adding gtk3 to `gappsWrapperArgs`, but this seems like an upstream bug: i believe they mean to use the gtk4 settings schemas instead of the legacy gtk3 ones. --- pkgs/desktops/gnome/core/nautilus/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/desktops/gnome/core/nautilus/default.nix b/pkgs/desktops/gnome/core/nautilus/default.nix index 5eacfdac5ba..48cc47b5d8e 100644 --- a/pkgs/desktops/gnome/core/nautilus/default.nix +++ b/pkgs/desktops/gnome/core/nautilus/default.nix @@ -1,5 +1,6 @@ { lib , stdenv +, fetchpatch , fetchurl , meson , ninja @@ -48,6 +49,17 @@ stdenv.mkDerivation rec { }; patches = [ + # Switch to GTK 4 settings schema to avoid crash when GTK 3 did not manage to contaminate environment. + # https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1013 + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/nautilus/-/commit/96d542a0d84da4ad6915a7727642490a5c433d4a.patch"; + sha256 = "BO/0ifRwSTDe7RV+DI3CPZg+UQezk0tbM+UidgoJRQM="; + }) + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/nautilus/-/commit/52b4daf4396fd3b21755b3a0d1fbf85c3831c6b1.patch"; + sha256 = "+8KCw2HZUi9UgOEUBNp4kbwqOI1qz6i0Q/wvzqTb8OA="; + }) + # Allow changing extension directory using environment variable. ./extension_dir.patch