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