Gabriella439/terraform-nixos-ng

Terraform modules for NixOS and spiritual successor to the terraform-nixos project

HCL

156

17 commits

updated Apr 11, 2025

See the code

README

terraform-nixos-ng

This repository provides two Terraform modules:

  • ./nixos - A Terraform module for auto-deploying a NixOS configuration to a target host

  • ./ami - A Terraform module for computing the correct NixOS AMI to use

Example usage

You can find an example Terraform project using these modules in the ./example directory.

Motivation

The main reason this repository exists is because the terraform-nixos repository is abandoned. I wanted to simplify the upstream project in two major ways:

  • I wanted to simplify the deployment logic with nixos-rebuild

    … using the trick documented in this blog post

  • I wanted to simplify the AMI module

    … by not requiring the list to be manually updated like this

However, since the upstream project doesn't appear to be maintained I created my own opinionated fork that is simpler than the original. The main omissions compared to the original are:

  • No support for secrets management

    However, you can use this in conjunction with sops-nix if you need secrets management

  • No support for GCE images (yet)

    … mainly because I don't use Google Compute Engine, but I'd accept a PR to add support following the same pattern as the ami module.

Contributors

Gabriella439

13 commits

dnaq

2 commits

techster10173

1 commits

yuanw

1 commits

Gabriella439/terraform-nixos-ng

Terraform modules for NixOS and spiritual successor to the terraform-nixos project

HCL

156

17 commits

updated Apr 11, 2025

See the code

README

terraform-nixos-ng

This repository provides two Terraform modules:

  • ./nixos - A Terraform module for auto-deploying a NixOS configuration to a target host

  • ./ami - A Terraform module for computing the correct NixOS AMI to use

Example usage

You can find an example Terraform project using these modules in the ./example directory.

Motivation

The main reason this repository exists is because the terraform-nixos repository is abandoned. I wanted to simplify the upstream project in two major ways:

  • I wanted to simplify the deployment logic with nixos-rebuild

    … using the trick documented in this blog post

  • I wanted to simplify the AMI module

    … by not requiring the list to be manually updated like this

However, since the upstream project doesn't appear to be maintained I created my own opinionated fork that is simpler than the original. The main omissions compared to the original are:

  • No support for secrets management

    However, you can use this in conjunction with sops-nix if you need secrets management

  • No support for GCE images (yet)

    … mainly because I don't use Google Compute Engine, but I'd accept a PR to add support following the same pattern as the ami module.

Contributors

Gabriella439

13 commits

dnaq

2 commits

techster10173

1 commits

yuanw

1 commits

Languages

HCL

86.1%

Shell

7.6%

Nix

6.3%