From 4094d63dea7fafb8529ceaaa195f8e81e5dbe8a3 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Thu, 25 Aug 2016 21:58:56 +0200 Subject: [PATCH] NetworkManager-strongswan: init at 1.4.0 --- .../services/networking/networkmanager.nix | 3 ++ .../networking/network-manager/strongswan.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 pkgs/tools/networking/network-manager/strongswan.nix diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index 65ffaece4772..8f353979d3fc 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -198,6 +198,9 @@ in { { source = "${networkmanager_l2tp}/etc/NetworkManager/VPN/nm-l2tp-service.name"; target = "NetworkManager/VPN/nm-l2tp-service.name"; } + { source = "${networkmanager_strongswan}/etc/NetworkManager/VPN/nm-strongswan-service.name"; + target = "NetworkManager/VPN/nm-strongswan-service.name"; + } ] ++ optional (cfg.appendNameservers == [] || cfg.insertNameservers == []) { source = overrideNameserversScript; target = "NetworkManager/dispatcher.d/02overridedns"; diff --git a/pkgs/tools/networking/network-manager/strongswan.nix b/pkgs/tools/networking/network-manager/strongswan.nix new file mode 100644 index 000000000000..9e0033cca90c --- /dev/null +++ b/pkgs/tools/networking/network-manager/strongswan.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, intltool, pkgconfig, networkmanager, procps +, gnome3, libgnome_keyring, libsecret }: + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + pname = "NetworkManager-strongswan"; + version = "1.4.0"; + + src = fetchurl { + url = "https://download.strongswan.org/NetworkManager/${name}.tar.bz2"; + sha256 = "0qfnylg949lkyw1nmyggz2ipgmy154ic5q5ljjcwcgi14r90ys02"; + }; + + postPatch = '' + sed -i "s,nm_plugindir=.*,nm_plugindir=$out/lib/NetworkManager," "configure" + sed -i "s,nm_libexecdir=.*,nm_libexecdir=$out/libexec," "configure" + ''; + + buildInputs = [ networkmanager libsecret ] + ++ (with gnome3; [ gtk libgnome_keyring networkmanagerapplet ]); + + nativeBuildInputs = [ intltool pkgconfig ]; + + preConfigure = '' + substituteInPlace "configure" \ + --replace "/sbin/sysctl" "${procps}/bin/sysctl" + ''; + + meta = { + description = "NetworkManager's strongswan plugin"; + inherit (networkmanager.meta) platforms; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90496d6088ef..bb151fe41d83 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2832,6 +2832,8 @@ in networkmanager_openconnect = callPackage ../tools/networking/network-manager/openconnect.nix { }; + networkmanager_strongswan = callPackage ../tools/networking/network-manager/strongswan.nix { }; + networkmanagerapplet = newScope gnome2 ../tools/networking/network-manager-applet { }; newsbeuter = callPackage ../applications/networking/feedreaders/newsbeuter { };