2020-11-10 07:15:13 +00:00
|
|
|
resource "digitalocean_volume" "git" {
|
|
|
|
region = "nyc3"
|
|
|
|
name = "git-storage-1"
|
2023-08-19 17:04:28 +00:00
|
|
|
size = 100
|
2020-11-10 07:15:13 +00:00
|
|
|
initial_filesystem_type = "ext4"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "digitalocean_droplet" "git-1" {
|
|
|
|
name = "git-1"
|
|
|
|
|
|
|
|
image = data.digitalocean_image.nixos_base.id
|
|
|
|
region = "nyc3"
|
|
|
|
size = "s-1vcpu-1gb"
|
|
|
|
|
|
|
|
ssh_keys = [data.digitalocean_ssh_key.mops.id]
|
|
|
|
}
|
|
|
|
|
2021-10-16 02:16:03 +00:00
|
|
|
resource "digitalocean_floating_ip" "code_betamike_com" {
|
|
|
|
droplet_id = digitalocean_droplet.git-1.id
|
|
|
|
region = digitalocean_droplet.git-1.region
|
|
|
|
}
|
|
|
|
|
2020-11-10 07:15:13 +00:00
|
|
|
resource "digitalocean_volume_attachment" "git" {
|
|
|
|
droplet_id = digitalocean_droplet.git-1.id
|
|
|
|
volume_id = digitalocean_volume.git.id
|
|
|
|
}
|
|
|
|
|
|
|
|
module "deploy_nixos_git" {
|
|
|
|
source = "github.com/tweag/terraform-nixos//deploy_nixos?ref=d055d2180da230e47ba9082fc53a8b7d1fadbc43"
|
|
|
|
|
|
|
|
nixos_config = "../nixos_configs/git.nix"
|
|
|
|
|
|
|
|
target_user = "root"
|
|
|
|
target_host = digitalocean_droplet.git-1.ipv4_address
|
|
|
|
|
|
|
|
triggers = {
|
|
|
|
// Also re-deploy whenever the VM is re-created
|
|
|
|
instance_id = digitalocean_droplet.git-1.id
|
|
|
|
}
|
|
|
|
}
|