From 8cb5c75a832d2a76f02aaed144cbe91574a54d1d Mon Sep 17 00:00:00 2001 From: Linnnus Date: Tue, 27 Aug 2024 13:59:51 +0200 Subject: ahmed: Don't attempt to fetch linus.onl source before network is online I thought this restriction was already being enforced since I set systemd.services."${domain}-source".after = ["network-online.target"] but that apparently wasn't enough. I had to also ensure the timer, which triggered the service was ordered after "network-online.target". --- hosts/ahmed/linus.onl/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hosts/ahmed') diff --git a/hosts/ahmed/linus.onl/default.nix b/hosts/ahmed/linus.onl/default.nix index c31eb73..3c4f7a6 100644 --- a/hosts/ahmed/linus.onl/default.nix +++ b/hosts/ahmed/linus.onl/default.nix @@ -44,7 +44,6 @@ in { User = "${domain}-builder"; Group = "${domain}-builder"; }; - startAt = "*-*-* *:00/5:00"; path = with pkgs; [ git @@ -77,6 +76,14 @@ in { wantedBy = ["nginx.service"]; }; + # Start the source fetching shit only after network acess has been achieved. + systemd.timers."${domain}-source" = { + after = ["network-online.target"]; + requires = ["network-online.target"]; + wantedBy = ["timers.target"]; + timerConfig.OnCalendar = ["*-*-* *:00/5:00"]; + }; + # Register domain name with ddns. services.cloudflare-dyndns.domains = [domain]; -- cgit v1.2.3