From 454b27937f2d3c07457dfdaf37474f4e037c1cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Wygoda?= Date: Thu, 3 Jun 2021 08:48:25 +0200 Subject: [PATCH] customBuilds: add digitalOcean --- doc/SUMMARY.md | 1 + doc/flk/doi.md | 10 ++++++++++ modules/customBuilds.nix | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 doc/flk/doi.md diff --git a/doc/SUMMARY.md b/doc/SUMMARY.md index f35bf379..e2b6e9a4 100644 --- a/doc/SUMMARY.md +++ b/doc/SUMMARY.md @@ -24,6 +24,7 @@ - [up](./flk/up.md) - [update](./flk/update.md) - [get](./flk/get.md) + - [doi](./flk/doi.md) - [iso](./flk/iso.md) - [install](./flk/install.md) - [home](./flk/home.md) diff --git a/doc/flk/doi.md b/doc/flk/doi.md new file mode 100644 index 00000000..fc522cdd --- /dev/null +++ b/doc/flk/doi.md @@ -0,0 +1,10 @@ +# DigitalOcean + +Now you can [create a droplet](https://cloud.digitalocean.com/droplets/new) using your custom image. + +Making a DigitalOcean compatible image for `hosts/NixOS.nix` is as simple as: +```sh +flk doi NixOS +``` + +This works for any file matching `hosts/*.nix` excluding `default.nix`. diff --git a/modules/customBuilds.nix b/modules/customBuilds.nix index e343c80e..7181f65e 100644 --- a/modules/customBuilds.nix +++ b/modules/customBuilds.nix @@ -25,5 +25,9 @@ in } ]; })).config.home-manager.users; + + digitalOcean = (mkBuild ({ modulesPath, ... }: { + imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ]; + })).config.system.build.digitalOceanImage; }; }