Introducing teraflops, an alternative to NixOps

i wrote a little python script i call teraflops which i’m using as a replacement for NixOps

teraflops - a terraform ops tool which is sure to be a flop

teraflops provides a command line interface pretty similar to NixOps and currently can be used to deploy digitalocean, hetznercloud, linode, lxd, and virtualbox machines running NixOS, just like NixOps does

consider the following trivial example:

{
  imports = [ teraflops.modules.hcloud ];

  meta = {
    nixpkgs = import nixpkgs {
      system = "x86_64-linux";
    };
  };

  machine = { pkgs, ... }: {
    deployment.targetEnv = "hcloud";
    deployment.hcloud = {
      server_type = "cx11";
      location = "nbg1";
    };

    environment.systemPackages = [ pkgs.htop ];
  };
}

with the above configuration you can simply run teraflops deploy --confirm --reboot and you’ll have a hetznercloud machine up and running with NixOS shortly, then make use of familiar NixOps commands like teraflops ssh machine, etc…

the script doesn’t actually do much itself, just glues together colmena, terraform, and nixos-infect to do some interesting things

maybe someone will also find this script useful so i thought i would share it

i hope you enjoy

9 Likes

Any plans to support opentofu?

yes, opentofu is already supported! i just thought i would keep it simple and write “terraform” everywhere instead of “terraform/opentofu”

i guess i should explicitly mention at least once in the reaadme that it is supported :+1:

3 Likes

Maybe we should just start defaulting to opentofu and let the terraform users figure it out. :wink:

3 Likes