From 3a8f9696e17ec5aa450b242ab0040b6beaf9dd74 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 2 Jun 2022 22:48:10 +0200 Subject: [PATCH] Defer network-dependent services startup --- modules/periodic.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/periodic.nix b/modules/periodic.nix index 2ab80e1..82a8844 100644 --- a/modules/periodic.nix +++ b/modules/periodic.nix @@ -18,6 +18,7 @@ in { ''; serviceConfig.Type = "oneshot"; startAt = "22:00:00"; + after = [ "network-online.target" ]; }; # Clean up Doom Emacs monthly @@ -38,6 +39,7 @@ in { script = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa"; serviceConfig.Type = "oneshot"; startAt = "Wed 18:00:00"; + after = [ "network-online.target" ]; }; # Push password-store changes to git daily @@ -47,6 +49,7 @@ in { script = "${pkgs.pass-wayland}/bin/pass git push"; serviceConfig.Type = "oneshot"; startAt = "18:00:00"; + after = [ "network-online.target" ]; }; # Sync mail using IDLE @@ -63,7 +66,7 @@ in { Restart = "always"; RestartSec = 20; }; - after = [ "network.target" ]; + after = [ "network-online.target" ]; }; systemd.user.services.goimapnotify-gmail = { @@ -79,7 +82,7 @@ in { Restart = "always"; RestartSec = 20; }; - after = [ "network.target" ]; + after = [ "network-online.target" ]; }; systemd.user.services.goimapnotify-disroot = { @@ -95,7 +98,7 @@ in { Restart = "always"; RestartSec = 20; }; - after = [ "network.target" ]; + after = [ "network-online.target" ]; }; # HACK Change home partition permissions for mopidy @@ -115,5 +118,6 @@ in { script = "${pkgs.git}/bin/git -C /home/coolneng/Projects/panacea push"; serviceConfig.Type = "oneshot"; startAt = "14:00:00"; + after = [ "network-online.target" ]; }; }