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.
master
宋文武 2016-06-15 23:14:01 +08:00
parent 0de78c95b5
commit 922e21f436
No known key found for this signature in database
GPG Key ID: 26525665AE727D37
2 changed files with 42 additions and 0 deletions

View File

@ -7998,6 +7998,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

View File

@ -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
@ -344,6 +347,38 @@ site} for more information."
(submission-nick submission-nick)
(applications applications))))
;;;
;;; 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.