direnvnixornixos
If nix is not available, you can try to make do with:
-
packer -
terraformwith terraform-provider-secret -
A nixos image for Digital Ocean, you can try to make one with
packerandnix-infectas follows:packer build packer/build-image.json
Then manually make a snapshot of it in the Digital Ocean console.
# Build an image
IMAGE=$(nixos-generate -f do -c nix/base.nix)
# Push the image to Digital Ocean
packer build -var image=$IMAGE packer/push-image.jsonIf you've never run this before, you need to create some AWS resources to store the terraform state. We choose to store the state in the cloud to improve locking, and persist it between machines.
# make sure you have aws credentials in ~/.aws
cd terraform/tf-modules/terraform-state
terraform init
terraform applyNow, you can run the rest of the deployment.
cp .env.example .env
$EDITOR .env # see variables.tf for advice on how to get certain vars
cd terraform
terraform init
terraform apply