diff options
| author | 陈功 <andy@andycbruce.com> | 2026-03-12 12:47:36 -0700 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-03-19 07:37:06 +0100 |
| commit | fd9d0b3530485305033cfea37e0dc96f85209011 (patch) | |
| tree | c7ed77cbdcac1b0b4a82a388be2a89661fafbddc | |
| parent | 9bfbf735b916253c4601ca74b8d3dca6d90584f2 (diff) | |
services: dbus: Add rtkit service.
* gnu/services/dbus.scm (rtkit-service-type): New variable.
(rtkit-configuration): New record.
Change-Id: I5078cb5032824c7799e7d26962911bbc67527562
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | doc/guix.texi | 17 | ||||
| -rw-r--r-- | gnu/services/dbus.scm | 38 |
2 files changed, 54 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 476a3e036cc..e7bcd174a8e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -27860,6 +27860,23 @@ Log level to output logs. Possible values: @samp{"silent"}, @samp{"error"}, @end table @end deftp +@defvar rtkit-service-type +Type for the service that allows D-Bus to start the RealtimeKit D-Bus +service. The RTKit service provides a system D-Bus interface for user +processes, such as PipeWire, to securely use realtime scheduling. + +The value for this service is a @code{<rtkit-configuration>} object. +@end defvar + +@deftp {Data Type} rtkit-configuration +Data type representing the configuration for @code{rtkit-service-type}. + +@table @asis +@item @code{rtkit} (default: @code{rtkit}) (type: file-like) +Package object for RTKit. + +@end table +@end deftp @node Sound Services @subsection Sound Services diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 76e04bf2215..40f2c9264ef 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -29,6 +29,7 @@ #:use-module ((gnu packages glib) #:select (dbus)) #:use-module (gnu packages polkit) #:use-module (gnu packages admin) + #:use-module (gnu packages freedesktop) #:use-module (guix deprecation) #:use-module (guix gexp) #:use-module ((guix packages) #:select (package-name)) @@ -45,7 +46,10 @@ polkit-configuration polkit-configuration? polkit-service-type - polkit-service)) ; deprecated + polkit-service ; deprecated + + rtkit-configuration + rtkit-service-type)) ;;; ;;; D-Bus. @@ -442,4 +446,36 @@ the capability to suspend the system if the user is logged in locally." (service polkit-service-type (polkit-configuration (polkit polkit)))) +(define-record-type* <rtkit-configuration> + rtkit-configuration make-rtkit-configuration + rtkit-configuration? + (rtkit rtkit-configuration-rtkit + (default rtkit))) + +(define %rtkit-account + ;; Account used by rtkit. + (user-account + (name "rtkit") + (group "nogroup") + (system? #t) + (comment "Realtime kit user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin")))) + +(define rtkit-service-type + (let ((rtkit-package (compose list rtkit-configuration-rtkit))) + (service-type + (name 'rtkit) + (extensions + (list (service-extension + polkit-service-type rtkit-package) + (service-extension dbus-root-service-type rtkit-package) + (service-extension + account-service-type + (const (list %rtkit-account))))) + (default-value (rtkit-configuration)) + (description + "Return a service that sets up D-Bus and PolKit so that the Realtime Kit +daemon is readily usable.")))) + ;;; dbus.scm ends here |
