My infrastructure is setup as a nix flake, with each host configured as a separate nixosConfiguration
using flake-parts
. A justfile
contains common commands like building and deploying.
Pharos, named after the lighthouse at Alexandria, hosts public-facing services, currently just the gtf.io website while I work out how to do other things.
- gtf-io
- a prometheus server to collect metrics
- Build the virtual image for the host:
just make-image HOST
- Upload the image from
./result/nixos.qcow.gz
to digitalocean cloud.digitalocean.com/images - Create a new droplet with this image
- Point HOST.gtf.io at that droplet
just make-config HOST
Things like the gtf.io website need to be explicitly updated in the flake.lock file before you will be able to deploy changes. To do that, just run:
just update-my-deps
This is to avoid accidentally updating the whole flake lockfile (nix flake update
) which will result in everything in the host configuration being updated, and therefore a very, very long deployment time.