Hetzner Cloud with NixOS
Create a new Hetzner cloud host with the following cloud-init script and you have a new NixOS-machine with nixos-unstable. This uses latest nixos-infect.
Creation via API⌗
Create an API key on Hetzner clouds GUI (Project -> Access -> API Tokens), then you can execute following POST requets, e.g. via curl:
First the SSH key:⌗
Substitute :bearer with your bearer token and :sshkey with your ssh-key
Then the server⌗
Again, substitute :bearer with your bearer token
Afterwards, use nixops to update the server, e.g. via a configuration.nix as follows (again, substitute :sshkey and :ipaddress with the newly created host’s IP )
Then you can use nixops create ./configuration.nix -d hetzner to create the initial deployment and nixops deploy -d hetzner to deploy new config