guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: gnu: services: Add bluetooth-service.


From: ???
Subject: 01/04: gnu: services: Add bluetooth-service.
Date: Sat, 18 Jun 2016 01:53:21 +0000 (UTC)

iyzsong pushed a commit to branch master
in repository guix.

commit 922e21f43646e73545940bff5b508956f5ad5d48
Author: 宋文武 <address@hidden>
Date:   Wed Jun 15 23:14:01 2016 +0800

    gnu: services: Add bluetooth-service.
    
    * 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 |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index a47d376..0bb68bb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7998,6 +7998,13 @@ location databases.  See
 web site} for more information.
 @end deffn
 
address@hidden {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.
address@hidden deffn
+
 @node Database Services
 @subsubsection Database Services
 
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index f427d35..2fb08cd 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2015 Andy Wingo <address@hidden>
 ;;; Copyright © 2015 Mark H Weaver <address@hidden>
+;;; Copyright © 2016 Sou Bunnbu <address@hidden>
 ;;;
 ;;; 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,38 @@ site} for more information."
 
 
 ;;;
+;;; 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 udev-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))
+
+
+;;;
 ;;; Polkit privilege management service.
 ;;;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]