aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/networking.scm
diff options
context:
space:
mode:
author宋文武 <iyzsong@gmail.com>2016-05-08 17:54:46 +0800
committer宋文武 <iyzsong@gmail.com>2016-05-08 17:54:46 +0800
commit6655a74326beb18632b5c8277db39fd02a154007 (patch)
treefed007de99235258098222f04fa1e4853c1d3d60 /gnu/services/networking.scm
parent4e9d04a80b2d8b1e07f78708dae76b13f3d421f6 (diff)
parent2d4422d5b53276661a68f65b91daa854de88c165 (diff)
downloadguix-6655a74326beb18632b5c8277db39fd02a154007.tar
guix-6655a74326beb18632b5c8277db39fd02a154007.tar.gz
Merge branch 'master' into gnome-updates
Diffstat (limited to 'gnu/services/networking.scm')
-rw-r--r--gnu/services/networking.scm49
1 files changed, 48 insertions, 1 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5a0a211236..af2a60936b 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -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 @@
#: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))
;;; 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))
+
+;;;
+;;; 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