Provisioning a NixOS node in DigitalOcean
Here’s an easy way to get a NixOS node spun up using nixos-infect. 1) Set up a new droplet Choose Ubuntu 22.04 Add SSH keys for something you have a local IdentityFile for. Under “Advanced Options” -> “Add initialization scripts” paste #cloud-config write_files: - path: /etc/nixos/host.nix permissions: '0644' content: | {pkgs, ...}: { environment.systemPackages = with pkgs; [ vim ]; } runcmd: - curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=digitalocean NIXOS_IMPORT=./host.nix NIX_CHANNEL=nixos-25.05 bash 2>&1 | tee /tmp/infect.log 2) SSH in and copy config down Add the node’s SSH config to ~/.ssh/config ...