From 60e40a2073f4a893a78f093d8c8b52a2e46d9e58 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 20 Aug 2024 19:30:53 +0800 Subject: [PATCH] home-manager/services: update dependency settings for network-dependent services --- modules/home-manager/services/archivebox.nix | 8 +++++--- modules/home-manager/services/gonic.nix | 2 +- modules/home-manager/services/matcha.nix | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/services/archivebox.nix b/modules/home-manager/services/archivebox.nix index 0fd3bbbe..d4c3de62 100644 --- a/modules/home-manager/services/archivebox.nix +++ b/modules/home-manager/services/archivebox.nix @@ -113,7 +113,7 @@ in Unit = { Description = "Archivebox archive group '${name}' for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; @@ -142,7 +142,8 @@ in archivebox-server = { Unit = { Description = "Archivebox server for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; @@ -164,7 +165,8 @@ in lib.nameValuePair (jobUnitName name) { Unit = { Description = "Archivebox additions for ${cfg.archivePath}"; - After = "network.target"; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; Documentation = [ "https://docs.archivebox.io/" ]; }; diff --git a/modules/home-manager/services/gonic.nix b/modules/home-manager/services/gonic.nix index 980c126c..d135a3ad 100644 --- a/modules/home-manager/services/gonic.nix +++ b/modules/home-manager/services/gonic.nix @@ -40,7 +40,7 @@ in Unit = { Description = "Gonic media server"; Documentation = [ "https://github.com/sentriz/gonic/wiki" ]; - After = [ "network.target" ]; + After = [ "network-online.target" ]; }; Service = { diff --git a/modules/home-manager/services/matcha.nix b/modules/home-manager/services/matcha.nix index 72bed472..452ccbe9 100644 --- a/modules/home-manager/services/matcha.nix +++ b/modules/home-manager/services/matcha.nix @@ -59,6 +59,8 @@ in Unit = { Description = "Matcha periodic feed digest generator"; Documentation = [ "https://github.com/piqoni/matcha" ]; + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; }; Install.WantedBy = [ "default.target" ]; @@ -73,7 +75,6 @@ in Unit = { Description = "Matcha periodic feed digest generator"; Documentation = [ "https://github.com/piqoni/matcha" ]; - After = [ "network.target" ]; }; Install.WantedBy = [ "timers.target" ]; Timer = {