diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix index 8c2a3215f2a..7ef548a36b4 100644 --- a/modules/tasks/network-interfaces.nix +++ b/modules/tasks/network-interfaces.nix @@ -351,6 +351,8 @@ in createTunDevice = i: nameValuePair "${i.name}" { description = "Virtual Network Interface ${i.name}"; + requires = [ "dev-net-tun.device" ]; + after = [ "dev-net-tun.device" ]; wantedBy = [ "network.target" "sys-subsystem-net-devices-${i.name}.device" ]; serviceConfig = { Type = "oneshot"; @@ -407,6 +409,11 @@ in hostname "${config.networking.hostName}" ''; + services.udev.extraRules = + '' + KERNEL=="tun", TAG+="systemd" + ''; + }; }