1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu services lirc)
20 #:use-module (gnu services)
21 #:use-module (gnu packages lirc)
22 #:use-module (guix monads)
23 #:use-module (guix store)
24 #:use-module (guix gexp)
25 #:export (lirc-service))
33 (define* (lirc-service #:key (lirc lirc)
34 device driver config-file
36 "Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that
37 decodes infrared signals from remote controls.
39 The daemon will use specified @var{device}, @var{driver} and
40 @var{config-file} (configuration file name).
42 Finally, @var{extra-options} is a list of additional command-line options
43 passed to @command{lircd}."
44 (with-monad %store-monad
48 (documentation "Run the LIRC daemon.")
49 (requirement '(user-processes))
50 (start #~(make-forkexec-constructor
51 (list (string-append #$lirc "/sbin/lircd")
54 #~("--device" #$device)
57 #~("--driver" #$driver)
63 (stop #~(make-kill-destructor))
65 (use-modules (guix build utils))
66 (mkdir-p "/var/run/lirc")))))))
68 ;;; lirc.scm ends here