nixos/cloudflared: systemd dependency fix

- also wait for network-online.target:
fixes startup error on reboot without functioning networking
- restart on-failure (upstream service definition)

authored by

0x4A6F and committed by
Bjørn Forsman
7e159b1a d62198f2

+3 -2
+3 -2
nixos/modules/services/networking/cloudflared.nix
··· 302 302 mkConfigFile = pkgs.writeText "cloudflared.yml" (builtins.toJSON fullConfig); 303 303 in 304 304 nameValuePair "cloudflared-tunnel-${name}" ({ 305 - after = [ "network.target" ]; 305 + after = [ "network.target" "network-online.target" ]; 306 + wants = [ "network.target" "network-online.target" ]; 306 307 wantedBy = [ "multi-user.target" ]; 307 308 serviceConfig = { 308 309 User = cfg.user; 309 310 Group = cfg.group; 310 311 ExecStart = "${cfg.package}/bin/cloudflared tunnel --config=${mkConfigFile} --no-autoupdate run"; 311 - Restart = "always"; 312 + Restart = "on-failure"; 312 313 }; 313 314 }) 314 315 )