networkmanager: fix link-local ip addresses

NetworkManager needs an additional avahi-user to use link-local
IPv4 (and probably IPv6) addresses. avahi-autoipd also needs to be
patched to the right path.

+8
+1
nixos/modules/misc/ids.nix
··· 252 252 gammu-smsd = 228; 253 253 pdnsd = 229; 254 254 octoprint = 230; 255 + avahi-autoipd = 231; 255 256 256 257 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! 257 258
+5
nixos/modules/services/networking/networkmanager.nix
··· 228 228 users.extraUsers = [{ 229 229 name = "nm-openvpn"; 230 230 uid = config.ids.uids.nm-openvpn; 231 + } 232 + { 233 + # to enable link-local connections 234 + name = "avahi-autoipd"; 235 + uid = config.ids.uids.avahi-autoipd; 231 236 }]; 232 237 233 238 systemd.packages = cfg.packages;
+2
pkgs/tools/networking/network-manager/default.nix
··· 20 20 --replace /bin/sh ${stdenv.shell} \ 21 21 --replace /usr/sbin/ethtool ${ethtool}/sbin/ethtool \ 22 22 --replace /bin/sed ${gnused}/bin/sed 23 + # to enable link-local connections 24 + substituteInPlace src/devices/nm-device.c --replace '("avahi-autoipd", NULL, NULL)' '("avahi-autoipd", &"${avahi}/sbin/avahi-autoipd", NULL)' 23 25 configureFlags="$configureFlags --with-udev-dir=$out/lib/udev" 24 26 ''; 25 27