sway: allow rtprio to any user process (rtkit)

This commit is contained in:
Casper V. Kristensen 2025-01-22 10:12:58 +01:00
parent 2dd56076c0
commit 70b8a322ca
2 changed files with 18 additions and 6 deletions

View file

@ -13,10 +13,4 @@
jack.enable = true;
pulse.enable = true;
};
# RealtimeKit is a D-Bus system service that allows user processes to gain
# realtime scheduling priority on request. It is intended to be used as a
# secure mechanism to allow real-time scheduling to be used by normal user
# processes.
security.rtkit.enable = true;
}

View file

@ -329,6 +329,24 @@
wtype # xdotool for wayland
];
# RealtimeKit is a D-Bus system service that allows user processes to gain
# realtime scheduling priority on request. It is intended to be used as a
# secure mechanism to allow real-time scheduling to be used by normal user
# processes.
security.rtkit.enable = true;
# NixOS automatically allows PipeWire real-time scheduling -- allow it for
# any user process as per the Sway wiki.
# https://github.com/NixOS/nixpkgs/blob/c45b06d8d908c243f28829998fa403fa501b855e/nixos/modules/services/desktops/pipewire/pipewire.nix#L436-L456
# https://wiki.nixos.org/wiki/Sway#Inferior_performance_compared_to_other_distributions
security.pam.loginLimits = [
{
domain = "@users";
item = "rtprio";
type = "-";
value = 95;
}
];
# xdg portal allows applications secure access to resources outside their
# sandbox through a D-Bus interface. In particular, this allows screen
# sharing on Wayland via PipeWire and file open/save dialogues in Firefox.