Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

the dotfiles repo i should have made a decade ago

I finally rebuilt my dotfiles into a single repo with a sane bootstrap, stripping years of accumulated cruft and getting a fresh machine usable in one command.

A mechanical keyboard and a terminal

I've had a dotfiles repo for years. The problem is it was less a repo and more a midden: layers of config from machines I no longer own, shell functions referencing tools I uninstalled in 2019, and a .bashrc that sourced three other files which each sourced two more, in an order I'd long since lost the plot of. Setting up a new machine meant copying the bits I remembered and quietly reinventing the rest.

This week I finally did the boring, satisfying work of starting again properly.

Code on a screen

The structure now is plain. Everything lives in one repo, organised by tool, and gets symlinked into place by a single script. I went back and forth on whether to use a dedicated manager, and ended up on GNU Stow, which is delightfully boring. Each subdirectory mirrors the layout of $HOME, you run stow nvim and it links the lot. No magic, no lock-in, and I can see exactly what it did with ls -la.

The bootstrap is one command:

git clone https://github.com/jmylchreest/dotfiles ~/.dotfiles
cd ~/.dotfiles && ./bootstrap.sh

That installs the handful of packages I actually use, stows the configs, and sets up the shell. It's idempotent, so running it twice does no harm, which matters because I always run it twice out of nervousness.

The discipline I forced on myself was secrets. Nothing sensitive goes in the repo, obviously, but I'd been sloppy about the boundary before, with the odd API token lurking in an exported variable. Now anything secret lives outside the repo and gets sourced from a file the bootstrap creates but never tracks. The repo stays public-shareable, which keeps me honest.

The real test came on Friday when I set up a fresh laptop from nothing. Clone, bootstrap, log out and back in, and I was looking at my own prompt with my own keybindings and my own slightly eccentric Git aliases. Maybe four minutes, most of it package downloads. After years of death-by-a-thousand-tweaks, that felt genuinely good.

I won't pretend it'll stay tidy forever. Dotfiles rot the moment you stop looking. But it's in order today, the bootstrap works, and I've finally deleted the config for that terminal emulator I haven't used since I can't remember when. Small joys.