about summary refs log tree commit diff
path: root/ops/terraform/deploy-nixos/nixos-eval.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ops/terraform/deploy-nixos/nixos-eval.sh')
-rwxr-xr-xops/terraform/deploy-nixos/nixos-eval.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/ops/terraform/deploy-nixos/nixos-eval.sh b/ops/terraform/deploy-nixos/nixos-eval.sh
index dd15784b1b49..38f036bba936 100755
--- a/ops/terraform/deploy-nixos/nixos-eval.sh
+++ b/ops/terraform/deploy-nixos/nixos-eval.sh
@@ -5,12 +5,11 @@ set -ueo pipefail
 
 # Load input variables from Terraform. jq's @sh format takes care of
 # escaping.
-eval "$(jq -r '@sh "ATTRPATH=\(.attrpath)"')"
+eval "$(jq -r '@sh "ATTRPATH=\(.attrpath) && ENTRYPOINT=\(.entrypoint)"')"
 
 # Evaluate the system derivation.
-# TODO: configurable REPO_ROOT
-REPO_ROOT=$(git rev-parse --show-toplevel)
-SYSTEM_DRV=$(nix-instantiate -A "${ATTRPATH}" "${REPO_ROOT}")
+[[ -z "$ENTRYPOINT" ]] && ENTRYPOINT=$(git rev-parse --show-toplevel)
+SYSTEM_DRV=$(nix-instantiate -A "${ATTRPATH}" "${ENTRYPOINT}")
 
 # Return system derivation back to Terraform.
 jq -n --arg drv "$SYSTEM_DRV" '{"drv":$drv}'