xdg-desktop-portal-gtk: build without support for notifications

This commit is contained in:
Colin 2024-02-14 10:51:18 +00:00
parent 03b58b3cab
commit c9e02bfd8a
2 changed files with 17 additions and 0 deletions

View File

@ -93,6 +93,7 @@
./wob
./xarchiver.nix
./xdg-desktop-portal.nix
./xdg-desktop-portal-gtk.nix
./xdg-utils.nix
./zeal.nix
./zecwallet-lite.nix

View File

@ -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;' ""
'';
});
};
}