diff options
author | 0x4A6F <0x4A6F@users.noreply.github.com> | 2022-12-30 17:48:49 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2023-01-01 11:01:02 +0100 |
commit | 7e159b1a6745f4d00f77aed23f007e134b0e9fb8 (patch) | |
tree | d85451f475f0ef4a78565f369171c69bee8c7f68 /nixos/modules/services | |
parent | d62198f2d4e68882f405e9e6dd6f4093feb6bffe (diff) |
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)
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/networking/cloudflared.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/cloudflared.nix b/nixos/modules/services/networking/cloudflared.nix index 3ee43072ba861..b3f0e37d8e9e3 100644 --- a/nixos/modules/services/networking/cloudflared.nix +++ b/nixos/modules/services/networking/cloudflared.nix @@ -302,13 +302,14 @@ in mkConfigFile = pkgs.writeText "cloudflared.yml" (builtins.toJSON fullConfig); in nameValuePair "cloudflared-tunnel-${name}" ({ - after = [ "network.target" ]; + after = [ "network.target" "network-online.target" ]; + wants = [ "network.target" "network-online.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { User = cfg.user; Group = cfg.group; ExecStart = "${cfg.package}/bin/cloudflared tunnel --config=${mkConfigFile} --no-autoupdate run"; - Restart = "always"; + Restart = "on-failure"; }; }) ) |