2024-02-19 13:44:23 +00:00
|
|
|
{ config, pkgs, ... }:
|
2024-02-19 12:48:39 +00:00
|
|
|
let
|
|
|
|
cfg = config.sane.programs.xdg-desktop-portal-wlr;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
sane.programs.xdg-desktop-portal-wlr = {
|
2024-02-19 13:44:23 +00:00
|
|
|
# rmDbusServices: because we care about ordering with the rest of the desktop, and don't want something else to auto-start this.
|
|
|
|
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.xdg-desktop-portal-wlr;
|
|
|
|
|
|
|
|
sandbox.method = "bwrap"; # TODO:sandbox: untested
|
2024-03-01 21:17:31 +00:00
|
|
|
sandbox.whitelistAudio = true;
|
2024-02-19 13:44:23 +00:00
|
|
|
sandbox.whitelistDbus = [ "user" ]; # speak to main xdg-desktop-portal
|
2024-03-01 21:17:31 +00:00
|
|
|
sandbox.whitelistDri = true;
|
2024-02-19 13:44:23 +00:00
|
|
|
sandbox.whitelistWayland = true;
|
2024-03-01 21:17:31 +00:00
|
|
|
sandbox.extraPaths = [
|
|
|
|
# not sure why it needs these
|
|
|
|
"/sys/dev/char"
|
|
|
|
"/sys/devices"
|
|
|
|
];
|
2024-02-19 13:44:23 +00:00
|
|
|
|
2024-02-19 12:48:39 +00:00
|
|
|
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";
|
2024-02-19 13:44:23 +00:00
|
|
|
|
|
|
|
services.xdg-desktop-portal-wlr = {
|
|
|
|
description = "xdg-desktop-portal-wlr backend (provides screenshot functionality for xdg-desktop-portal)";
|
2024-04-02 09:01:35 +00:00
|
|
|
depends = [ "pipewire" ]; # refuses to start without it
|
2024-03-21 16:02:06 +00:00
|
|
|
dependencyOf = [ "xdg-desktop-portal" ];
|
2024-04-02 09:01:35 +00:00
|
|
|
# partOf = [ "graphical-session" ];
|
2024-02-19 13:44:23 +00:00
|
|
|
|
2024-03-21 15:05:23 +00:00
|
|
|
command = "${cfg.package}/libexec/xdg-desktop-portal-wlr";
|
2024-03-21 16:59:04 +00:00
|
|
|
readiness.waitDbus = "org.freedesktop.impl.portal.desktop.wlr";
|
2024-02-19 13:44:23 +00:00
|
|
|
};
|
2024-02-19 12:48:39 +00:00
|
|
|
};
|
|
|
|
}
|