diff options
Diffstat (limited to 'nixos/modules/services/networking/deconz.nix')
-rw-r--r-- | nixos/modules/services/networking/deconz.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/deconz.nix b/nixos/modules/services/networking/deconz.nix index 05b7247087771..88b0ee612d871 100644 --- a/nixos/modules/services/networking/deconz.nix +++ b/nixos/modules/services/networking/deconz.nix @@ -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}"; |