From 97ab799afeff032b422642d945c2bcc764f6d8ed Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Sat, 5 Jan 2019 23:28:18 +0100 Subject: gnu: Add inputattach service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a service that runs inputattach as a daemon to translate events from serial ports. * gnu/services/desktop.scm (): 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 --- gnu/services/desktop.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0dee57e3bc..8f8e177ca9 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2017, 2019 Christopher Baines +;;; Copyright © 2019 Tim Gesthuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -123,6 +124,10 @@ enlightenment-desktop-configuration? enlightenment-desktop-service-type + inputattach-configuration + inputattach-configuration? + inputattach-service-type + %desktop-services)) ;;; 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 as expected."))) + +;;; +;;; inputattach-service-type +;;; + +(define-record-type* + 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 + (($ 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. -- cgit v1.2.3