Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meatcar/deploy.denys.me
Deployment Configuration for denys.me
https://github.com/meatcar/deploy.denys.me
digitalocean nixos packer terraform wireguard
Last synced: about 1 month ago
JSON representation
Deployment Configuration for denys.me
- Host: GitHub
- URL: https://github.com/meatcar/deploy.denys.me
- Owner: meatcar
- Created: 2018-01-28T05:54:18.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-03-14T19:38:26.000Z (10 months ago)
- Last Synced: 2024-04-15T02:54:56.405Z (9 months ago)
- Topics: digitalocean, nixos, packer, terraform, wireguard
- Language: Nix
- Size: 504 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Infrastructure for denys.me
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
## Requirements
- `direnv`
- `nix` or `nixos`If `nix` is not available, you can try to make do with:
- `packer`
- `terraform` with [terraform-provider-secret](https://github.com/tweag/terraform-provider-secret)
- A nixos image for Digital Ocean, you can try to make one with `packer` and `nix-infect` as follows:```sh
packer build packer/build-image.json
```Then manually make a snapshot of it in the Digital Ocean console.
## Building a Base Image
```sh
# 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.json
```## Running
If 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.
```sh
# make sure you have aws credentials in ~/.aws
cd terraform/tf-modules/terraform-state
terraform init
terraform apply
```Now, you can run the rest of the deployment.
```sh
cp .env.example .env
$EDITOR .env # see variables.tf for advice on how to get certain vars
cd terraform
terraform init
terraform apply
```