Add modules.desktop.portals, enabled by the desktop aggregator, pinning the XDG desktop portal routing explicitly: the three interfaces the Hyprland portal implements (screencast, screenshot, global shortcuts) go to Hyprland, and GTK is the default for file dialogs and appearance. The backend packages already arrive with the Hyprland compositor integration, so this module owns only the routing, which was previously empty and rode on the config file the Hyprland package happens to ship. Making it a first-class module so in-app screen sharing does not depend on that incidental default.
23 lines
775 B
Nix
23 lines
775 B
Nix
{ config, lib, ... }:
|
|
# XDG desktop portal routing for in-app screen sharing and file dialogs.
|
|
let
|
|
cfg = config.modules.desktop.portals;
|
|
in
|
|
{
|
|
options.modules.desktop.portals.enable =
|
|
lib.mkEnableOption "XDG desktop portals for in-app screen sharing and file dialogs";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
# The backend packages arrive with the compositor, so only the routing is set
|
|
# here.
|
|
# GTK is the default backend, and the three compositor-native requests go to
|
|
# Hyprland.
|
|
xdg.portal.config.common = {
|
|
default = [ "gtk" ];
|
|
"org.freedesktop.impl.portal.ScreenCast" = [ "hyprland" ];
|
|
"org.freedesktop.impl.portal.Screenshot" = [ "hyprland" ];
|
|
"org.freedesktop.impl.portal.GlobalShortcuts" = [ "hyprland" ];
|
|
};
|
|
};
|
|
}
|