Stream: nixos

Topic: NixOS Cloud-init images


view this post on Zulip Andreas (Apr 03 2024 at 10:13):

I'd like to deploy NixOS VMs on Proxmox via terraform using Cloud-init images. (Potentially other real cloud providers with Terraform support as well)

On the legacy nix community there was this one thread I found: https://discourse.nixos.org/t/a-cloudinit-image-for-use-in-proxmox/27519

Any ideas on that anyone?

view this post on Zulip Andreas (Apr 03 2024 at 10:21):

The official documentation has a tutorial for deploying to AWS specifically with Terraform.

https://nix.dev/tutorials/nixos/deploying-nixos-using-terraform.html

But I am not looking for AWS. I am not sure the AWS image would do much good then.

view this post on Zulip Tim DeHerrera (Apr 03 2024 at 15:00):

you can build VM images with NixOS out of the box. They use qemu by default so you should be able to wire those up with proxmox if desired. I have also made some of my own cloud images for digitalocean and aws in the past, there are nixos modules in nixpkgs that you can simply import that will then give you a build target for the image under config.system.build

view this post on Zulip Andreas (Apr 04 2024 at 12:22):

but so if I build VM images, they won't support cloud-init, will they? So if I want to have a cluster of NixOS machines and set their IP address and authorized ssh-keys via cloud-init that won't work this way?

I might try and see what I can make out of this guy's gist from legacy nix discourse:

https://gist.github.com/voidus/1230b200043b7f815e2513663d16353b

That doesn't look too bad actually.

view this post on Zulip Tim DeHerrera (Apr 04 2024 at 13:40):

I know the do and aws images do respect ssh keys you set up through their api. Not sure if it uses cloud-init specifically for that or some ad hoc code path, but it works :sweat_smile:

view this post on Zulip Tim DeHerrera (Apr 04 2024 at 13:41):

There may be a nixos module for cloyd-init as well, haven't checked

view this post on Zulip Andreas (Apr 04 2024 at 13:52):

yeah there is such a module afaik... I will try to build something myself and share it here if it works... or if I run into issues.


Last updated: Nov 15 2024 at 12:33 UTC