nixos/deconz: delay signalling service readiness until it's actually up

Fixes test flakiness (`nix-build -A nixosTests.deconz`).
This commit is contained in:
Bjørn Forsman 2024-04-16 18:40:49 +02:00
parent fd0b14a61d
commit d4b989cafc

View File

@ -93,6 +93,13 @@ in
# be garbage collected. Ensure the file gets "refreshed" on every start.
rm -f ${stateDir}/.local/share/dresden-elektronik/deCONZ/zcldb.txt
'';
postStart = ''
# Delay signalling service readiness until it's actually up.
while ! "${lib.getExe pkgs.curl}" -sSfl -o /dev/null "http://${cfg.listenAddress}:${toString cfg.httpPort}"; do
echo "Waiting for TCP port ${toString cfg.httpPort} to be open..."
sleep 1
done
'';
environment = {
HOME = stateDir;
XDG_RUNTIME_DIR = "/run/${name}";