xdg-desktop-portal(s): dont install globally
This commit is contained in:
@@ -91,6 +91,8 @@
|
|||||||
./wireshark.nix
|
./wireshark.nix
|
||||||
./wob.nix
|
./wob.nix
|
||||||
./xarchiver.nix
|
./xarchiver.nix
|
||||||
|
./xdg-desktop-portal.nix
|
||||||
|
./xdg-desktop-portal-gtk.nix
|
||||||
./xdg-utils.nix
|
./xdg-utils.nix
|
||||||
./zeal.nix
|
./zeal.nix
|
||||||
./zecwallet-lite.nix
|
./zecwallet-lite.nix
|
||||||
|
24
hosts/common/programs/xdg-desktop-portal-gtk.nix
Normal file
24
hosts/common/programs/xdg-desktop-portal-gtk.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.xdg-desktop-portal-gtk;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.xdg-desktop-portal-gtk = {
|
||||||
|
# the portal handles things like file/app open requests, so it needs access to everything
|
||||||
|
# any installed app might require.
|
||||||
|
sandbox.enable = false;
|
||||||
|
|
||||||
|
services.xdg-desktop-portal-gtk = {
|
||||||
|
# xdg-desktop-portal-gtk provides the service/dbus file, but doesn't link the right `wantedBy`
|
||||||
|
# so have to recreate it here :(
|
||||||
|
description = "Portal service (GTK/GNOME implementation)";
|
||||||
|
wantedBy = [ "xdg-desktop-portal.service" ];
|
||||||
|
before = [ "xdg-desktop-portal.service" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-gtk";
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "org.freedesktop.impl.portal.desktop.gtk";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
26
hosts/common/programs/xdg-desktop-portal.nix
Normal file
26
hosts/common/programs/xdg-desktop-portal.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.sane.programs.xdg-desktop-portal;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.xdg-desktop-portal = {
|
||||||
|
services.xdg-desktop-portal = {
|
||||||
|
description = "Portal service";
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart="${cfg.package}/libexec/xdg-desktop-portal";
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "org.freedesktop.portal.Desktop";
|
||||||
|
};
|
||||||
|
|
||||||
|
# xdg-desktop-portal needs to know where to find xdg-desktop-portal-gtk, etc, for some reason (???).
|
||||||
|
# otherwise, it won't expose stuff like the OpenURI endpoint, even if a suitable AppChooser is available on dbus.
|
||||||
|
environment.XDG_DESKTOP_PORTAL_DIR = "/etc/profiles/per-user/%u/share/xdg-desktop-portal/portals";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.pathsToLink = lib.mkIf cfg.enabled [
|
||||||
|
"/share/xdg-desktop-portal/portals"
|
||||||
|
];
|
||||||
|
}
|
@@ -179,6 +179,9 @@ in
|
|||||||
"wdisplays" # like xrandr
|
"wdisplays" # like xrandr
|
||||||
"wl-clipboard"
|
"wl-clipboard"
|
||||||
"wob" # render volume changes on-screen
|
"wob" # render volume changes on-screen
|
||||||
|
"xdg-desktop-portal"
|
||||||
|
"xdg-desktop-portal-gtk"
|
||||||
|
"xdg-desktop-portal-wlr"
|
||||||
"xdg-terminal-exec" # used by sway config
|
"xdg-terminal-exec" # used by sway config
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -336,10 +339,6 @@ in
|
|||||||
# # })
|
# # })
|
||||||
# ];
|
# ];
|
||||||
|
|
||||||
|
|
||||||
# portals: i manage them myself
|
|
||||||
environment.systemPackages = [ pkgs.xdg-desktop-portal-gtk ];
|
|
||||||
services.dbus.packages = [ pkgs.xdg-desktop-portal-gtk ];
|
|
||||||
environment.etc."xdg/xdg-desktop-portal/sway-portals.conf".text = ''
|
environment.etc."xdg/xdg-desktop-portal/sway-portals.conf".text = ''
|
||||||
[preferred]
|
[preferred]
|
||||||
default=wlr;gtk
|
default=wlr;gtk
|
||||||
|
@@ -1,16 +1,7 @@
|
|||||||
{ lib, pkgs, ... }:
|
# TODO: fold into sway
|
||||||
|
{ ... }:
|
||||||
{
|
{
|
||||||
# otherwise /share/applications gets linked into the system and complicates things (sandboxing)
|
# otherwise /share/applications gets linked into the system and complicates things (sandboxing)
|
||||||
xdg.portal.enable = false;
|
xdg.portal.enable = false;
|
||||||
xdg.menus.enable = false; #< links /share/applications, and a bunch of other empty (i.e. unused) dirs
|
xdg.menus.enable = false; #< links /share/applications, and a bunch of other empty (i.e. unused) dirs
|
||||||
|
|
||||||
environment.pathsToLink = [
|
|
||||||
"/share/xdg-desktop-portal/portals"
|
|
||||||
];
|
|
||||||
# TODO: probably not needed?
|
|
||||||
environment.sessionVariables.XDG_DESKTOP_PORTAL_DIR = "/run/current-system/sw/share/xdg-desktop-portal/portals";
|
|
||||||
|
|
||||||
# TODO: use `sane.programs`, and move into gui package sets so this doesn't appear on servo
|
|
||||||
environment.systemPackages = [ pkgs.xdg-desktop-portal ];
|
|
||||||
services.dbus.packages = [ pkgs.xdg-desktop-portal ];
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user