From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: [PATCH 2/2] services: Add connman-service. Date: Thu, 5 May 2016 09:36:27 +0300 Message-ID: <1462430187-3925-2-git-send-email-efraim@flashner.co.il> References: <20160420224145.GA8585@debian-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayCu6-00028g-CZ for guix-devel@gnu.org; Thu, 05 May 2016 02:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayCtu-0002Nk-8Q for guix-devel@gnu.org; Thu, 05 May 2016 02:36:48 -0400 Received: from flashner.co.il ([178.62.234.194]:53966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayCtt-0002Ld-Tj for guix-devel@gnu.org; Thu, 05 May 2016 02:36:42 -0400 Received: from localhost.localdomain (85.65.27.139.dynamic.barak-online.net [85.65.27.139]) by flashner.co.il (Postfix) with ESMTPSA id 867A740215 for ; Thu, 5 May 2016 06:36:32 +0000 (UTC) In-Reply-To: <20160420224145.GA8585@debian-netbook> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * 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. --- doc/guix.texi | 14 ++++++++++++- gnu/services/networking.scm | 49 +++++++++++++++++++++++++++++++++++++++= +++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0d72574..b575faf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18,7 +18,8 @@ Copyright @copyright{} 2014 Pierre-Antoine Rault@* Copyright @copyright{} 2015 Taylan Ulrich Bay=C4=B1rl=C4=B1/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 =20 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 netwo= rk connection manager attempting to keep network connectivity active when available. @end deffn =20 +@cindex Connman +@deffn {Scheme Procedure} connman-service @ + [#:connman @var{connman}] +Return a service that runs @url{https://01.org/connman,Connman}, a netwo= rk +connection manager. + +This service adds the @var{connman} package to the global profile, provi= ding +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 diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5a0a211..af2a609 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2015 Mark H Weaver +;;; Copyright =C2=A9 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ #: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 @@ tor-service bitlbee-service wicd-service - network-manager-service)) + network-manager-service + connman-service)) =20 ;;; Commentary: ;;; @@ -652,4 +655,48 @@ and @command{wicd-curses} user interfaces." that attempting to keep active network connectivity when available." (service network-manager-service-type network-manager)) =20 +=0C +;;; +;;; 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 ne= twork +connection manager. + +This service adds the @var{connman} package to the global profile, provi= ding +several the @command{connmanctl} command to interact with the daemon and +configure networking." + (service connman-service-type connman)) + ;;; networking.scm ends here --=20 2.8.1