diff options
| author | dan <i@dan.games> | 2025-10-16 23:59:14 +0800 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-11-07 18:39:59 +0100 |
| commit | 78f05b29c1d8a2558098d3783efd709319bdccc1 (patch) | |
| tree | 5d694ec6dc387b2106a15c501c57e2e45690d880 | |
| parent | ae147ef7bc21d546f0fa7765542f5a2c219c1dab (diff) | |
gnu: Add iio-sensor-proxy-service-type.
* gnu/services/desktop.scm (iio-sensor-proxy-configuration)
(iio-sensor-proxy-shepherd-service, iio-sensor-proxy-service-type): New
variables.
* doc/guix.texi (Desktop Services): Document iio-sensor-proxy-service-type.
Change-Id: I0c3d7164efcc499e4b785fd1f994c68a971ebdbd
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | doc/guix.texi | 32 | ||||
| -rw-r--r-- | gnu/services/desktop.scm | 50 |
2 files changed, 82 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 55eaabf0dbb..8ce1492a3b4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -145,6 +145,7 @@ Copyright @copyright{} 2025 jgart@* Copyright @copyright{} 2025 Artur Wroblewski@* Copyright @copyright{} 2025 Edouard Klein@* Copyright @copyright{} 2025 Rodion Goritskov@* +Copyright @copyright{} 2025 dan@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -27046,6 +27047,37 @@ The value for this service is a @code{<geoclue-configuration>} object. @c TODO: Document <geoclue-configuration>, preferably by refactoring this to use @c define-configuration and generating documentation from it. +@defvar iio-sensor-proxy-service-type +Type for the service that runs +@uref{https://gitlab.freedesktop.org/hadess/iio-sensor-proxy, IIO sensor +proxy}, a daemon that proxies low-level sensor data from Industrial I/O +(IIO) devices into a D-Bus interface. It enables user-space +applications, such as desktop environments like GNOME and KDE, and +services like GeoClue, to access data from various sensors commonly +found in devices like ultrabooks and 2-in-1s. This allows for: + +@itemize @bullet +@item +Automatic screen rotation based on accelerometer data. +@item +Ambient brightness adjustment using light sensor data. +@item +Compass/direction information for location services (via GeoClue). +@end itemize + +The value for this service is a @code{<iio-sensor-proxy-configuration>} object. +@end defvar + +@deftp {Data Type} iio-sensor-proxy-configuration +Data type representing the configuration for @code{iio-sensor-proxy-service-type}. + +@table @asis +@item @code{iio-sensor-proxy} (default: @code{iio-sensor-proxy}) (type: file-like) +Package object of iio-sensor-proxy. + +@end table +@end deftp + @defvar bluetooth-service-type This is the type for the @uref{https://bluez.org/, Linux Bluetooth Protocol Stack} (BlueZ) system, which generates the @file{/etc/bluetooth/main.conf} diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 4e5bc9a4566..eff502b7fb9 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -21,6 +21,7 @@ ;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com> ;;; Copyright © 2025 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com> +;;; Copyright © 2025 dan <i@dan.games> ;;; ;;; This file is part of GNU Guix. ;;; @@ -127,6 +128,11 @@ geoclue-service ; deprecated geoclue-service-type + iio-sensor-proxy-configuration + iio-sensor-proxy-configuration? + iio-sensor-proxy-configuration-io-sensor-proxy + iio-sensor-proxy-service-type + bluetooth-service-type bluetooth-configuration bluetooth-configuration? @@ -481,6 +487,50 @@ site} for more information." ;;; +;;; IIO Sensor proxy. +;;; + +(define-record-type* <iio-sensor-proxy-configuration> + iio-sensor-proxy-configuration make-iio-sensor-proxy-configuration + iio-sensor-proxy-configuration? + (iio-sensor-proxy iio-sensor-proxy-configuration-iio-sensor-proxy + (default iio-sensor-proxy))) + +(define iio-sensor-proxy-shepherd-service + (match-record-lambda <iio-sensor-proxy-configuration> + (iio-sensor-proxy) + (list (shepherd-service + (documentation "IIO sensors to D-Bus proxy") + (requirement '(user-processes dbus-system udev)) + (provision '(iio-sensor-proxy)) + (start #~(make-forkexec-constructor + (list #$(file-append iio-sensor-proxy + "/libexec/iio-sensor-proxy")))) + (stop #~(make-kill-destructor)))))) + +(define iio-sensor-proxy-service-type + (let ((iio-sensor-proxy-package + (match-record-lambda <iio-sensor-proxy-configuration> + (iio-sensor-proxy) + (list iio-sensor-proxy)))) + (service-type + (name 'iio-sensor-proxy) + (extensions + (list (service-extension polkit-service-type + iio-sensor-proxy-package) + (service-extension dbus-root-service-type + iio-sensor-proxy-package) + (service-extension udev-service-type + iio-sensor-proxy-package) + (service-extension shepherd-root-service-type + iio-sensor-proxy-shepherd-service))) + (default-value (iio-sensor-proxy-configuration)) + (description + "Run the @command{iio-sensor-proxy} daemon, which provides IIO sensors data +through a D-Bus interface.")))) + + +;;; ;;; Bluetooth. ;;; |
