diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2022-03-29 11:01:41 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2022-03-30 11:36:56 +0200 |
commit | 289a54ef8dc95e90ba20bb73751c5291d1aee881 (patch) | |
tree | eaf640fa3a6366a1d65ff868251f8c4588b1a3a0 /pkgs/desktops/gnome/core/dconf-editor | |
parent | 710fed5a2483f945b14f4a58af2cd3676b42d8c8 (diff) |
dconf-editor: Respect NIX_GSETTINGS_OVERRIDES_DIR variable
We patch GLib to recognize NIX_GSETTINGS_OVERRIDES_DIR environment variable as a high priority source of settings schemas. This is used by NixOS modules for desktop environments like GNOME to set default values for stuff like background image. Since dconf-editor uses custom GSettingsSchemaSource, it bypassed that patch, leading to the dconf-editor showing different values from what other apps using the GLib’s default source saw. Let’s mirror our GLib patch in dconf-editor to fix that.
Diffstat (limited to 'pkgs/desktops/gnome/core/dconf-editor')
-rw-r--r-- | pkgs/desktops/gnome/core/dconf-editor/default.nix | 6 | ||||
-rw-r--r-- | pkgs/desktops/gnome/core/dconf-editor/schema-override-variable.patch | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/desktops/gnome/core/dconf-editor/default.nix b/pkgs/desktops/gnome/core/dconf-editor/default.nix index 165980d7e9c13..ed1967eb816c3 100644 --- a/pkgs/desktops/gnome/core/dconf-editor/default.nix +++ b/pkgs/desktops/gnome/core/dconf-editor/default.nix @@ -27,6 +27,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-Vxr0x9rU8Em1PmzXKLea3fCMJ92ra8V7OW0hGGbueeM="; }; + patches = [ + # Look for compiled schemas in NIX_GSETTINGS_OVERRIDES_DIR + # environment variable, to match what we patched GLib to do. + ./schema-override-variable.patch + ]; + nativeBuildInputs = [ meson ninja diff --git a/pkgs/desktops/gnome/core/dconf-editor/schema-override-variable.patch b/pkgs/desktops/gnome/core/dconf-editor/schema-override-variable.patch new file mode 100644 index 0000000000000..feaa604e5b674 --- /dev/null +++ b/pkgs/desktops/gnome/core/dconf-editor/schema-override-variable.patch @@ -0,0 +1,14 @@ +diff --git a/editor/source-manager.vala b/editor/source-manager.vala +index 27b2b17a..87f7ba86 100644 +--- a/editor/source-manager.vala ++++ b/editor/source-manager.vala +@@ -121,6 +121,9 @@ private class SourceManager : Object + source = try_prepend_dir (source, Path.build_filename (system_data_dirs [i], "glib-2.0", "schemas")); + string user_data_dir = GLib.Environment.get_user_data_dir (); + source = try_prepend_dir (source, Path.build_filename (user_data_dir, "glib-2.0", "schemas")); ++ string? nix_var_schema_dir = GLib.Environment.get_variable ("NIX_GSETTINGS_OVERRIDES_DIR"); ++ if (nix_var_schema_dir != null) ++ source = try_prepend_dir (source, (!) nix_var_schema_dir); + string? var_schema_dir = GLib.Environment.get_variable ("GSETTINGS_SCHEMA_DIR"); + if (var_schema_dir != null) + source = try_prepend_dir (source, (!) var_schema_dir); |