diff options
author | Ben Sima <ben@bsima.me> | 2024-12-20 13:57:22 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2024-12-21 10:08:10 -0500 |
commit | 87ead51331bc57326882055e1635a84c2d409af7 (patch) | |
tree | fb82796cb4dc7247eecb73ead2904f14a96bf17e /Omni/Bild.nix | |
parent | e7d6505ff6bfefa927466361570cedde799e94a6 (diff) |
Create a bootstrap image for Digital Ocean droplets
I need a way to reliably get a NixOS VM provisioned in the cloud, and the
easiest way to do this is to create a qcow2 image, upload it to Digital Ocean,
and use that to start a droplet. This is very much a manual process, but that's
fine, I shouldn't need to do it very often (for now).
Diffstat (limited to 'Omni/Bild.nix')
-rw-r--r-- | Omni/Bild.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Omni/Bild.nix b/Omni/Bild.nix index 90fa979..a7c4e32 100644 --- a/Omni/Bild.nix +++ b/Omni/Bild.nix @@ -240,6 +240,15 @@ let # build an operating system. 'cfg' is the NixOS config os = cfg: (stable.nixos (_args: cfg)).toplevel; + # build an os image for a digital ocean droplet + droplet = cfg: + (stable.nixos ({ modulesPath, ... }: { + imports = [ + "${toString modulesPath}/virtualisation/digital-ocean-image.nix" + (_args: cfg) + ]; + })).digitalOceanImage; + # build a docker image image = stable.dockerTools.buildImage; }; |