1# A module for ‘rtkit’, a DBus system service that hands out realtime 2# scheduling priority to processes that ask for it. 3 4{ config, lib, pkgs, ... }: 5 6with lib; 7 8{ 9 10 options = { 11 12 security.rtkit.enable = mkOption { 13 type = types.bool; 14 default = false; 15 description = '' 16 Whether to enable the RealtimeKit system service, which hands 17 out realtime scheduling priority to user processes on 18 demand. For example, the PulseAudio server uses this to 19 acquire realtime priority. 20 ''; 21 }; 22 23 }; 24 25 26 config = mkIf config.security.rtkit.enable { 27 28 security.polkit.enable = true; 29 30 # To make polkit pickup rtkit policies 31 environment.systemPackages = [ pkgs.rtkit ]; 32 33 systemd.packages = [ pkgs.rtkit ]; 34 35 services.dbus.packages = [ pkgs.rtkit ]; 36 37 users.extraUsers = singleton 38 { name = "rtkit"; 39 uid = config.ids.uids.rtkit; 40 description = "RealtimeKit daemon"; 41 }; 42 43 }; 44 45}