diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index 0b079e3567a1..2db96d9cd31e 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -31,7 +31,7 @@ let [modem-manager] Identity=unix-group:networkmanager - Action=org.freedesktop.ModemManager.* + Action=org.freedesktop.ModemManager* ResultAny=yes ResultInactive=no ResultActive=yes @@ -42,7 +42,7 @@ let subject.isInGroup("networkmanager") && subject.active && (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 - || action.id.indexOf("org.freedesktop.ModemManager.") == 0 + || action.id.indexOf("org.freedesktop.ModemManager") == 0 )) { return polkit.Result.YES; } }); @@ -161,6 +161,7 @@ in { networkmanager_vpnc networkmanager_openconnect networkmanager_pptp + modemmanager ]; users.extraGroups = singleton { @@ -177,7 +178,7 @@ in { description = "NetworkManager initialisation"; wantedBy = [ "network.target" ]; partOf = [ "NetworkManager.service" ]; - wants = [ "NetworkManager.service" ]; + wants = [ "ModemManager.service" ]; before = [ "NetworkManager.service" ]; script = '' mkdir -m 700 -p /etc/NetworkManager/system-connections @@ -206,6 +207,7 @@ in { networkmanager_vpnc networkmanager_openconnect networkmanager_pptp + modemmanager ]; services.udev.packages = cfg.packages; diff --git a/pkgs/development/libraries/libmbim/default.nix b/pkgs/development/libraries/libmbim/default.nix new file mode 100644 index 000000000000..8207051b2a86 --- /dev/null +++ b/pkgs/development/libraries/libmbim/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, pkgconfig, glib, python, udev }: + +stdenv.mkDerivation rec { + name = "libmbim-1.6.0"; + + src = fetchurl { + url = "http://www.freedesktop.org/software/libmbim/${name}.tar.xz"; + sha256 = "10mh1b8jfxg6y6nhr7swbi9wx4acjgvx1if7nhrw1ppd5apvvvz0"; + }; + + preConfigure = '' + for f in build-aux/mbim-codegen/*; do + substituteInPlace $f --replace "/usr/bin/env python" "${python}/bin/python" + done + ''; + + buildInputs = [ pkgconfig glib udev ]; + + meta = with stdenv.lib; { + description = "talking to WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol"; + platforms = platforms.linux; + }; +} diff --git a/pkgs/tools/networking/modemmanager/default.nix b/pkgs/tools/networking/modemmanager/default.nix index bfa673eff09f..3e33b845b600 100644 --- a/pkgs/tools/networking/modemmanager/default.nix +++ b/pkgs/tools/networking/modemmanager/default.nix @@ -1,19 +1,22 @@ -{ stdenv, fetchurl_gnome, udev, polkit, dbus_glib, ppp, intltool, pkgconfig }: +{ stdenv, fetchurl, udev, polkit, dbus_glib, ppp, intltool, pkgconfig, libmbim, libqmi }: stdenv.mkDerivation rec { - name = src.pkgname; + name = "ModemManager-0.7.991"; - src = fetchurl_gnome { - project = "ModemManager"; - major = "0"; minor = "5"; patchlevel = "4.0"; extension = "xz"; - sha256 = "1fdf5d5cc494825afe9f551248e00a2d91e220e88435b47f109ca2a707a40f1f"; + src = fetchurl { + url = "mirror://gnome/sources/ModemManager/0.7/${name}.tar.xz"; + sha256 = "0p8shqsbgnsazim7s52ylxjk064cbx2n1vm1jgywr7i58hsd6n4y"; }; nativeBuildInputs = [ intltool pkgconfig ]; - buildInputs = [ udev polkit dbus_glib ppp ]; + buildInputs = [ udev polkit dbus_glib ppp libmbim libqmi ]; - configureFlags = "--with-polkit --with-udev-base-dir=$(out)/lib/udev"; + configureFlags = [ + "--with-polkit" + "--with-udev-base-dir=$(out)/lib/udev" + "--with-systemdsystemunitdir=$(out)/etc/systemd/system" + ]; meta = { description = "WWAN modem manager, part of NetworkManager"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d7aff1acc06b..a51d1d33f566 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1284,6 +1284,8 @@ let libqmi = callPackage ../development/libraries/libqmi { }; + libmbim = callPackage ../development/libraries/libmbim { }; + libtorrent = callPackage ../tools/networking/p2p/libtorrent { }; logcheck = callPackage ../tools/system/logcheck {