I think I've finally gotten connman working, with a service. I haven't added an entry to doc/guix.texi yet, and for some reason when I started the patch I stuck it in wicd.scm. I've also attached the OS config I used while testing.
-- Efraim Flashner <efr...@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted
From efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001 From: Efraim Flashner <efr...@flashner.co.il> Date: Thu, 19 Apr 2016 17:25:41 +0200 Subject: [PATCH 1/2] gnu: Add connman. * gnu/packages/wicd.scm (connman): New variable. --- gnu/packages/wicd.scm | 70 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm index f9aa657..8ceb4cf 100644 --- a/gnu/packages/wicd.scm +++ b/gnu/packages/wicd.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015 Pierre-Antoine Rault <p...@rigelk.eu> ;;; Copyright © 2015 Andreas Enge <andr...@enge.fr> ;;; Copyright © 2016 Ludovic Courtès <l...@gnu.org> +;;; Copyright © 2016 Efraim Flashner <efr...@flashner.co.il> ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,17 +23,24 @@ (define-module (gnu packages wicd) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (guix licenses) #:use-module (guix utils) #:use-module (gnu packages) + #:use-module (gnu packages admin) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) #:use-module (gnu packages gettext) #:use-module (gnu packages linux) - #:use-module (gnu packages admin) - #:use-module (gnu packages python)) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages polkit) + #:use-module (gnu packages python) + #:use-module (gnu packages readline) + #:use-module (gnu packages samba) + #:use-module (gnu packages tls) + #:use-module (gnu packages vpn)) (define-public wicd (package @@ -190,3 +198,61 @@ wireless networking.") (home-page "https://launchpad.net/wicd") (license gpl2+))) + +(define-public connman + (package + (name "connman") + (version "1.32") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.kernel.org/pub/linux/network/connman/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0k4kw2j78gwxf0rq79a099qkzl6wi4v5i7rfs4rn0si0fd68d19i")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list "--enable-nmcompat" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--enable-openconnect" + "--enable-openvpn" + "--enable-vpnc" + "--enable-pptp" + "--enable-l2tp" + (string-append + "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc") + (string-append + "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share")))) + (native-inputs + `(("pkg-config", pkg-config) + ("python" ,python-2))) + (inputs + `(("dbus" ,dbus) + ("glib" ,glib) + ("gnutls" ,gnutls) + ("iptables" ,iptables) + ("polkit" ,polkit) + ("readline" ,readline) + ;; These inputs are needed for connman to include the interface to + ;; these technologies so IF they are installed they can be used. + ;; TODO: add neard, ofono + ("openconnect" ,openconnect) + ("openvpn" ,openvpn) + ("ppp", ppp) + ("vpnc" ,vpnc) + ("wpa-supplicant" ,wpa-supplicant))) + (home-page "https://01.org/connman") + (synopsis "Connection Manager daemon") + (description "The Linux Connection Manager project provides a daemon for +managing Internet connections within embedded devices running the Linux +operating system. The Connection Manager is designed to be slim and to use as +few resources as possible. It is fully modular system that can be extended +through plug-ins. The plug-in approach allows for easy adaption and +modification for various use cases. Connman implements DNS resolving and +caching, DHCP clients for both IPv4 and IPv6, link-local IPv4 address handling +and tethering (IP connection sharing) to clients via USB, ethernet, WiFi, +cellular and Bluetooth.") + (license gpl2))) -- 2.8.1
From 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001 From: Efraim Flashner <efr...@flashner.co.il> Date: Thu, 19 Apr 2016 22:10:11 +0200 Subject: [PATCH 2/2] services: Add connman-service. * gnu/services/networking.scm (connman-service): New procedure. (connman-service-type, %connman-activation): New variables. (connman-shepherd-service): New procedure. --- gnu/services/networking.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 5a0a211..5bb56a2 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 <l...@gnu.org> ;;; Copyright © 2015 Mark H Weaver <m...@netris.org> +;;; Copyright © 2016 Efraim Flashner <efr...@flashner.co.il> ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,7 +46,8 @@ tor-service bitlbee-service wicd-service - network-manager-service)) + network-manager-service + connman-service)) ;;; Commentary: ;;; @@ -652,4 +654,47 @@ 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 "/etc/connman/") + (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 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 -- 2.8.1
;; This is an operating system configuration template ;; for a "desktop" setup without full-blown desktop ;; environments. (use-modules (gnu) (gnu system nss)) (use-service-modules desktop networking) (use-package-modules openbox certs wicd xorg) (operating-system (host-name "antelope") (timezone "Europe/Paris") (locale "en_US.UTF-8") ;; Assuming /dev/sdX is the target hard disk, and "my-root" ;; is the label of the target root file system. (bootloader (grub-configuration (device "/dev/sdX"))) (file-systems (cons (file-system (device "my-root") (title 'label) (mount-point "/") (type "ext4")) %base-file-systems)) (users (cons (user-account (name "alice") (comment "Bob's brother") (group "users") (supplementary-groups '("wheel" "netdev" "audio" "video")) (home-directory "/home/alice")) %base-user-accounts)) ;; Add a bunch of window managers; we can choose one at ;; the log-in screen with F1. (packages (cons* openbox ;window managers nss-certs ;for HTTPS access connman xterm %base-packages)) ;; Use the "desktop" services, which include the X11 ;; log-in service, networking with Wicd, and more. (services (cons* (connman-service) (delete (wicd-service) %desktop-services))) ;; Allow resolution of '.local' host names with mDNS. (name-service-switch %mdns-host-lookup-nss))
signature.asc
Description: PGP signature