feat: Configure XDG portal
This commit is contained in:
@@ -24,6 +24,37 @@ in {
|
|||||||
|
|
||||||
services.polkit-gnome.enable = true;
|
services.polkit-gnome.enable = true;
|
||||||
|
|
||||||
|
# File-picker.
|
||||||
|
home.packages = [ pkgs.nautilus ];
|
||||||
|
|
||||||
|
# Enable the XDG portal, an interface for programs to request
|
||||||
|
# permissions/resources. This is necessary to screen-cast on
|
||||||
|
# Wayland/Pipewire.
|
||||||
|
#
|
||||||
|
# See https://github.com/YaLTeR/niri/wiki/Important-Software#portals.
|
||||||
|
# Niri's NixOS module automatically brings in xdg-desktop-portal-gnome and
|
||||||
|
# gnome-keyring.
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
xdgOpenUsePortal = true;
|
||||||
|
|
||||||
|
extraPortals = [
|
||||||
|
pkgs.xdg-desktop-portal-gtk
|
||||||
|
pkgs.xdg-desktop-portal-gnome
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use xdg-desktop-portal-gtk by default, but fallback to
|
||||||
|
# xdg-desktop-portal-gnome for screenshots and screen-casts, two important
|
||||||
|
# features unsupported by the GTK implementation. See implementations and
|
||||||
|
# their supported interfaces at
|
||||||
|
# https://wiki.archlinux.org/title/XDG_Desktop_Portal.
|
||||||
|
config.niri = {
|
||||||
|
default = [ "gtk" ];
|
||||||
|
"org.freedesktop.impl.portal.Screenshot" = [ "gnome" ];
|
||||||
|
"org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.user.services.xwayland-satellite =
|
systemd.user.services.xwayland-satellite =
|
||||||
lib.mkIf cfg.xwayland-satellite.enable {
|
lib.mkIf cfg.xwayland-satellite.enable {
|
||||||
Service.ExecStart =
|
Service.ExecStart =
|
||||||
|
|||||||
@@ -15,24 +15,6 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
|
|
||||||
# Necessary for e.g. screensharing.
|
|
||||||
xdg.portal = {
|
|
||||||
enable = true;
|
|
||||||
# See https://github.com/YaLTeR/niri/wiki/Important-Software#portals.
|
|
||||||
# Niri's NixOS module appears to automatically bring in
|
|
||||||
# xdg-desktop-portal-gnome and gnome-keyring.
|
|
||||||
extraPortals = [
|
|
||||||
pkgs.xdg-desktop-portal-gtk
|
|
||||||
pkgs.xdg-desktop-portal-wlr
|
|
||||||
];
|
|
||||||
xdgOpenUsePortal = true;
|
|
||||||
config.preferred = {
|
|
||||||
default = [ "gtk" ];
|
|
||||||
"org.freedesktop.impl.portal.Screenshot" = [ "wlr" ];
|
|
||||||
"org.freedesktop.impl.portal.ScreenCast" = [ "wlr" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user