diff --git a/hosts/common/programs/default.nix b/hosts/common/programs/default.nix index 3a5aed02..4191dad0 100644 --- a/hosts/common/programs/default.nix +++ b/hosts/common/programs/default.nix @@ -93,6 +93,7 @@ ./wob ./xarchiver.nix ./xdg-desktop-portal.nix + ./xdg-desktop-portal-gtk.nix ./xdg-utils.nix ./zeal.nix ./zecwallet-lite.nix diff --git a/hosts/common/programs/xdg-desktop-portal-gtk.nix b/hosts/common/programs/xdg-desktop-portal-gtk.nix new file mode 100644 index 00000000..3a14c0be --- /dev/null +++ b/hosts/common/programs/xdg-desktop-portal-gtk.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + sane.programs.xdg-desktop-portal-gtk = { + packageUnwrapped = pkgs.xdg-desktop-portal-gtk.overrideAttrs (upstream: { + postPatch = (upstream.postPatch or "") + '' + # configure to not advertise the Notification portal. + # this can be patched at source level, or after building, at `$out/share/xdg-desktop-portals/portals/gtk.portal`. + # by removing this, xdg-desktop-portal won't advertise `org.freedesktop.portal.Notification`, + # and so portal-capable applications will prefer the non-portal `org.freedesktop.Notifications`, + # which is what most notification daemons (swaync, mako, ...) speak. + substituteInPlace data/gtk.portal.in \ + --replace-fail 'org.freedesktop.impl.portal.Notification;' "" + ''; + }); + }; +}