about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-13T16·37+0200
committerclbot <clbot@tvl.fyi>2024-03-14T06·03+0000
commita9db1455f57a5848fa3aa58e3891d3083252700f (patch)
tree3679f7398f5db4c8a0a46497c551d24e15a92b1d /ops
parent8f19ffc4fd93db4c8427db81716f31b45815fcfd (diff)
refactor(ops/terraform/deploy-nixos): downcase bash variables r/7689
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>
Diffstat (limited to 'ops')
-rwxr-xr-xops/terraform/deploy-nixos/nixos-eval.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/ops/terraform/deploy-nixos/nixos-eval.sh b/ops/terraform/deploy-nixos/nixos-eval.sh
index 0b645daeb59b..dbc03d2fecf5 100755
--- a/ops/terraform/deploy-nixos/nixos-eval.sh
+++ b/ops/terraform/deploy-nixos/nixos-eval.sh
@@ -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}'