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 /gnu/services | |
| 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>
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/dbus.scm | 38 |
1 files changed, 37 insertions, 1 deletions
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 @@ | |||
| 29 | #:use-module ((gnu packages glib) #:select (dbus)) | 29 | #:use-module ((gnu packages glib) #:select (dbus)) |
| 30 | #:use-module (gnu packages polkit) | 30 | #:use-module (gnu packages polkit) |
| 31 | #:use-module (gnu packages admin) | 31 | #:use-module (gnu packages admin) |
| 32 | #:use-module (gnu packages freedesktop) | ||
| 32 | #:use-module (guix deprecation) | 33 | #:use-module (guix deprecation) |
| 33 | #:use-module (guix gexp) | 34 | #:use-module (guix gexp) |
| 34 | #:use-module ((guix packages) #:select (package-name)) | 35 | #:use-module ((guix packages) #:select (package-name)) |
| @@ -45,7 +46,10 @@ | |||
| 45 | polkit-configuration | 46 | polkit-configuration |
| 46 | polkit-configuration? | 47 | polkit-configuration? |
| 47 | polkit-service-type | 48 | polkit-service-type |
| 48 | polkit-service)) ; deprecated | 49 | polkit-service ; deprecated |
| 50 | |||
| 51 | rtkit-configuration | ||
| 52 | rtkit-service-type)) | ||
| 49 | 53 | ||
| 50 | ;;; | 54 | ;;; |
| 51 | ;;; D-Bus. | 55 | ;;; D-Bus. |
| @@ -442,4 +446,36 @@ the capability to suspend the system if the user is logged in locally." | |||
| 442 | (service polkit-service-type | 446 | (service polkit-service-type |
| 443 | (polkit-configuration (polkit polkit)))) | 447 | (polkit-configuration (polkit polkit)))) |
| 444 | 448 | ||
| 449 | (define-record-type* <rtkit-configuration> | ||
| 450 | rtkit-configuration make-rtkit-configuration | ||
| 451 | rtkit-configuration? | ||
| 452 | (rtkit rtkit-configuration-rtkit | ||
| 453 | (default rtkit))) | ||
| 454 | |||
| 455 | (define %rtkit-account | ||
| 456 | ;; Account used by rtkit. | ||
| 457 | (user-account | ||
| 458 | (name "rtkit") | ||
| 459 | (group "nogroup") | ||
| 460 | (system? #t) | ||
| 461 | (comment "Realtime kit user") | ||
| 462 | (home-directory "/var/empty") | ||
| 463 | (shell (file-append shadow "/sbin/nologin")))) | ||
| 464 | |||
| 465 | (define rtkit-service-type | ||
| 466 | (let ((rtkit-package (compose list rtkit-configuration-rtkit))) | ||
| 467 | (service-type | ||
| 468 | (name 'rtkit) | ||
| 469 | (extensions | ||
| 470 | (list (service-extension | ||
| 471 | polkit-service-type rtkit-package) | ||
| 472 | (service-extension dbus-root-service-type rtkit-package) | ||
| 473 | (service-extension | ||
| 474 | account-service-type | ||
| 475 | (const (list %rtkit-account))))) | ||
| 476 | (default-value (rtkit-configuration)) | ||
| 477 | (description | ||
| 478 | "Return a service that sets up D-Bus and PolKit so that the Realtime Kit | ||
| 479 | daemon is readily usable.")))) | ||
| 480 | |||
| 445 | ;;; dbus.scm ends here | 481 | ;;; dbus.scm ends here |
