diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 72729f1c1f66..c8a996dca089 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -105,6 +105,7 @@ in { gnome3.gnome-user-docs gnome3.file-roller + gnome3.gnome-tweak-tool ] config.environment.gnome3.excludePackages); }; diff --git a/pkgs/desktops/gnome-3/default.nix b/pkgs/desktops/gnome-3/default.nix index a6d4f6197d8c..4518293f68e2 100644 --- a/pkgs/desktops/gnome-3/default.nix +++ b/pkgs/desktops/gnome-3/default.nix @@ -162,4 +162,6 @@ rec { libgit2-glib = callPackage ./misc/libgit2-glib { }; gexiv2 = callPackage ./misc/gexiv2 { }; + + gnome-tweak-tool = callPackage ./misc/gnome-tweak-tool { }; } diff --git a/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/default.nix b/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/default.nix new file mode 100644 index 000000000000..2eccb9a32cf9 --- /dev/null +++ b/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/default.nix @@ -0,0 +1,46 @@ +{ stdenv, intltool, fetchurl, python, pygobject3, atk +, pkgconfig, gtk3, glib, hicolor_icon_theme, libsoup +, bash, makeWrapper, itstool, libxml2, python3Packages +, gnome3, librsvg, gdk_pixbuf, file, libnotify }: + +stdenv.mkDerivation rec { + name = "gnome-tweak-tool-3.10.1"; + + src = fetchurl { + url = "mirror://gnome/sources/gnome-tweak-tool/3.10/${name}.tar.xz"; + sha256 = "fb5af9022c0521a925ef9f295e4080212b1b45427cd5f5f3a901667590afa7ec"; + }; + + doCheck = true; + + propagatedUserEnvPkgs = [ gnome3.gnome_themes_standard ]; + + makeFlags = [ "DESTDIR=/" ]; + + buildInputs = [ pkgconfig gtk3 glib intltool itstool libxml2 + gnome3.gsettings_desktop_schemas makeWrapper file + gdk_pixbuf gnome3.gnome_icon_theme librsvg + hicolor_icon_theme gnome3.gnome_icon_theme_symbolic + python pygobject3 libnotify gnome3.gnome_shell + libsoup gnome3.gnome_settings_daemon gnome3.nautilus + gnome3.gnome_desktop ]; + + preFixup = '' + wrapProgram "$out/bin/gnome-tweak-tool" \ + --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \ + --prefix XDG_DATA_DIRS : "${gtk3}/share:${gnome3.gnome_themes_standard}/share:$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \ + --prefix LD_LIBRARY_PATH ":" "${libsoup}/lib:${gnome3.gnome_desktop}/lib:${libnotify}/lib:${gtk3}/lib:${atk}/lib" \ + --prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" + ''; + + patches = [ ./find_gsettings.patch ]; + + meta = with stdenv.lib; { + homepage = https://wiki.gnome.org/action/show/Apps/GnomeTweakTool; + description = "A tool to customize advanced GNOME 3 options"; + maintainers = with maintainers; [ lethalman ]; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/find_gsettings.patch b/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/find_gsettings.patch new file mode 100644 index 000000000000..3e68c04cb3ab --- /dev/null +++ b/pkgs/desktops/gnome-3/misc/gnome-tweak-tool/find_gsettings.patch @@ -0,0 +1,22 @@ +diff --git a/gtweak/gsettings.py b/gtweak/gsettings.py +index a00fe19..dce74b2 100644 +--- a/gtweak/gsettings.py ++++ b/gtweak/gsettings.py +@@ -33,10 +33,15 @@ class GSettingsMissingError(Exception): + + class _GSettingsSchema: + def __init__(self, schema_name, schema_dir=None, schema_filename=None, **options): +- if not schema_dir: +- schema_dir = gtweak.GSETTINGS_SCHEMA_DIR + if not schema_filename: + schema_filename = schema_name + ".gschema.xml" ++ if not schema_dir: ++ schema_dir = gtweak.GSETTINGS_SCHEMA_DIR ++ for xdg_dir in GLib.get_system_data_dirs(): ++ dir = os.path.join(xdg_dir, "glib-2.0", "schemas") ++ if os.path.exists(os.path.join(dir, schema_filename)): ++ schema_dir = dir ++ break + + schema_path = os.path.join(schema_dir, schema_filename) + if not os.path.exists(schema_path):