diff options
Diffstat (limited to 'ops/terraform')
-rwxr-xr-x | ops/terraform/deploy-nixos/nix-eval.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ops/terraform/deploy-nixos/nix-eval.sh b/ops/terraform/deploy-nixos/nix-eval.sh index 2591da28ae0f..d7d59e317b61 100755 --- a/ops/terraform/deploy-nixos/nix-eval.sh +++ b/ops/terraform/deploy-nixos/nix-eval.sh @@ -27,8 +27,12 @@ eval "$(jq -r '@sh "attrpath=\(.attrpath) && entrypoint=\(.entrypoint) && argstr # shellcheck disable=SC2086,SC2154 drv=$(nix-instantiate -A "${attrpath}" "${entrypoint}" ${argstr}) +# Determine the output path. +outPath=$(nix show-derivation "${drv}" | jq -r ".\"${drv}\".outputs.out.path") + # Return a JSON back to stdout. # It contains the following keys: # # - `drv`: the store path of the Derivation that has been instantiated. -jq -n --arg drv "$drv" '{"drv":$drv}' +# - `outPath`: the output store path. +jq -n --arg drv "$drv" --arg outPath "$outPath" '{"drv":$drv, "outPath":$outPath}' |