Files
nixpkgs/pkgs/by-name/xd/xdg-utils/allow-forcing-portal-use.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

30 lines
897 B
Diff

From 835eed6a2b975fba40c3ac18b4cf5429ba9d2836 Mon Sep 17 00:00:00 2001
From: Luna Nova <git@lunnova.dev>
Date: Wed, 7 Sep 2022 08:45:56 -0700
Subject: [PATCH] xdg-open: add $XDG_OPEN_USE_PORTAL env var
When set, the same mechanism that is used in a flatpak is used,
a dbus call to the portal. This is useful for distros with non-flatpak
wrapper or sandboxing features which require the same treatment, eg NixOS.
See https://github.com/NixOS/nixpkgs/issues/160923
---
scripts/xdg-open.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
index 8de839a..80d8fb3 100644
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
@@ -508,6 +508,10 @@ if [ x"$DE" = x"" ]; then
DE=generic
fi
+if [ -n "$NIXOS_XDG_OPEN_USE_PORTAL" ]; then
+ DE=flatpak
+fi
+
DEBUG 2 "Selected DE $DE"
# sanitize BROWSER (avoid calling ourselves in particular)