NixIT

A whole fleet of servers, desktops and domain controllers, described in one flake and rebuilt from scratch on demand.

What if every machine you run could be thrown away and rebuilt, identical, with one command? NixIT is my answer for a real fleet: self-hosted services, desktops, a development workstation and even domain controllers, all described in a single NixOS flake.

From empty VM to running service

A new machine is installed in one step with disko and nixos-anywhere: partitions, system, services, secrets. Updates go out with deploy-rs, which rolls back on its own if a machine does not come up healthy afterwards. Secrets are encrypted with sops-nix against each machine’s SSH host key, so they never sit in the repository in plain text.

Nothing is exposed to the internet directly. All traffic comes in through a single reverse proxy, with a tunnel per machine. The identity provider configures its own realm and login clients on first boot, so a fresh service is behind single sign-on before anyone has touched it.

Why not just Docker?

The question everyone asks. Most services run as native NixOS modules instead of containers. The README puts it plainly: that is more managed through Nix than a container, not less. Versions, configuration and dependencies all live in the same reviewable file.

Today that is 25 service modules and 8 server roles, from domain controller and DHCP to RADIUS and an RDP session host, in about 5,300 lines of Nix.

The part nobody puts in a README

The commit history is the honest story. June was a run of real debugging:

  • an identity server stuck in a restart loop until it was built once and then started in optimised mode,
  • a proxy setting that accepts a CIDR range and quietly ignores *,
  • a database directory that has to belong to user 70, not root,
  • a NAS that only speaks one protocol version, discovered the hard way.

Every one of those is now a line in the flake, and will never have to be found again.

Source: github.com/MyDrift-user/NixIT