summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordan <i@dan.games>2025-10-16 23:59:14 +0800
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2025-11-07 18:39:59 +0100
commit78f05b29c1d8a2558098d3783efd709319bdccc1 (patch)
tree5d694ec6dc387b2106a15c501c57e2e45690d880
parentae147ef7bc21d546f0fa7765542f5a2c219c1dab (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.texi32
-rw-r--r--gnu/services/desktop.scm50
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@*
145Copyright @copyright{} 2025 Artur Wroblewski@* 145Copyright @copyright{} 2025 Artur Wroblewski@*
146Copyright @copyright{} 2025 Edouard Klein@* 146Copyright @copyright{} 2025 Edouard Klein@*
147Copyright @copyright{} 2025 Rodion Goritskov@* 147Copyright @copyright{} 2025 Rodion Goritskov@*
148Copyright @copyright{} 2025 dan@*
148 149
149Permission is granted to copy, distribute and/or modify this document 150Permission is granted to copy, distribute and/or modify this document
150under the terms of the GNU Free Documentation License, Version 1.3 or 151under 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.
27046@c TODO: Document <geoclue-configuration>, preferably by refactoring this to use 27047@c TODO: Document <geoclue-configuration>, preferably by refactoring this to use
27047@c define-configuration and generating documentation from it. 27048@c define-configuration and generating documentation from it.
27048 27049
27050@defvar iio-sensor-proxy-service-type
27051Type for the service that runs
27052@uref{https://gitlab.freedesktop.org/hadess/iio-sensor-proxy, IIO sensor
27053proxy}, a daemon that proxies low-level sensor data from Industrial I/O
27054(IIO) devices into a D-Bus interface. It enables user-space
27055applications, such as desktop environments like GNOME and KDE, and
27056services like GeoClue, to access data from various sensors commonly
27057found in devices like ultrabooks and 2-in-1s. This allows for:
27058
27059@itemize @bullet
27060@item
27061Automatic screen rotation based on accelerometer data.
27062@item
27063Ambient brightness adjustment using light sensor data.
27064@item
27065Compass/direction information for location services (via GeoClue).
27066@end itemize
27067
27068The value for this service is a @code{<iio-sensor-proxy-configuration>} object.
27069@end defvar
27070
27071@deftp {Data Type} iio-sensor-proxy-configuration
27072Data type representing the configuration for @code{iio-sensor-proxy-service-type}.
27073
27074@table @asis
27075@item @code{iio-sensor-proxy} (default: @code{iio-sensor-proxy}) (type: file-like)
27076Package object of iio-sensor-proxy.
27077
27078@end table
27079@end deftp
27080
27049@defvar bluetooth-service-type 27081@defvar bluetooth-service-type
27050This is the type for the @uref{https://bluez.org/, Linux Bluetooth Protocol 27082This is the type for the @uref{https://bluez.org/, Linux Bluetooth Protocol
27051Stack} (BlueZ) system, which generates the @file{/etc/bluetooth/main.conf} 27083Stack} (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 @@
21;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com> 21;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com>
22;;; Copyright © 2025 Jonathan Brielmaier <jonathan.brielmaier@web.de> 22;;; Copyright © 2025 Jonathan Brielmaier <jonathan.brielmaier@web.de>
23;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com> 23;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com>
24;;; Copyright © 2025 dan <i@dan.games>
24;;; 25;;;
25;;; This file is part of GNU Guix. 26;;; This file is part of GNU Guix.
26;;; 27;;;
@@ -127,6 +128,11 @@
127 geoclue-service ; deprecated 128 geoclue-service ; deprecated
128 geoclue-service-type 129 geoclue-service-type
129 130
131 iio-sensor-proxy-configuration
132 iio-sensor-proxy-configuration?
133 iio-sensor-proxy-configuration-io-sensor-proxy
134 iio-sensor-proxy-service-type
135
130 bluetooth-service-type 136 bluetooth-service-type
131 bluetooth-configuration 137 bluetooth-configuration
132 bluetooth-configuration? 138 bluetooth-configuration?
@@ -481,6 +487,50 @@ site} for more information."
481 487
482 488
483;;; 489;;;
490;;; IIO Sensor proxy.
491;;;
492
493(define-record-type* <iio-sensor-proxy-configuration>
494 iio-sensor-proxy-configuration make-iio-sensor-proxy-configuration
495 iio-sensor-proxy-configuration?
496 (iio-sensor-proxy iio-sensor-proxy-configuration-iio-sensor-proxy
497 (default iio-sensor-proxy)))
498
499(define iio-sensor-proxy-shepherd-service
500 (match-record-lambda <iio-sensor-proxy-configuration>
501 (iio-sensor-proxy)
502 (list (shepherd-service
503 (documentation "IIO sensors to D-Bus proxy")
504 (requirement '(user-processes dbus-system udev))
505 (provision '(iio-sensor-proxy))
506 (start #~(make-forkexec-constructor
507 (list #$(file-append iio-sensor-proxy
508 "/libexec/iio-sensor-proxy"))))
509 (stop #~(make-kill-destructor))))))
510
511(define iio-sensor-proxy-service-type
512 (let ((iio-sensor-proxy-package
513 (match-record-lambda <iio-sensor-proxy-configuration>
514 (iio-sensor-proxy)
515 (list iio-sensor-proxy))))
516 (service-type
517 (name 'iio-sensor-proxy)
518 (extensions
519 (list (service-extension polkit-service-type
520 iio-sensor-proxy-package)
521 (service-extension dbus-root-service-type
522 iio-sensor-proxy-package)
523 (service-extension udev-service-type
524 iio-sensor-proxy-package)
525 (service-extension shepherd-root-service-type
526 iio-sensor-proxy-shepherd-service)))
527 (default-value (iio-sensor-proxy-configuration))
528 (description
529 "Run the @command{iio-sensor-proxy} daemon, which provides IIO sensors data
530through a D-Bus interface."))))
531
532
533;;;
484;;; Bluetooth. 534;;; Bluetooth.
485;;; 535;;;
486 536