terranix
Installation
SKILL.md
Terranix
terranix generates Terraform JSON
from Nix modules. You write config.nix; the terranix tool (or a flake build)
produces config.tf.json, which OpenTofu (tofu) applies exactly like HCL —
same providers, same state, same plan/apply workflow.
Prefer OpenTofu over Terraform when the user hasn't pinned a choice: it's in
nixpkgs as pkgs.opentofu, command tofu, reads the same .tf.json files, and
resolves providers from its own registry mirror.
Two rules that prevent most mistakes:
config.tf.jsonis a build artifact. Never hand-edit it; regenerate it. Gitignore it along with state (see below).- Nix and Terraform share the
${}syntax (see Interpolation escaping) — this clash is the single biggest source of broken terranix configs.