From 65b07a936b358a20ef356fac4cb81eb5347dd0a8 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 19 Jul 2024 12:00:52 +0300 Subject: [PATCH] Make sure Mimir starts after network is up --- services/monitoring/lgtm/mimir.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/monitoring/lgtm/mimir.nix b/services/monitoring/lgtm/mimir.nix index 1228570..335bd2d 100644 --- a/services/monitoring/lgtm/mimir.nix +++ b/services/monitoring/lgtm/mimir.nix @@ -85,14 +85,20 @@ in }; }; - systemd.services.mimir.serviceConfig.EnvironmentFile = [ config.age.secrets.mimir-environment.path ]; + systemd.services.mimir = { + # Mimir tries to determine its own IP address for gossip purposes, + # even when it's the only instance, and fails if it can't find one. + # Avoid that by ensuring it starts after the network is set up. + after = ["network-online.target"]; + serviceConfig.EnvironmentFile = [ config.age.secrets.mimir-environment.path ]; + }; services.nginx = { upstreams.mimir = { servers."127.0.0.1:${toString mimirPort}" = {}; extraConfig = "keepalive 16;"; }; - + virtualHosts."mimir.forkos.org" = { enableACME = true; forceSSL = true;