diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index bef0ff365676..6ed723e704d0 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -195,7 +195,7 @@ in { dhcp = mkOption { type = types.enum [ "dhclient" "dhcpcd" "internal" ]; - default = "dhclient"; + default = "internal"; description = '' Which program (or internal library) should be used for DHCP. ''; diff --git a/pkgs/tools/networking/network-manager/default.nix b/pkgs/tools/networking/network-manager/default.nix index 490ebd0fa6bb..ffa56363ad67 100644 --- a/pkgs/tools/networking/network-manager/default.nix +++ b/pkgs/tools/networking/network-manager/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, substituteAll, intltool, pkgconfig, dbus, dbus-glib +{ stdenv, fetchurl, substituteAll, intltool, pkgconfig, fetchpatch, dbus , gnome3, systemd, libuuid, polkit, gnutls, ppp, dhcp, iptables, python3, vala , libgcrypt, dnsmasq, bluez5, readline, libselinux, audit , gobject-introspection, modemmanager, openresolv, libndp, newt, libsoup @@ -10,11 +10,11 @@ let pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]); in stdenv.mkDerivation rec { pname = "network-manager"; - version = "1.18.2"; + version = "1.20.2"; src = fetchurl { url = "mirror://gnome/sources/NetworkManager/${stdenv.lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz"; - sha256 = "1hx5dx5dgdqh3p8fq7q1pxy2bx2iymc74lj60ycrf7ydfjlprnad"; + sha256 = "115cgz448vypc7c592lqqjd7lp2kzdczhjk4ran6qls65hzkfkji"; }; outputs = [ "out" "dev" "devdoc" "man" "doc" ]; @@ -33,7 +33,7 @@ in stdenv.mkDerivation rec { # to enable link-local connections "-Dudev_dir=${placeholder "out"}/lib/udev" "-Dresolvconf=${openresolv}/bin/resolvconf" - "-Ddbus_conf_dir=${placeholder "out"}/etc/dbus-1/system.d" + "-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d" "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system" "-Dkernel_firmware_dir=/run/current-system/firmware" "--sysconfdir=/etc" @@ -43,8 +43,6 @@ in stdenv.mkDerivation rec { "-Dmodem_manager=true" "-Dnmtui=true" "-Ddocs=true" - # TODO: legacy library, will be *removed* in next release! - "-Dlibnm_glib=true" "-Dtests=no" "-Dqt=false" # Allow using iwd when configured to do so @@ -53,6 +51,15 @@ in stdenv.mkDerivation rec { ]; patches = [ + # 1.20.2 added a decorators.sh script but they forgot to distribute it (breaking the build) + # as it was to fix things with gtk-doc 1.32 we can safely revert it. + (fetchpatch { + url = "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/2d941dc95a1d94d023ac8f98df2f344dbb1d223e.patch"; + sha256 = "1mvbajddwd6diwk6dgjg5p65i6852gx6b9p3949rs63d2i6yzg21"; + excludes = [ "tools/decorators.sh" ]; + revert = true; + }) + (substituteAll { src = ./fix-paths.patch; inherit iputils kmod openconnect ethtool gnused dbus; @@ -69,19 +76,17 @@ in stdenv.mkDerivation rec { bluez5 dnsmasq gobject-introspection modemmanager readline newt libsoup jansson ]; - propagatedBuildInputs = [ dbus-glib gnutls libgcrypt ]; + propagatedBuildInputs = [ gnutls libgcrypt ]; nativeBuildInputs = [ meson ninja intltool pkgconfig - vala gobject-introspection - dbus-glib # for dbus-binding-tool + vala gobject-introspection dbus # Docs gtk-doc libxslt docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 pythonForDocs ]; doCheck = false; # requires /sys, the net - postPatch = '' patchShebangs ./tools patchShebangs libnm/generate-setting-docs.py @@ -96,13 +101,6 @@ in stdenv.mkDerivation rec { ln -s $PWD/libnm/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0 ''; - postInstall = '' - # Add the legacy service name from before #51382 to prevent NetworkManager - # from not starting back up: - # TODO: remove this once 19.10 is released - ln -s $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service - ''; - passthru = { updateScript = gnome3.updateScript { packageName = pname; diff --git a/pkgs/tools/networking/network-manager/fix-install-paths.patch b/pkgs/tools/networking/network-manager/fix-install-paths.patch index 068b9c8266b8..5798c1edfb6e 100644 --- a/pkgs/tools/networking/network-manager/fix-install-paths.patch +++ b/pkgs/tools/networking/network-manager/fix-install-paths.patch @@ -1,6 +1,8 @@ +diff --git a/meson.build b/meson.build +index 4105a9c80..3d912557f 100644 --- a/meson.build +++ b/meson.build -@@ -925,9 +925,9 @@ +@@ -884,9 +884,9 @@ meson.add_install_script( join_paths('tools', 'meson-post-install.sh'), nm_datadir, nm_bindir, @@ -12,9 +14,11 @@ enable_docs ? 'install_docs' : '', nm_mandir, ) +diff --git a/src/settings/plugins/ifcfg-rh/meson.build b/src/settings/plugins/ifcfg-rh/meson.build +index 58acdcfcb..e3a16d597 100644 --- a/src/settings/plugins/ifcfg-rh/meson.build +++ b/src/settings/plugins/ifcfg-rh/meson.build -@@ -70,7 +70,7 @@ +@@ -69,7 +69,7 @@ install_data( ) meson.add_install_script('sh', '-c', diff --git a/pkgs/tools/networking/network-manager/fix-paths.patch b/pkgs/tools/networking/network-manager/fix-paths.patch index 938fcbdc7719..015c540c0ede 100644 --- a/pkgs/tools/networking/network-manager/fix-paths.patch +++ b/pkgs/tools/networking/network-manager/fix-paths.patch @@ -1,6 +1,8 @@ +diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c +index 204b7c286..8bdb734c2 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c -@@ -214,10 +214,7 @@ +@@ -215,10 +215,7 @@ nm_vpn_openconnect_authenticate_helper (const char *host, NULL, }; @@ -10,21 +12,25 @@ - return FALSE; + path = "@openconnect@/bin/openconnect"; - argv[0] = (char *) path; - argv[1] = "--authenticate"; + if (!g_spawn_sync (NULL, + (char **) NM_MAKE_STRV (path, "--authenticate", host), +diff --git a/data/84-nm-drivers.rules b/data/84-nm-drivers.rules +index e398cb9f2..31c56596a 100644 --- a/data/84-nm-drivers.rules +++ b/data/84-nm-drivers.rules -@@ -7,6 +7,6 @@ +@@ -7,6 +7,6 @@ ACTION!="add|change", GOTO="nm_drivers_end" # Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end" DRIVERS=="?*", GOTO="nm_drivers_end" --PROGRAM="/bin/sh -c 'ethtool -i $1 | sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" -+PROGRAM="@shell@ -c '@ethtool@/bin/ethtool -i $1 | @gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" +-PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $$1 |/usr/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" ++PROGRAM="@shell@ -c '@ethtool@/bin/ethtool -i $$1 |@gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" LABEL="nm_drivers_end" +diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in +index 2f442bf23..c3e797bf4 100644 --- a/data/NetworkManager.service.in +++ b/data/NetworkManager.service.in -@@ -8,7 +8,7 @@ +@@ -8,7 +8,7 @@ Before=network.target @DISTRO_NETWORK_SERVICE@ [Service] Type=dbus BusName=org.freedesktop.NetworkManager @@ -33,9 +39,11 @@ #ExecReload=/bin/kill -HUP $MAINPID ExecStart=@sbindir@/NetworkManager --no-daemon Restart=on-failure +diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c +index 823cf48a5..cda16e48d 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c -@@ -12451,14 +12451,14 @@ nm_device_start_ip_check (NMDevice *self) +@@ -12822,14 +12822,14 @@ nm_device_start_ip_check (NMDevice *self) gw = nm_ip4_config_best_default_route_get (priv->ip_config_4); if (gw) { nm_utils_inet4_ntop (NMP_OBJECT_CAST_IP4_ROUTE (gw)->gateway, buf); @@ -53,10 +61,10 @@ } } diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c -index 6f55e62a7..93721e7fb 100644 +index d896d4d33..4cacb5cb6 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c -@@ -442,7 +442,7 @@ nm_utils_modprobe (GError **error, gboolean suppress_error_logging, const char * +@@ -446,7 +446,7 @@ nm_utils_modprobe (GError **error, gboolean suppress_error_logging, const char * /* construct the argument list */ argv = g_ptr_array_sized_new (4);