From 72cd3086ccf9b465c40a4874f7b770f1639e6dff Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 15 Oct 2020 22:55:18 +0200 Subject: [PATCH 1/3] networkmanager-sstp: init at unstable-2020-04-20 --- .../services/networking/networkmanager.nix | 4 ++ .../network-manager/sstp/default.nix | 64 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 70 insertions(+) create mode 100644 pkgs/tools/networking/network-manager/sstp/default.nix diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index 17c549d42c32..201a51ff70b1 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -15,6 +15,7 @@ let networkmanager-openconnect networkmanager-openvpn networkmanager-vpnc + networkmanager-sstp ] ++ optional (!delegateWireless && !enableIwd) wpa_supplicant; delegateWireless = config.networking.wireless.enable == true && cfg.unmanaged != []; @@ -386,6 +387,9 @@ in { "NetworkManager/VPN/nm-iodine-service.name".source = "${networkmanager-iodine}/lib/NetworkManager/VPN/nm-iodine-service.name"; + + "NetworkManager/VPN/nm-sstp-service.name".source = + "${networkmanager-sstp}/lib/NetworkManager/VPN/nm-sstp-service.name"; } // optionalAttrs (cfg.appendNameservers != [] || cfg.insertNameservers != []) { diff --git a/pkgs/tools/networking/network-manager/sstp/default.nix b/pkgs/tools/networking/network-manager/sstp/default.nix new file mode 100644 index 000000000000..d5195cba3453 --- /dev/null +++ b/pkgs/tools/networking/network-manager/sstp/default.nix @@ -0,0 +1,64 @@ +{ stdenv +, autoreconfHook +, fetchFromGitHub +, fetchpatch +, file +, glib +, gnome3 +, gtk3 +, intltool +, libnma +, libsecret +, networkmanager +, pkgconfig +, ppp +, sstp +, substituteAll +, withGnome ? true }: + +let + pname = "NetworkManager-sstp"; + version = "unstable-2020-04-20"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchFromGitHub { + owner = "enaess"; + repo = "network-manager-sstp"; + rev = "735d8ca078f933e085029f60a737e3cf1d8c29a8"; + sha256 = "0aahfhy2ch951kzj6gnd8p8hv2s5yd5y10wrmj68djhnx2ml8cd3"; + }; + + buildInputs = [ sstp networkmanager glib ppp ] + ++ stdenv.lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ file intltool autoreconfHook pkgconfig ]; + + postPatch = '' + sed -i 's#/sbin/pppd#${ppp}/bin/pppd#' src/nm-sstp-service.c + sed -i 's#/sbin/sstpc#${sstp}/bin/sstpc#' src/nm-sstp-service.c + ''; + + # glib-2.62 deprecations + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + + preConfigure = "intltoolize"; + configureFlags = [ + "--without-libnm-glib" + "--with-gnome=${if withGnome then "yes" else "no"}" + "--enable-absolute-paths" + ]; + + passthru = { + updateScript = gnome3.updateScript { + packageName = pname; + attrPath = "networkmanager-sstp"; + }; + }; + + meta = with stdenv.lib; { + description = "NetworkManager's sstp plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f25888c3a60d..0e7f4c8ad6ab 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5714,6 +5714,8 @@ in networkmanager_strongswan = callPackage ../tools/networking/network-manager/strongswan { }; + networkmanager-sstp = callPackage ../tools/networking/network-manager/sstp { }; + networkmanagerapplet = callPackage ../tools/networking/network-manager/applet { }; libnma = callPackage ../tools/networking/network-manager/libnma { }; From cdda94f70e0bacf4911fb5b8c394355c2cb301ba Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 16 Oct 2020 00:50:24 +0200 Subject: [PATCH 2/3] sstp: 1.0.12 -> 1.0.13 --- pkgs/tools/networking/sstp/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/sstp/default.nix b/pkgs/tools/networking/sstp/default.nix index 4d05b478ab40..22ef9102ef85 100644 --- a/pkgs/tools/networking/sstp/default.nix +++ b/pkgs/tools/networking/sstp/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "sstp-client"; - version = "1.0.12"; + version = "1.0.13"; src = fetchurl { - url = "mirror://sourceforge/sstp-client/sstp-client/${version}/sstp-client-${version}.tar.gz"; - sha256 = "1zv7rx6wh9rhbyg9pg6759by8hc6n4162zrrw0y812cnaw3b8zj8"; + url = "mirror://sourceforge/sstp-client/sstp-client/sstp-client-${version}.tar.gz"; + sha256 = "06rjyncmgdy212xf9l9z6mfh4gdmgk7l4y841gb8lpbrl3y5h4ln"; }; patchPhase = From e9920891375be2f1f1ea10cbc5c471cbbbf583f9 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 21 Oct 2020 00:04:02 +0200 Subject: [PATCH 3/3] nixos/no-x-libs: add networkmanager-sstp --- nixos/modules/config/no-x-libs.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index 941ab78f8632..c3120c2bf30d 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -30,11 +30,12 @@ with lib; cairo = super.cairo.override { x11Support = false; }; dbus = super.dbus.override { x11Support = false; }; networkmanager-fortisslvpn = super.networkmanager-fortisslvpn.override { withGnome = false; }; + networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; }; networkmanager-l2tp = super.networkmanager-l2tp.override { withGnome = false; }; networkmanager-openconnect = super.networkmanager-openconnect.override { withGnome = false; }; networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; }; + networkmanager-sstp = super.networkmanager-vpnc.override { withGnome = false; }; networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; }; - networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; }; gobject-introspection = super.gobject-introspection.override { x11Support = false; }; qemu = super.qemu.override { gtkSupport = false; spiceSupport = false; sdlSupport = false; }; }));