Enable wlr portal conditionally when wayland is active. Add sway-specific portal config routing ScreenCast and Screenshot interfaces through the wlr backend.
44 lines
1.0 KiB
Nix
44 lines
1.0 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.roles.desktop;
|
|
in
|
|
{
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [
|
|
brightnessctl
|
|
emacs-nox
|
|
moonlight-qt
|
|
];
|
|
|
|
programs.dconf.enable = true;
|
|
services.gnome.gnome-keyring.enable = true;
|
|
programs.kdeconnect.enable = true;
|
|
|
|
# XDG Desktop Portal for default application handling
|
|
xdg.portal = {
|
|
enable = true;
|
|
wlr.enable = cfg.wayland; # xdg-desktop-portal-wlr for Sway screen sharing
|
|
extraPortals = with pkgs; [
|
|
kdePackages.xdg-desktop-portal-kde # For KDE application integration
|
|
xdg-desktop-portal-gtk # Fallback for GTK applications
|
|
];
|
|
config = {
|
|
common = {
|
|
default = "kde";
|
|
};
|
|
i3 = {
|
|
default = ["kde" "gtk"];
|
|
};
|
|
sway = {
|
|
default = ["wlr" "gtk"];
|
|
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
|
|
"org.freedesktop.impl.portal.Screenshot" = "wlr";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|