gnu: Add inputattach service.

Add a service that runs inputattach as a daemon to translate events from
serial ports.

* gnu/services/desktop.scm (<inputattach-configuration>): New record type.
* gnu/services/desktop.scm (inputattach-service-type): New service type.
* doc/guix.texi (Miscellaneous Services): Add inputattach Service
  subsubheading.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Tim Gesthuizen 2019-01-05 23:28:18 +01:00 committed by Ludovic Courtès
parent bf2a9969a2
commit 97ab799afe
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 62 additions and 0 deletions

View File

@ -22503,6 +22503,22 @@ that enables sharing the clipboard with a vm and setting the guest display
resolution when the graphical console window resizes. resolution when the graphical console window resizes.
@end deffn @end deffn
@cindex inputattach
@subsubheading inputattach Service
@deftp {Data Type} inputattach-configuration
@table @asis
@item @code{device-type} The type of device to connect to.
@item @code{device} The device file to connect to the device.
@item @code{log-file} The file to log messages to.
@end table
@end deftp
@deffn {Scheme Procedure} inputattach-service-type
Return a service that runs inputattach on a device and
dispatches events from it.
@end deffn
@subsection Dictionary Services @subsection Dictionary Services
@cindex dictionary @cindex dictionary
The @code{(gnu services dict)} module provides the following service: The @code{(gnu services dict)} module provides the following service:

View File

@ -8,6 +8,7 @@
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -123,6 +124,10 @@
enlightenment-desktop-configuration? enlightenment-desktop-configuration?
enlightenment-desktop-service-type enlightenment-desktop-service-type
inputattach-configuration
inputattach-configuration?
inputattach-service-type
%desktop-services)) %desktop-services))
;;; Commentary: ;;; Commentary:
@ -1019,6 +1024,47 @@ profile, and extends dbus with the ability for @code{efl} to generate
thumbnails and makes setuid the programs which enlightenment needs to function thumbnails and makes setuid the programs which enlightenment needs to function
as expected."))) as expected.")))
;;;
;;; inputattach-service-type
;;;
(define-record-type* <inputattach-configuration>
inputattach-configuration
make-inputattach-configuration
inputattach-configuration?
(device-type inputattach-configuration-device-type
(default "wacom"))
(device inputattach-configuration-device
(default "/dev/ttyS0"))
(log-file inputattach-configuration-log-file
(default #f)))
(define inputattach-shepherd-service
(match-lambda
(($ <inputattach-configuration> type device log-file)
(list (shepherd-service
(provision '(inputattach))
(requirement '(udev))
(documentation "inputattach daemon")
(start #~(make-forkexec-constructor
(list (string-append #$inputattach
"/bin/inputattach")
(string-append "--" #$type)
#$device)
#:log-file #$log-file))
(stop #~(make-kill-destructor)))))))
(define inputattach-service-type
(service-type
(name 'inputattach)
(extensions
(list (service-extension shepherd-root-service-type
inputattach-shepherd-service)))
(default-value (inputattach-configuration))
(description "Return a service that runs inputattach on a device and
dispatches events from it.")))
;;; ;;;
;;; The default set of desktop services. ;;; The default set of desktop services.