The other day, a colleague at my company told us he needed to format his laptop to declutter the system a bit.
He is an outstanding professional. He ticks all the boxes: writes neat code, always reviews his code thoroughly before creating a PR, carefully refactors the code to make it as perfect as possible… But he was struggling with the task of formatting his computer.
Why? Because that means starting from scratch and losing all the configurations he already has.
I know he’s not alone in this. Many other devs don’t save their files properly and eventually realize this (in the worst case, after having issues with their computer and being forced to format it). I’m a bit of a maniac on this topic, but why don’t developers use the same tools they’re experts on to save their own configuration somewhere safe?.
There must be people in DevOps able to create a gazillion machines remotely, matching every line of configuration, setting up VPNs and subnetworks with a snap of their fingers — but if they lose their computer, they have to start from scratch.
I always encourage people to save their most vital files somewhere (a repo is preferred). You don’t need an exhausting ritual, or a fancy script that prepares, installs dependencies, and does all the magic, but at least save the files that make your environment unique. .bashrc, your terminal configuration, .tmux.conf, your VSCode config file, the configuration of that nice shell prompt you found on Reddit and whose name you always forget…
It only takes a couple of minutes to set up a repo, and it can save you not only time, but also the mental health benefit of feeling at home after formatting your computer or setting up a new laptop. People usually call these repos dotfiles, and they’re a great way to get insight into how somebody thinks by seeing how they interact with their computer.
Installing everything automatically is great but requires significant time to ensure it still works. I’ve recently tried using Ansible, and while it worked initially, the last time I needed it, I struggled with deprecations in the config files. So I don’t fully recommend it. At minimum, I suggest saving your files in a way that GNU Stow can use to replicate your home directory. I’ll write a post about Stow soon. It’s a great tool.
So please do yourself a favor and save your configuration files.
PS: Mine is here. I know it could be improved, but the important thing is that it exists and helps me a lot with my multi-computer setup.