Comparison with other Nix + Terraform projects
nix-tf-schema is a pure translation layer. Given an OpenTofu/Terraform
provider schema it produces nixpkgs module types, tfvars variable blocks and
Terraform module JSON -- and nothing else. It has no domain logic and no
orchestration of its own, and it is consumed by callPackage from a repository
that brings its own nixpkgs. That narrow scope makes it hard to place next to
the dozen-odd other projects joining Nix and Terraform, so this page maps the
territory.
The star counts below are a snapshot taken on 2026-08-23. They are a rough proxy for how likely a reader is to have heard of a project, not for its quality -- several of the smallest entries here are the closest neighbors in intent.
What we deliberately do not do
This library is the translation layer plus a few authoring primitives (ref,
the resource meta-arguments). Everything domain-specific stays in the project
that consumes it: the resource definitions themselves, orchestration of
deployments, state handling, secrets, and the delivery of values to Terraform at
run time (for example through TF_VAR_*). A consumer takes this library through
a pin (for example with npins), and the dependency flows one way only -- which
is why lib.nix holds its own cast and evalOption.
That split matters for reading the rest of this page: the tools below that look like they overlap with us mostly overlap with a consumer plus this library, not with this library on its own.
Three things "Nix and Terraform" can mean
The projects fall into three families, and the list below is grouped by them:
- Nix -> Terraform configuration. Write the configuration in the Nix module system and emit Terraform JSON or HCL, instead of writing HCL by hand. This is the family we are closest to -- except that we generate types and ship values at runtime, rather than generating the configuration itself.
- Terraform -> NixOS provisioning. Terraform stays the driver and gains the ability to install or update a NixOS machine, either through modules it calls or through a provider exposing NixOS as a resource. Orthogonal to what we do.
- Packaging. Getting Terraform binaries, providers or schemas into the Nix store. Complementary -- we consume schemas, however they arrive.
Two projects take on the first two families at once, and are listed under a heading of their own.
Two lineage chains explain why several entries look like near-duplicates: tweag's provider gave way to terraform-nixos, which gave way to terraform-nixos-ng; and tofunix describes itself as "inspired by Terranix but stricter".
The projects
Grouped by family, and ordered by stars within each group.
Nix -> Terraform configuration
- terranix -- 510 stars, active. "Combines the providers of Terraform (or OpenTofu) and the lazy, functional configuration of NixOS": describe a whole configuration in the NixOS module system and emit Terraform JSON, as an alternative to writing HCL. The most-starred project in this family. Docs.
- tf-ncl -- 86 stars, light activity. Generates Nickel contracts out of Terraform provider schemas, so a configuration is contract-checked before Terraform ever runs. In this family by intent rather than by language: the configuration is Nickel, with Nix as the glue rather than the output. Announcement.
- nixform -- 32 stars, dead since
2019. "Terraform by Hashicorp is a great tool with a meh language. Fixed."
Evaluates
*.tf.nixto*.tf.jsonand shells out toterraform, with no module system and no types. - terrafix -- 14 stars, inactive since 2024. Generates Terraform files from DRY Nix expressions, via an eDSL that emits HCL rather than JSON. Its README names not using the NixOS module system as its main drawback. Announcement.
- tofunix -- 7 stars on GitLab, active. "Combining Nix and Terraform for reproducibility and developer experience": Terraform configurations written in Nix and validated by the nixpkgs module system, plus provider-packaging and all-in-one CLI helpers. The nearest neighbor to our technique. Docs.
- terranix-next -- 0 stars,
never developed past "WIP". A single 2023 commit and an empty README, so its
goal is genuinely unstated; it contains only a flake and a
lib/, alongside the same author's terraform-schemas. Placed here on the strength of its name alone.
Terraform -> NixOS provisioning
- nixos-anywhere -- 3393
stars, active. Installs NixOS anywhere over SSH; its
terraform/modules let Terraform install a machine and keep it updated withnixos-rebuild, so no separate deploy tool is needed. The star count is for the whole repository, of which the Terraform modules are a small part. Docs, 1.0 release thread. - terraform-nixos -- 417
stars, dormant (
masterlast moved in 2021). Terraform modules that push a NixOS closure onto a running machine, positioned as a NixOps alternative that offloads cloud-resource creation to Terraform's much larger provider ecosystem. - terraform-nixos-ng
-- 157 stars, low activity. The self-described spiritual successor to
terraform-nixos, deliberately smaller: it deploys with
nixos-rebuild --target-hostinstead of hand-rolled deploy logic and defers secrets to sops-nix. Announcement. - terraform-provider-nix -- 122 stars, dormant since 2020. A Go provider exposing Nix builds and NixOS installations as Terraform resources, so images can be built from Nix expressions and deployed by Terraform.
- terraform-provider-nixos
-- 71 stars, archived. Aimed to "reduce NixOps' realm of control by moving
all provisioning steps into Terraform"; its
nixos_noderesource wrote out.nixfiles for NixOps to consume. Its README points at terraform-nixos instead. - terraform-provider-nixos
-- 22 stars, dormant since 2022 and self-described as alpha. Its
nixos_instanceresource provisions a NixOS instance over SSH from a configuration path. - nixiform -- 20 stars, barely active.
"Provision infrastructure with Terraform and manage configuration with NixOS":
it reads a
nixiformoutput from Terraform state, installs NixOS onto nodes that need it, then pushes each node's configuration.
Both directions
Two projects generate the Terraform configuration and carry out the NixOS deploy -- the NixOps-shaped ambition the rest of the list splits in two.
- teraflops -- 58 stars, slowing. Aims for "an integrated experience for deployment workflows which involve both terraform and NixOS, similar to that of NixOps": colmena-flavored Nix modules generate the Terraform configuration, apply it, then hand off to colmena for the NixOS deploy. Announcement.
- tf-nix -- 21 stars, quietly active. "Terraform and Nix{,OS} all mashed together": pure-Nix configuration, NixOS deployment and key delivery in one personal-scale tool.
Packaging
- nixpkgs-terraform -- 109 stars, active. Every Terraform release from 1.0.0 onward as a Nix package, updated weekly by CI, for reproducible dev shells.
- nixpkgs-terraform-providers-bin
-- 62 stars, active. A daily snapshot of the Terraform Registry packaged with
Nix, mapped 1:1 onto attributes (
providers.hashicorp.aws), forwithPluginsusers pinned to an older nixpkgs. - terraform-schemas -- 3 stars, archived. All Terraform providers' schemas generated to JSON, with the results also committed to a branch so consumers can read them without an IFD. The same extraction problem we solve.
Where this library sits
Against terranix and tofunix, the nearest neighbors: they model a whole
configuration and bake its values into the store. Our unit of composition is one
resource per state, and values reach Terraform as TF_VAR_* at runtime. That
runtime delivery is also why schema-derived options are not widened to accept
${...} references: Terraform reads a variable's value as a literal, so a
reference placed in one would land in the plan verbatim. Where they emit literal
nested blocks, we emit dynamic blocks with for_each guards.
Against tf-ncl: the same schema-to-types idea, targeting Nickel contracts instead of nixpkgs module types.
Against terraform-schemas: the same schema-extraction problem, solved either
by IFD (extractProviderSchemas) or by vendoring a version-stamped JSON file
(mkProviderSchemaFile) so evaluation needs no provider binary.
The honest conclusion: to author Terraform in Nix wholesale, terranix or tofunix is the tool. This library is for a consumer that already has its own orchestration and wants typed options derived from a provider schema.