From 4fee660d2d763055b5075d0f78052c5a7d15dda1 Mon Sep 17 00:00:00 2001 From: ltadeu6 Date: Mon, 22 Jun 2026 20:40:55 -0300 Subject: [PATCH] Wait for LG ThinQ DNS before Home Assistant --- hosts/Nixos/configuration.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/Nixos/configuration.nix b/hosts/Nixos/configuration.nix index adf617c..a623b36 100644 --- a/hosts/Nixos/configuration.nix +++ b/hosts/Nixos/configuration.nix @@ -1326,6 +1326,19 @@ in { services.home-assistant.lovelaceConfigFile = ../../configs/home-assistant/ui-lovelace.yaml; + systemd.services.home-assistant = { + wants = [ "tailscaled.service" ]; + after = [ "tailscaled.service" ]; + preStart = lib.mkAfter '' + for _ in $(${pkgs.coreutils}/bin/seq 1 60); do + if ${pkgs.glibc.bin}/bin/getent hosts api-aic.lgthinq.com >/dev/null; then + break + fi + ${pkgs.coreutils}/bin/sleep 1 + done + ''; + }; + environment.etc."home-assistant/ui-overview.yaml".source = ../../configs/home-assistant/ui-overview.yaml;