Image Bakery with Nix

Hi everyone,

I’m relatively new to Nix—I started using it as my main OS and customizing it a few months ago, and I love it. I currently have an image bakery process for building vanilla and customized VM templates on vSphere, and I was wondering if there’s support for doing this with Nix.

Here’s the current workflow:

  1. A push event to a GitLab repository triggers a webhook.
  2. Jenkins starts the job corresponding to the webhook.
  3. Jenkins uses the Kubernetes plugin to create a new pod in the cluster based on a predefined pod template for the Jenkins agent (a pod running a Packer-Ansible container).
  4. Packer downloads the ISO from Satellite.
  5. Packer starts a VM from the ISO in vSphere.
  6. Packer uses Ansible to configure the VM.
  7. Packer stops the VM and converts it into a template in vSphere.

Thanks for the help :slight_smile:

Hi.

By doing fuzzy match of my memory with your process description :smiley: , I think you might want to check out GitHub - nix-community/nixos-generators: Collection of image builders [maintainer=@Lassulus] . I didn’t use it for working with VMs though, just for making custom OS images for VPS initialization. But I managed to do 99% declarative VPS provisioning through use of Terraform/Openstack + nixos-generators + GitHub - nix-community/disko: Declarative disk partitioning and formatting using nix [maintainer=@Lassulus] for disk partitioning.