all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: 宋文武 <iyzsong@gmail.com>
To: guix-devel@gnu.org
Cc: 宋文武 <iyzsong@gmail.com>
Subject: [PATCH] gnu: services: Add bluetooth-service.
Date: Wed, 15 Jun 2016 23:23:28 +0800	[thread overview]
Message-ID: <1466004208-4251-1-git-send-email-iyzsong@gmail.com> (raw)

* gnu/services/desktop.scm (bluetooth-shepherd-service)
(bluetooth-service): New Prodecures.
(bluetooth-service-type): New variable.
* doc/guix.text (Desktop Services): Document it.
---
 doc/guix.texi            |  7 +++++++
 gnu/services/desktop.scm | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index e163f36..a6fd89a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7982,6 +7982,13 @@ location databases.  See
 web site} for more information.
 @end deffn
 
+@deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}]
+Return a service that runs the @command{bluetoothd} daemon, which manages
+all the Bluetooth devices and provides a number of D-Bus interfaces.
+
+Users need to be in the @code{lp} group to access the D-Bus service.
+@end deffn
+
 @node Database Services
 @subsubsection Database Services
 
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index f427d35..80ac0ac 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,6 +38,7 @@
   #:use-module (gnu packages polkit)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages suckless)
+  #:use-module (gnu packages linux)
   #:use-module (guix records)
   #:use-module (guix packages)
   #:use-module (guix store)
@@ -49,6 +51,7 @@
             geoclue-application
             %standard-geoclue-applications
             geoclue-service
+            bluetooth-service
             polkit-service
             elogind-configuration
             elogind-service
@@ -346,6 +349,37 @@ site} for more information."
 
 \f
 ;;;
+;;; Bluetooth.
+;;;
+
+(define (bluetooth-shepherd-service bluez)
+  "Return a shepherd service for @command{bluetoothd}."
+  (shepherd-service
+   (provision '(bluetooth))
+   (requirement '(dbus-system udev))
+   (documentation "Run the bluetoothd daemon.")
+   (start #~(make-forkexec-constructor
+             (string-append #$bluez "/libexec/bluetooth/bluetoothd")))
+   (stop #~(make-kill-destructor))))
+
+(define bluetooth-service-type
+  (service-type
+   (name 'bluetooth)
+   (extensions
+    (list (service-extension dbus-root-service-type list)
+          (service-extension shepherd-root-service-type
+                             (compose list bluetooth-shepherd-service))))))
+
+(define* (bluetooth-service #:key (bluez bluez))
+  "Return a service that runs the @command{bluetoothd} daemon, which manages
+all the Bluetooth devices and provides a number of D-Bus interfaces.
+
+Users need to be in the @code{lp} group to access the D-Bus service.
+"
+  (service bluetooth-service-type bluez))
+
+\f
+;;;
 ;;; Polkit privilege management service.
 ;;;
 
-- 
2.6.3

             reply	other threads:[~2016-06-15 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 15:23 宋文武 [this message]
2016-06-16  3:49 ` [PATCH] gnu: services: Add bluetooth-service Alex Griffin
2016-06-16 12:11   ` 宋文武
2016-06-17 15:02 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466004208-4251-1-git-send-email-iyzsong@gmail.com \
    --to=iyzsong@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.