From da13d40d003f94c39721a5b015bd7e5071313db5 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Mon, 6 Apr 2026 19:24:28 -0400 Subject: [PATCH] nixos/hyprland: add cap_sys_nice capability On startup, Hyprland tries to set its own scheduling policy to SCHED_RR for a boost in responsiveness when the system is under load. This requires the cap_sys_nice capability to function. --- nixos/modules/programs/wayland/hyprland.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index 744f7af70fe5..8e6e7ea3f2f4 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -83,6 +83,15 @@ in { environment.systemPackages = [ cfg.package ]; + # Hyprland needs permissions to give itself SCHED_RR on startup: + # https://github.com/hyprwm/Hyprland/blob/main/src/init/initHelpers.cpp + security.wrappers.Hyprland = { + owner = "root"; + group = "root"; + capabilities = "cap_sys_nice+ep"; + source = lib.getExe cfg.package; + }; + xdg.portal = { enable = true; extraPortals = [ cfg.portalPackage ];