xdg-desktop-portal: fix it to find all the portal configs again
maybe i broke this when i simplified XDG_CONFIG_DIRS? not sure
This commit is contained in:
@@ -98,6 +98,8 @@
|
|||||||
./wob
|
./wob
|
||||||
./xarchiver.nix
|
./xarchiver.nix
|
||||||
./xdg-desktop-portal.nix
|
./xdg-desktop-portal.nix
|
||||||
|
./xdg-desktop-portal-gtk.nix
|
||||||
|
./xdg-desktop-portal-wlr.nix
|
||||||
./xdg-utils.nix
|
./xdg-utils.nix
|
||||||
./zeal.nix
|
./zeal.nix
|
||||||
./zecwallet-lite.nix
|
./zecwallet-lite.nix
|
||||||
|
13
hosts/common/programs/xdg-desktop-portal-gtk.nix
Normal file
13
hosts/common/programs/xdg-desktop-portal-gtk.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.xdg-desktop-portal-gtk;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.xdg-desktop-portal-gtk = {
|
||||||
|
fs.".config/xdg-desktop-portal/portals/gtk.portal".symlink.target =
|
||||||
|
"${cfg.package}/share/xdg-desktop-portal/portals/gtk.portal";
|
||||||
|
# XXX: overcome bug when manually setting `$XDG_DESKTOP_PORTAL_DIR`
|
||||||
|
# which causes *.portal files to be looked for in the toplevel instead of under `portals/`
|
||||||
|
fs.".config/xdg-desktop-portal/gtk.portal".symlink.target = "portals/gtk.portal";
|
||||||
|
};
|
||||||
|
}
|
13
hosts/common/programs/xdg-desktop-portal-wlr.nix
Normal file
13
hosts/common/programs/xdg-desktop-portal-wlr.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.xdg-desktop-portal-wlr;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.xdg-desktop-portal-wlr = {
|
||||||
|
fs.".config/xdg-desktop-portal/portals/wlr.portal".symlink.target =
|
||||||
|
"${cfg.package}/share/xdg-desktop-portal/portals/wlr.portal";
|
||||||
|
# XXX: overcome bug when manually setting `$XDG_DESKTOP_PORTAL_DIR`
|
||||||
|
# which causes *.portal files to be looked for in the toplevel instead of under `portals/`
|
||||||
|
fs.".config/xdg-desktop-portal/wlr.portal".symlink.target = "portals/wlr.portal";
|
||||||
|
};
|
||||||
|
}
|
@@ -4,7 +4,9 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.programs.xdg-desktop-portal = {
|
sane.programs.xdg-desktop-portal = {
|
||||||
packageUnwrapped = pkgs.xdg-desktop-portal.overrideAttrs (upstream: {
|
# rmDbusServices: because we care about ordering with the rest of the desktop, and don't want something else to auto-start this.
|
||||||
|
packageUnwrapped = pkgs.rmDbusServices (
|
||||||
|
pkgs.xdg-desktop-portal.overrideAttrs (upstream: {
|
||||||
postPatch = (upstream.postPatch or "") + ''
|
postPatch = (upstream.postPatch or "") + ''
|
||||||
# wherever we have a default mime association, don't prompt the user to choose an app.
|
# wherever we have a default mime association, don't prompt the user to choose an app.
|
||||||
# tracking issues about exposing this formally:
|
# tracking issues about exposing this formally:
|
||||||
@@ -18,34 +20,41 @@ in
|
|||||||
substituteInPlace --replace-fail src/open-uri.c \
|
substituteInPlace --replace-fail src/open-uri.c \
|
||||||
'#define DEFAULT_THRESHOLD 3' '#define DEFAULT_THRESHOLD 0'
|
'#define DEFAULT_THRESHOLD 3' '#define DEFAULT_THRESHOLD 0'
|
||||||
'';
|
'';
|
||||||
});
|
})
|
||||||
|
);
|
||||||
|
|
||||||
# the portal is a launcher, needs to handle anything
|
# the portal is a launcher, needs to handle anything
|
||||||
sandbox.enable = false;
|
sandbox.enable = false;
|
||||||
|
|
||||||
services.xdg-desktop-portal = {
|
services.xdg-desktop-portal = {
|
||||||
description = "Portal service";
|
description = "xdg-desktop-portal freedesktop.org portal (URI opener, file chooser, etc)";
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
# partOf = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart="${cfg.package}/libexec/xdg-desktop-portal";
|
ExecStart="${cfg.package}/libexec/xdg-desktop-portal";
|
||||||
Type = "dbus";
|
Type = "simple";
|
||||||
BusName = "org.freedesktop.portal.Desktop";
|
Restart = "always";
|
||||||
|
RestartSec = "10s";
|
||||||
|
# Type = "dbus";
|
||||||
|
# BusName = "org.freedesktop.portal.Desktop";
|
||||||
};
|
};
|
||||||
|
|
||||||
# xdg-desktop-portal expects to act as a strict frontend and manage xdg-desktop-portal-{gtk,wlr,etc} itself,
|
|
||||||
# which means it needs to know how which endpoints each backend provides and how to launch it,
|
|
||||||
# encoded in /share/xdg-desktop-portal/portals:
|
|
||||||
#
|
|
||||||
# tracking issue for having xdg-desktop-portal locate portals via more standard directories, obviating this var:
|
# tracking issue for having xdg-desktop-portal locate portals via more standard directories, obviating this var:
|
||||||
# - <https://github.com/flatpak/xdg-desktop-portal/issues/603>
|
# - <https://github.com/flatpak/xdg-desktop-portal/issues/603>
|
||||||
environment.XDG_DESKTOP_PORTAL_DIR = "/etc/profiles/per-user/%u/share/xdg-desktop-portal/portals";
|
# i can actually almost omit it today; problem is that if you don't set it it'll look for `sway-portals.conf` in ~/.config/xdg-desktop-portal
|
||||||
|
# but then will check its *own* output dir for {gtk,wlr}.portal.
|
||||||
|
# arguable if that's a packaging bug, or limitation...
|
||||||
|
environment.XDG_DESKTOP_PORTAL_DIR = "%E/xdg-desktop-portal";
|
||||||
|
|
||||||
environment.G_MESSAGES_DEBUG = "all";
|
environment.G_MESSAGES_DEBUG = "all";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.pathsToLink = lib.mkIf cfg.enabled [
|
# after #603 is resolved, i can probably stop linking `{gtk,wlr}.portal` into ~
|
||||||
"/share/xdg-desktop-portal/portals"
|
# and link them system-wide instead.
|
||||||
];
|
# environment.pathsToLink = lib.mkIf cfg.enabled [
|
||||||
|
# "/share/xdg-desktop-portal/portals"
|
||||||
|
# ];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user