nixos/wireguard-networkd: fix 'cannot find device' error

In some situations, the dynamic refresh can fail to bring up the
wireguard interface. If that happens, all subsequent refresh attempts
will fail because the 'ip link delete' command fails with "Cannot find
device". If this happens, we now proceed with the networkctl reload
anyway.

Changed files
+1 -1
nixos
modules
services
+1 -1
nixos/modules/services/networking/wireguard-networkd.nix
···
# See: https://github.com/systemd/systemd/issues/9911
# This hack does the job but takes down the whole interface to do it.
script = ''
-
ip link delete ${name}
networkctl reload
'';
};
···
# See: https://github.com/systemd/systemd/issues/9911
# This hack does the job but takes down the whole interface to do it.
script = ''
+
ip link delete ${name} || :
networkctl reload
'';
};