{ config, lib, pkgs, ... }: let cfg = config.programs.niri; inherit (pkgs) xdg-desktop-portal-gtk xdg-desktop-portal-gnome; in { programs.niri = { enable = true; }; programs.xwayland.enable = lib.mkForce false; services.gnome.gnome-keyring.enable = true; environment.systemPackages = builtins.attrValues { inherit (pkgs) wmenu swaylock avizo playerctl xwayland-satellite; }; systemd.user.services.niri-polkit = { description = "PolicyKit Authentication Agent for niri"; wantedBy = ["niri.service"]; after = ["graphical-session.target"]; partOf = ["graphical-session.target"]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; }; }; services.displayManager.sessionPackages = [ cfg.package ]; xdg.portal = { enable = true; configPackages = [cfg.package]; # Recommended by upstream, required for screencast support # https://github.com/YaLTeR/niri/wiki/Important-Software#portals extraPortals = [ xdg-desktop-portal-gnome xdg-desktop-portal-gtk ]; }; }