refactor(ops/terraform/deploy-nixos): downcase bash variables

These are not environment variables, so let's shout less.

Change-Id: I3132844937ee78b7230a46afc0240e0225a99f3e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11140
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2024-03-13 18:37:28 +02:00 committed by clbot
parent 8f19ffc4fd
commit a9db1455f5

View file

@ -10,11 +10,12 @@ set -ueo pipefail
# Load input variables from Terraform. jq's @sh format takes care of
# escaping.
eval "$(jq -r '@sh "ATTRPATH=\(.attrpath) && ENTRYPOINT=\(.entrypoint)"')"
eval "$(jq -r '@sh "attrpath=\(.attrpath) && entrypoint=\(.entrypoint)"')"
# Evaluate the system derivation.
[[ -z "$ENTRYPOINT" ]] && ENTRYPOINT=$(git rev-parse --show-toplevel)
SYSTEM_DRV=$(nix-instantiate -A "${ATTRPATH}" "${ENTRYPOINT}")
[[ -z "$entrypoint" ]] && entrypoint=$(git rev-parse --show-toplevel)
# shellcheck disable=SC2154
system_drv=$(nix-instantiate -A "${attrpath}" "${entrypoint}")
# Return system derivation back to Terraform.
jq -n --arg drv "$SYSTEM_DRV" '{"drv":$drv}'
jq -n --arg drv "$system_drv" '{"drv":$drv}'