Nix-Infra Provisions and Orchestrates Your NixOS Private Cloud

Announcing nix-infra: Create a private PaaS on Hetzner Cloud in minutes using nix-infra. Leverages NixOS and Nix Packages to build a reproducible and auditable private cloud.

The humble goal of nix-infra is to make managing your private PaaS so simple that Azure, AWS or other PaaS-providers become a waste of time and money.

I think this could appeal to NixOS-users who want to avoid black box services, have privacy concerns or just want a predictable cloud bill.

Feedback much appreciated! I have only spent a year in the Nix ecosystem so there is much to learn. I have however previously created a similar automation tool that has been running in production for five years so I know that the basic building blocks are robust. This implementation is a massive improvement. I will be migrating my own cluster to nix-infra so it will at least be maintained for my own needs.

I have created a template project to allow you to easily try this out. Just head over to GitHub - jhsware/nix-infra-test: Minimal cluster setup for testing nix-infra and follow the 5 steps to creating your private cloud. All you need is a Hetzner Cloud API-key. The entire test takes 7-8 minutes and automagically does the following:

  1. provision nodes
  2. convert them to NixOS
  3. install and configure the cluster
  4. install user applications
  5. run tests to see that everything is working
  6. tear down the cluster

The actual tool is available in this repo: GitHub - jhsware/nix-infra: Create a private PaaS on Hetzner Cloud in minutes using nix-infra.

My hope is that this could allow users to create and share their own cluster setups in the same way people share their NixOS-configurations.

I am aware that there are a couple of other projects that provide similar functionality, but I wanted something that is easy to fork and maintain but still can be distributed as a single, self-contained, binary.

The tool is written in Dart, an approachable language that can both be interpreted and compiled. It is fast enough to run in interpreted mode without any noticeable performance penalty which makes development a breeze. You can use nix-shell to set up the dev-environment.

NOTE: I am a macOS user. There is a compiled Linux binary for x86, but my testing during the pre-release phase is on macOS.

8 Likes