mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
services: Add connman-service.
* gnu/services/networking.scm (connman-service): New procedure. (connman-service-type, %connman-activation): New variables. (connman-shepherd-service): New procedure. * doc/guix.texi (Networking Services): Document it.
This commit is contained in:
parent
9478c9d834
commit
76192896e9
2 changed files with 61 additions and 2 deletions
|
@ -18,7 +18,8 @@ Copyright @copyright{} 2014 Pierre-Antoine Rault@*
|
|||
Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer@*
|
||||
Copyright @copyright{} 2015, 2016 Leo Famulari@*
|
||||
Copyright @copyright{} 2016 Ben Woodcroft@*
|
||||
Copyright @copyright{} 2016 Chris Marusich
|
||||
Copyright @copyright{} 2016 Chris Marusich@*
|
||||
Copyright @copyright{} 2016 Efraim Flashner
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
@ -7390,6 +7391,17 @@ Return a service that runs NetworkManager, a network connection manager
|
|||
attempting to keep network connectivity active when available.
|
||||
@end deffn
|
||||
|
||||
@cindex Connman
|
||||
@deffn {Scheme Procedure} connman-service @
|
||||
[#:connman @var{connman}]
|
||||
Return a service that runs @url{https://01.org/connman,Connman}, a network
|
||||
connection manager.
|
||||
|
||||
This service adds the @var{connman} package to the global profile, providing
|
||||
several the @command{connmanctl} command to interact with the daemon and
|
||||
configure networking."
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} ntp-service [#:ntp @var{ntp}] @
|
||||
[#:name-service @var{%ntp-servers}]
|
||||
Return a service that runs the daemon from @var{ntp}, the
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -24,6 +25,7 @@ (define-module (gnu services networking)
|
|||
#:use-module (gnu system shadow)
|
||||
#:use-module (gnu system pam)
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages connman)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages tor)
|
||||
#:use-module (gnu packages messaging)
|
||||
|
@ -45,7 +47,8 @@ (define-module (gnu services networking)
|
|||
tor-service
|
||||
bitlbee-service
|
||||
wicd-service
|
||||
network-manager-service))
|
||||
network-manager-service
|
||||
connman-service))
|
||||
|
||||
;;; Commentary:
|
||||
;;;
|
||||
|
@ -652,4 +655,48 @@ (define* (network-manager-service #:key (network-manager network-manager))
|
|||
that attempting to keep active network connectivity when available."
|
||||
(service network-manager-service-type network-manager))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Connman
|
||||
;;;
|
||||
|
||||
(define %connman-activation
|
||||
;; Activation gexp for Connman.
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(mkdir-p "/var/lib/connman/")
|
||||
(mkdir-p "/var/lib/connman-vpn/")))
|
||||
|
||||
(define (connman-shepherd-service connman)
|
||||
"Return a shepherd service for Connman"
|
||||
(list (shepherd-service
|
||||
(documentation "Run Connman")
|
||||
(provision '(networking))
|
||||
(requirement '(user-processes dbus-system loopback))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list (string-append #$connman
|
||||
"/sbin/connmand")
|
||||
"-n" "-r")))
|
||||
(stop #~(make-kill-destructor)))))
|
||||
|
||||
(define connman-service-type
|
||||
(service-type (name 'connman)
|
||||
(extensions
|
||||
(list (service-extension shepherd-root-service-type
|
||||
connman-shepherd-service)
|
||||
(service-extension dbus-root-service-type list)
|
||||
(service-extension activation-service-type
|
||||
(const %connman-activation))
|
||||
;; Add connman to the system profile.
|
||||
(service-extension profile-service-type list)))))
|
||||
|
||||
(define* (connman-service #:key (connman connman))
|
||||
"Return a service that runs @url{https://01.org/connman,Connman}, a network
|
||||
connection manager.
|
||||
|
||||
This service adds the @var{connman} package to the global profile, providing
|
||||
several the @command{connmanctl} command to interact with the daemon and
|
||||
configure networking."
|
||||
(service connman-service-type connman))
|
||||
|
||||
;;; networking.scm ends here
|
||||
|
|
Loading…
Reference in a new issue