Skip to content

Creating Cloud Assets

Digital Ocean has a great command line interface tool called doctl. Handy dandy cURL works too if you want it to be system agnostic.

Create droplet: 1vcpu, 1gb, tor1, Ubuntu-22-04-x64
`cURL`
curl -X POST -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer '$TOKEN'' \
    -d '{"name":"ubuntu",
        "size":"s-1vcpu-1gb",
        "region":"tor1",
        "image":"ubuntu-22-04-x64"}' \
    "https://api.digitalocean.com/v2/droplets"
`doctl`
doctl compute droplet create \
    --image ubuntu-22-04-x64 \
    --size s-1vcpu-1gb \
    --region tor1 \
    ubuntu
Create droplet: 1vcpu, 1gb, tor1, nix-infect
`cURL`
curl -X POST -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer '$TOKEN'' \
    -d '{"name":"nixos",
        "size":"s-1vcpu-1gb",
        "region":"tor1",
        "image":"ubuntu-22-04-x64",
        "user_data":"#cloud-config\n\nruncmd:\n  - curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=digitalocean NIX_CHANNEL=nixos-22.11 bash 2>&1 | tee /tmp/infect.log"}' \
    "https://api.digitalocean.com/v2/droplets"
`doctl`
doctl compute droplet create \
    --image ubuntu-22-04-x64 \
    --size s-1vcpu-1gb \
    --region tor1 \
    --user-data #cloud-config

runcmd:
  - curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=digitalocean NIX_CHANNEL=nixos-22.11 bash 2>&1 | tee /tmp/infect.log \
    nixos