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 ...

Setting up deploy-rs for NixOS

Our starting point here is a node that is freshly infected with NixOS. For changing the system, we have 2 options. SSH in and edit the configuration files (or copy them over) and then run nixos-rebuild switch which triggers the node to pull and build all the necessary items. Check and build the configuration locally, and copy the entire closure across. At a glance there might not be an advantage to one or the other. But consider if you’re deploying custom content that isn’t part of nixOS builtin configuration. To use method (1) you would need to clone all your repos on the server to be able to rebuild. Then every update requires you to ssh in and pull. ...

Deploying Hugo in NixOS

While my instinct is to use Phoenix for everything, I had to admit it’s overkill for a personal website. I’m not here to flex complex backend integrations or live features. I’ve heard good things about Hugo, so maybe it’s time to try it. I will describe how Nix and deploy-rs allowed me to get framed out and deployed in one short and painless sitting! A quick google search yielded a serviceable flake for a Hugo dev environment. So I just ran nix develop, hugo new site and then had a Claude agent throw in some placeholder content. 5 minutes later I had something serving on localhost. ...