summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorTim Gesthuizen <tim.gesthuizen@yahoo.de>2019-10-10 18:38:36 +0200
committerLudovic Courtès <ludo@gnu.org>2019-10-21 23:26:33 +0200
commit84261a233ecb58d7a622329d95a8d0d3fc92f886 (patch)
tree8f6cbbbd5795ad19eaf9a38275fedf57b7c2f793 /gnu/services
parent2f000f2ef48972b2544f0da3aa96faf19be8a04b (diff)
downloadguix-84261a233ecb58d7a622329d95a8d0d3fc92f886.tar.gz
services: inputattach: Add 'baud-rate' parameter.
* gnu/services/desktop.scm (inputattach-configuration): Add baud-rate field.
  (inputattach-shepherd-service): Add baud-rate to parameters when specified.
* doc/guix.texi (Miscellaneous Services): [inputattach Service] Document
  baud-rate parameter.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/desktop.scm30
1 files changed, 18 insertions, 12 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 5a7f8be4bb..08acb79ed6 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1028,23 +1028,29 @@ as expected.")))
                (default "wacom"))
   (device inputattach-configuration-device
           (default "/dev/ttyS0"))
+  (baud-rate inputattach-configuration-baud-rate
+             (default #f))
   (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)))))))
+    (($ <inputattach-configuration> type device baud-rate log-file)
+     (let ((args (append (if baud-rate
+                             (list "--baud-rate" (number->string baud-rate))
+                             '())
+                         (list (string-append "--" type)
+                               device))))
+       (list (shepherd-service
+              (provision '(inputattach))
+              (requirement '(udev))
+              (documentation "inputattach daemon")
+              (start #~(make-forkexec-constructor
+                        (cons (string-append #$inputattach
+                                             "/bin/inputattach")
+                              (quote #$args))
+                        #:log-file #$log-file))
+              (stop #~(make-kill-destructor))))))))
 
 (define inputattach-service-type
   (service-type