about summary refs log tree commit diff
path: root/ops/terraform/deploy-nixos/nixos-eval.sh
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-20T13·19+0200
committerclbot <clbot@tvl.fyi>2024-03-22T13·31+0000
commit3281fb9132c815c9a017e8ecd1e49b91b6cb92ff (patch)
treebe3236ab603e84bb095d9d934b2c7ad80984af7a /ops/terraform/deploy-nixos/nixos-eval.sh
parent798f8b9d43afa9289a4dc6db004d6958293c67fc (diff)
docs(ops/terraform/deploy-nixos): document inputs and outputs r/7760
This documents the input and output format, and also removes some
references to Terraform and evaluating NixOS system configurations.

It can be used to evaluate anything.

Change-Id: I8492cc3e386f89b299469c78e586644ee82a708f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11213
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'ops/terraform/deploy-nixos/nixos-eval.sh')
-rwxr-xr-xops/terraform/deploy-nixos/nixos-eval.sh21
1 files changed, 0 insertions, 21 deletions
diff --git a/ops/terraform/deploy-nixos/nixos-eval.sh b/ops/terraform/deploy-nixos/nixos-eval.sh
deleted file mode 100755
index f206fe7f6875..000000000000
--- a/ops/terraform/deploy-nixos/nixos-eval.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-
-# SPDX-FileCopyrightText: 2023 The TVL Authors
-#
-# SPDX-License-Identifier: MIT
-
-#
-# Builds a NixOS system configuration at the given attribute path.
-set -ueo pipefail
-
-# Load input variables from Terraform. jq's @sh format takes care of
-# escaping.
-eval "$(jq -r '@sh "attrpath=\(.attrpath) && entrypoint=\(.entrypoint) && argstr=\((.argstr // {}) | to_entries | map ("--argstr", .key, .value) | join(" "))"')"
-
-# Evaluate the system derivation.
-[[ -z "$entrypoint" ]] && entrypoint=$(git rev-parse --show-toplevel)
-# shellcheck disable=SC2086,SC2154
-system_drv=$(nix-instantiate -A "${attrpath}" "${entrypoint}" ${argstr})
-
-# Return system derivation back to Terraform.
-jq -n --arg drv "$system_drv" '{"drv":$drv}'