terraform: provision cc-ci on Hetzner Cloud (cpx32, nixos-infect, debian-12) #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "terraform-hetzner"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
terraform/andnix/hosts/cc-ci-hetzner/to provision cc-ci on Hetzner Cloud as an alternative to the Incuscc-nix-testVM (seecc-ci-plan/plan-cc-ci-hetzner-terraform.md).What is in this PR
terraform/— 7 files:versions.tf— hcloud provider pinned at1.64.0(OpenTofu/Terraform compatible)variables.tf— server type, location, image, SSH key, namemain.tf—hcloud_ssh_key+hcloud_server(cpx32, debian-12, nbg1, user-data)outputs.tf— server IPv4, ID, SSH connect commanduser-data.sh— nixos-infect pinned at40f62a680bb0e8f2f607d79abfaaecd99d59401c(2026-03-22).gitignore— tfstate + auto.tfvars + .terraform/ (secrets/state never committed).terraform.lock.hcl— provider SHA pins (analogous to flake.lock)README.md— full apply + Stage 2 instructionsnix/hosts/cc-ci-hetzner/— 3 files:hardware.nix— nixos-infect-generated hardware (GRUB+EFI, qemu-guest, /dev/sda1 ext4)networking.nix— infect-generated static networking (update IP per README when re-provisioning)configuration.nix— imports shared cc-ci modules + hardware; adds ports 80+443 for public IPflake.nix— addsnixosConfigurations.cc-ci-hetzner(parallel to existingcc-ciIncus host).Verification (throwaway run 2026-05-31)
terraform apply→ cpx32 server in nbg1 created in 17 s (Hetzner ID 134464512, IP 168.119.126.100)24.11.719113.50ab793786d9(same nixpkgs pin as the flake)nixos-rebuild build --flake .#cc-ci-hetzner→ exit 0 on the server (131 derivations built; all cc-ci modules: tailscale, drone, drone-runner, bridge, dashboard, harness, swarm, abra, proxy, secrets, …)terraform plan→ No changes (idempotent)terraform destroy→ server + SSH key deleted; billing stoppedOperator-pending step
Full
nixos-rebuild switch(Stage 2) needs the bootstrap age key at/var/lib/sops-nix/key.txt. The flake evaluates and builds without it; activation of sops-managed secrets requires it. Seeterraform/README.md§Stage 2.Decisions recorded (plan §7)
cpx31retired in nbg1; usingcpx32(same spec: AMD 4 vCPU / 8 GB x86)cc-ci-hetznerhost during transition; make it canonicalcc-ciafter cutoverDo not merge — throwaway verification only; real cutover is a separate operator step.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.