diff --git a/nixos/modules/services/x11/desktop-managers/gnome.nix b/nixos/modules/services/x11/desktop-managers/gnome.nix index c5013292e29b8..cb13073766fa9 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome.nix @@ -372,7 +372,10 @@ in xdg.portal.enable = true; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gnome - pkgs.xdg-desktop-portal-gtk + (pkgs.xdg-desktop-portal-gtk.override { + # Do not build portals that we already have. + buildPortalsInGnome = false; + }) ]; # Harmonize Qt5 application style and also make them use the portal for file chooser dialog. diff --git a/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix b/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix index 93a308a658da4..08d695c15e53e 100644 --- a/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix +++ b/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix @@ -1,5 +1,7 @@ -{ lib, stdenv +{ stdenv +, lib , fetchFromGitHub +, fetchpatch , autoreconfHook , pkg-config , libxml2 @@ -9,19 +11,33 @@ , glib , wrapGAppsHook , gsettings-desktop-schemas +, buildPortalsInGnome ? true }: stdenv.mkDerivation rec { pname = "xdg-desktop-portal-gtk"; - version = "1.8.0"; + version = "1.10.0"; src = fetchFromGitHub { owner = "flatpak"; repo = pname; rev = version; - sha256 = "0987fwsdgkcd3mh3scvg2kyg4ay1rr5w16js4pl3pavw9yhl9lbi"; + sha256 = "7w+evZLtmTmDHVVsw25bJz99xtlSCE8qTFSxez9tlZk="; }; + patches = [ + # Fix broken translation. + # https://github.com/flatpak/xdg-desktop-portal-gtk/issues/353 + (fetchpatch { + url = "https://github.com/flatpak/xdg-desktop-portal-gtk/commit/e34f49ca8365801a7fcacccb46ab1e62aec17435.patch"; + sha256 = "umMsSP0fuSQgxlHLaZlg25ln1aAL1mssWzPMIWAOUt4="; + }) + (fetchpatch { + url = "https://github.com/flatpak/xdg-desktop-portal-gtk/commit/19c5385b9f5fe0f8dac8ae7cc4493bb08f802de6.patch"; + sha256 = "nbmOb5er20zBOO4K2geYITafqBaNHbDpq1OOvIVD6hY="; + }) + ]; + nativeBuildInputs = [ autoreconfHook libxml2 @@ -38,6 +54,15 @@ stdenv.mkDerivation rec { gnome.gnome-settings-daemon # schemas needed for settings api (mostly useless now that fonts were moved to g-d-s) ]; + configureFlags = lib.optionals buildPortalsInGnome [ + "--enable-wallpaper" + "--enable-screenshot" + "--enable-screencast" + "--enable-background" + "--enable-settings" + "--enable-appchooser" + ]; + meta = with lib; { description = "Desktop integration portals for sandboxed apps"; maintainers = with maintainers; [ jtojnar ];