From a7acfa6ff0bdfa57e7b8024ec0bd4388ff68f10c Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 30 Oct 2024 11:42:09 +0700 Subject: [PATCH] ntfy-sh: client added delay for network availability --- system/services/ntfy-sh.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/services/ntfy-sh.nix b/system/services/ntfy-sh.nix index 493253b..5a83e18 100644 --- a/system/services/ntfy-sh.nix +++ b/system/services/ntfy-sh.nix @@ -74,7 +74,14 @@ lib.mkMerge [ ]; description = "ntfy-sh client"; serviceConfig = { - ExecStart = "${pkgs.ntfy-sh}/bin/ntfy --debug subscribe --config /etc/ntfy/client.yml --from-config"; + ExecStart = lib.meta.getExe ( + pkgs.writeShellScriptBin "entrypoint.sh" '' + until ${pkgs.unixtools.ping}/bin/ping -c 1 ${domain}; do + ${pkgs.coreutils}/bin/sleep 1; + done + ${pkgs.ntfy-sh}/bin/ntfy --debug subscribe --config /etc/ntfy/client.yml --from-config + '' + ); Restart = "on-failure"; # User = config.profile.user.uid; # Group = config.profile.user.gid;