1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

fix: more robust resolving of influxdb2 provisioning address

This commit is contained in:
oddlama 2023-08-17 17:18:28 +02:00
parent f29318a5ac
commit dfd49c656a
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -17,6 +17,7 @@
genAttrs genAttrs
getExe getExe
hasAttr hasAttr
hasInfix
head head
literalExpression literalExpression
mkBefore mkBefore
@ -24,8 +25,8 @@
mkIf mkIf
mkOption mkOption
optional optional
optionalString
optionals optionals
optionalString
types types
unique unique
; ;
@ -64,7 +65,13 @@
provisioningScript = pkgs.writeShellScript "post-start-provision" ('' provisioningScript = pkgs.writeShellScript "post-start-provision" (''
set -euo pipefail set -euo pipefail
export INFLUX_HOST="http://"${escapeShellArg (cfg.settings.http-bind-address or "localhost:8086")} export INFLUX_HOST="http://"${escapeShellArg (
if
! hasAttr "http-bind-address" cfg.settings
|| hasInfix "0.0.0.0" cfg.settings.http-bind-address
then "localhost:8086"
else cfg.settings.http-bind-address
)}
# Wait for the influxdb server to come online # Wait for the influxdb server to come online
count=0 count=0