r/GUIX • u/Jake1055 • Oct 31 '26
Declarative Proxmox deployments
I am still getting my bearings with Guix. I have an idea for the direction I'd like to go in the long term, but I need some guidance on how to approach it.
My goal is to write some Scheme that uses G-Expressions to initiate building a qcow2-gpt image from an operating-system definition.
Then, I would like to extend that Scheme so that it can:
- Copy the resulting image onto a NFS share that my proxmox node also has read access to
- Make API calls to the proxmox node to create a VM (if it doesn't exist), import the image as a new disk, update the boot order, and start up the new VM
Once this is working successfully, my hope is that I could have some CI/CD solution trigger automated deployment based on composite records which contain an operating-system, an IP/hostname for a proxmox node's management interface, and which VMID to squat.
I was hoping to ask the following:
- The System Crafters video suggested having a dedicated folder in your dotfiles repo for packages and services, along with one for generic "files".
If we were following that suggestion, where should I keep the Scheme code that implements all of this? Should it all be kept within one package? Should it be a change to the Guix code itself (e.g. an extension to guix deploy)?
- Please share if you know of any good reference materials for network programming in Scheme, or if you would recommend a specific library. I am familiar with using sockets in C.
1
u/necrophcodr Nov 01 '26
Im not sure how much can be done directly with Guix, but OpenTofu can perform some of the declarative API calls you spoke of for sure.
1
u/No-Bat6181 Nov 01 '26
I'd probably write this as a standalone program that depends on guix.
I've found the built in guile web module and it's documentation to be fine https://doc.guix.gnu.org/guile/latest/en/html_node/Web.html