My scripts and a web form for vSphere VMs
Before I did any of this declaratively, I did it with scripts. A lot of what’s in my NixOS modules and pipelines today started out as a script I wrote because I was sick of typing the same commands.
Scripts
I’ve been writing bash, PowerShell and Python for over seven years. Bash for anything Linux. PowerShell because most of what I look after at work is Windows and Microsoft 365. Python for when a script gets too big for either of them.
I’ve used Linux as my own system for close to thirteen years. My dotfiles from 2016 are a tiling setup on X: bspwm with sxhkd for keybindings, polybar, compton, zsh, ncmpcpp for music and a couple of scripts for dual screens. Ten years later it’s a NixOS flake, celestial. It’s still just my config in a repository, it just covers the whole machine now and not a handful of files in my home directory.
A web form for vSphere VMs
A small Flask app from 2023. You fill in a name, template, CPUs, memory and disk size, and it hands those to an Ansible playbook that builds the VM in vSphere. The point was that asking for a VM shouldn’t require knowing your way around the vSphere client, or Ansible.
It only ever ran on an internal network. If I wrote it again I’d pass the values to Ansible as proper arguments instead of gluing a shell command together out of the form, and I’d run the jobs through a queue so the page could tell you whether the build actually worked.