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

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>
This commit is contained in:
dan
2025-10-16 23:59:14 +08:00
committed by Liliana Marie Prikler
parent ae147ef7bc
commit 78f05b29c1
2 changed files with 82 additions and 0 deletions

View File

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

View File

@@ -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?
@@ -479,6 +485,50 @@ site} for more information."
(submission-nick submission-nick)
(applications applications))))
;;;
;;; 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.