2024-02-12 01:16:17 +00:00
|
|
|
{ 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";
|
|
|
|
};
|
|
|
|
|
2024-02-12 01:33:34 +00:00
|
|
|
# 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:
|
2024-02-12 01:16:17 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
}
|