Some Bits: Nelson's log

Chez Moi: modernizing Linux config

I’ve used Linux since 1994 and Unix since 1989. I have some very old and crufty configurations I’ve hauled around over the years with some clunky script to set up a new machine. I’ve modernized it with help from Gemini.

Dotfile management

The key tool I used is chezmoi. It’s a nicer version of my clunky script. It feels a little like git, but customized for shell configs. For instance I run chezmod add ~/.bashrc and it makes a copy of my current bashrc to ~/.local/share/chezmoi. If I run chezmod apply it copies all the files from that chezmoi repository to live places. It’s a little goofy but it works and it has advanced features for templating, encrypting secrets, etc. Note you’re expected to use git yourself to keep versions of this chezmoi mirror of your config files.

Setting up chezmoi was a very manual process of deciding what config files I want and manually importing them. In the end I’ve got 31 config files. A bunch of ancient tty stuff from my old configs and some new KDE stuff from my new Linux desktop

Modern Linux file locations

XDG defines is the modern standard location for config files. The key thing is ~/.config, which in theory is where all config files belong. This has been predictably corrupted over the years. Chrome spams it with over 6000 files including a bunch of binary junk. But it’s still a pretty useful standard. ~/.config/lesskey for instance lets you configure the less pager. (And in a text format now, hooray!)

Auditing config files

It’s very confusing what all your config files are. xdg-ninja is a helpful tool. It looks in your home directory for standard config files for a bunch of programs and advises you ways you can modernize and move things to .config. Not a panacea but a helpful tool!

Modern bash shell

There’s some nice tools that make bash really nice to use.

starship is a lovely dynamic prompt framework that is very fast. The key thing I rely on is it showing me git repo status.

atuin turns your shell history into a giant database you can query. It’s very nice if you have the habit of building up complex commands interactively.

Modernizing configs

I had a surprising amount of fun showing Gemini my config files and asking it to advise me on how to update things. For instance it suggested I don’t need 25 year old Netscape environment variables anymore. And that there’s better / newer ways to do some things with modern tools. It was a fun interactive process for an hour or two sweeping off some of the cobwebs. Particularly impressive that I can ask it things like “what does mpage -a do?” and it remembers some 25 year old BSD utility I long since forgot.