1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

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>
This commit is contained in:
陈功
2026-03-12 12:47:36 -07:00
committed by Liliana Marie Prikler
parent 9bfbf735b9
commit fd9d0b3530
2 changed files with 54 additions and 1 deletions

View File

@@ -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

View File

@@ -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