diff --git a/pkgs/tools/networking/network-manager/l2tp-purity.patch b/pkgs/tools/networking/network-manager/l2tp-purity.patch new file mode 100644 index 000000000000..c9117c5325b6 --- /dev/null +++ b/pkgs/tools/networking/network-manager/l2tp-purity.patch @@ -0,0 +1,26 @@ +diff --git a/src/nm-l2tp-service.c b/src/nm-l2tp-service.c +index d2c9dc4..e61d3d2 100644 +--- a/src/nm-l2tp-service.c ++++ b/src/nm-l2tp-service.c +@@ -655,9 +655,7 @@ nm_find_ipsec (void) + { + static const char *ipsec_binary_paths[] = + { +- "/sbin/ipsec", +- "/usr/sbin/ipsec", +- "/usr/local/sbin/ipsec", ++ "@strongswan@/bin/ipsec", + NULL + }; + +@@ -677,9 +675,7 @@ nm_find_l2tpd (void) + { + static const char *l2tp_binary_paths[] = + { +- "/sbin/xl2tpd", +- "/usr/sbin/xl2tpd", +- "/usr/local/sbin/xl2tpd", ++ "@xl2tpd@/bin/xl2tpd", + NULL + }; + diff --git a/pkgs/tools/networking/network-manager/l2tp.nix b/pkgs/tools/networking/network-manager/l2tp.nix new file mode 100644 index 000000000000..a104f321c12d --- /dev/null +++ b/pkgs/tools/networking/network-manager/l2tp.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchFromGitHub, substituteAll, automake, autoconf, libtool, intltool, pkgconfig +, networkmanager, ppp, xl2tpd, strongswan +, withGnome ? true, gnome3 }: + +stdenv.mkDerivation rec { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + pname = "NetworkManager-l2tp"; + version = "0.9.8.7"; + + src = fetchFromGitHub { + owner = "seriyps"; + repo = "NetworkManager-l2tp"; + rev = version; + sha256 = "07gl562p3f6l2wn64f3vvz1ygp3hsfhiwh4sn04c3fahfdys69zx"; + }; + + buildInputs = [ networkmanager ppp ] + ++ stdenv.lib.optionals withGnome [ gnome3.gtk gnome3.libgnome_keyring ]; + + nativeBuildInputs = [ automake autoconf libtool intltool pkgconfig ]; + + configureScript = "./autogen.sh"; + + configureFlags = + if withGnome then "--with-gnome" else "--without-gnome"; + + postConfigure = "sed 's/-Werror//g' -i Makefile */Makefile"; + + patches = + [ ( substituteAll { + src = ./l2tp-purity.patch; + inherit xl2tpd strongswan; + }) + ]; + + meta = with stdenv.lib; { + description = "L2TP plugin for NetworkManager"; + inherit (networkmanager.meta) platforms; + license = licenses.gpl2; + maintainers = with maintainers; [ abbradar ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 03b68e0f7625..464d6a01f925 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2077,6 +2077,8 @@ let networkmanager_pptp = callPackage ../tools/networking/network-manager/pptp.nix { }; + networkmanager_l2tp = callPackage ../tools/networking/network-manager/l2tp.nix { }; + networkmanager_vpnc = callPackage ../tools/networking/network-manager/vpnc.nix { }; networkmanager_openconnect = callPackage ../tools/networking/network-manager/openconnect.nix { };