Opensource Odyssey Site Logo

Chiseling dotfiles: The Digital Mason

[object Object]

I declare myself a Digital Mason. Instead of stone, I work with zeros and ones. Find how you can become one, too.

The Rough Ashlar

A concept, heard in passing, deeply resonated with me: The Rough Ashlar from Freemasonry. This has nothing to do with wearing robes, learning secret handshakes or participating in bizarre rituals. Instead that brick is the symbol of continuous improvement.

The Rough Ashlar is a jagged stone straight from the quarry. It is flawed, imperfect, unusable in masonry. It has to be chiseled to become smooth, useful, perfect.

Freemasonry draws the parallel of the stone to human life. A newcomer joining a lodge is the Rough Ashlar. Over their lifetime, they shape themselves into the person they want to become: The Smooth or Perfect Ashlar.

Not only is this metaphor is profound for personal growth, but can be applied to system crafting as well. That’s probably why it resonated so strongly with me.

Enter The Quarry

Switching from proprietary garbage, like MacOS or Windows, to Linux is like stepping into the quarry: There are countless stones. Some are pre-shaped - like Ubuntu, Manjaro or even Omarchy; some are minimal - like Arch, where you have to install every package yourself.

Picking your first distro feels like picking one of these stones. The endless choice is overwhelming. There is no “just do this”-solution. The first obstacle is getting a grasp of the landscape. Which stone/distro is best really depends on your preferences and goals.

For myself, reconnaissance meant trying out different distros. Starting with Ubuntu, then Kubuntu, then Linux Mint, back to Ubuntu, then Manjaro (read more about my Linux Odyssey here). Those were dark days, since tinkering often lead to a broken system, which meant re-installing everything from scratch and starting over. However, through trial and error, I learned about my own preferences and gained experience in the various flavors.

With understanding, it is possible to determine which packages are bloat - unwanted/unnecessary. Bloat is the enemy of the Perfect Ashlar.

Let The Chiseling Begin

I landed on Arch, btw. The beauty was that out of the box, Arch didn’t have any bloat!

The meme of Gru from “Despicable Me” comes to mind with the line “no packages installed”.

Every package had to be explicitly installed. This meant much more sweat to get things to work, let alone just right for me.

The revelation of that time were config files. Doom Emacs had already gently introduced me to the concept. All features are adjusted in the config.el (or rather config.org - literal programming FTW). The birth of my .dotfiles repo.

Declaring the configuration for Doom Emacs and having the configuration in a version control system (git) basically translates to “savegames”. Like a checkpoint in a video game that you can come back to if you die down the line.

Trying out new stuff became fun! After all, if things didn’t pan out git reset --hard origin/main was just a few keystrokes away.

So the appetite for more customization grew. Turns out that having configuration stored in file is actually pretty common. Out with the Gnome and KDE, in with the i3 and qtile. PUT ALL THE THINGS IN CONFIG FILES!

With gnu stow you can even automatically sym-link all your .dotfiles from the repo to their correct location (be it in ~/ or ~/.config/ ). It’s an amazing tool and you should give it a try.

It felt like ecstasy installing my setup onto a new computer. Instead of clicking through endless GUIs, it was just a git clone, a stow . and running a bash script to install the right programs. The power.

The lesson: Configure your system once and never lose the progress! Every tweak to the system was a chisel stroke on the stone. Slow and deliberate. My configuration grew with me.

The Stone That Fits

But it all deteriorated.

For work I got another laptop. Installation? Easy peasy lemon squeasy. After all, it was using the same .dotfiles.

But… The work laptop also was different: no dedicated GPU, some different programs (didn’t need Steam) and most importantly different versions of programs, since I ran the installation/update commands at different times.

Two machines, that tried to use the same .dotfiles repo and yet kept drifting apart.

The longing for a new, different stone - a different material to chisel away at - grew. By nature, Arch Linux is imperative. Configuration happens through terminal commands (like the install script) or manually changing /etc/ files. Documenting, let alone remembering, which commands had been done on one system and not the other was futile.

And then came NixOS.

A colleague suggested it to me for my avid use of Doom Emacs. The creator of Doom, Henrik Lissner, turned out to use nix. And the philosophy fits. Instead of interactively instructing a system how to behave, everything is declared. NixOS just does it for the whole system; all system packages & services, all users and their packages & services.

Declaration hits two birds with one stone: The declaration is the documentation and handles configuration.

Great! Nix solves my issue of drifting systems. The perfect stone was discovered. The diamond in the rough. The only problem was learning how to use it.

Shaping The Perfect Ashlar

Learning nix is hard! Especially coming from the familiar imperative Linux world. However, my aspiration carried me through the initial skill-issues. If you are at this point right now: Ask for help in the discord channel, read the NixOS wiki & watch every single video of Vimjoyer.

NixOS holds your hand. It won’t allow you to rebuild your declared system, if there is a syntax error. And if you still manage to fuck everything up, simply boot into a previous generation! This superpower still shapes my Opensource Odyssey.

Moreover, through a single .dotfiles repo you can declare multiple systems. Let machines share exactly the same packages (as in byte for byte the same package) and the same configuration. The stuff that differs is still declared, but not shared.

There will be less to remember. Configuration is done once, it is done right & it is done forever.

For instance, tools like vim, tealdeer and dust are part of my “terminal toolbelt”. This toolbelt is installed all machines (be it VPS, home machine or work machine).

Moving into new hardware has never been easier. Last year, when a new baremetal miniserver entered my roster, the biggest hurdle was getting ssh and git installed. From there, the rest was a simple nh os switch. Setting up the entire server according to my bespoke preferences took no more than an hour (and most of that time was just looking at the nh output). From what I understand even that can be further optimized so that you can install your distro from a USB stick.

In other words, try Nix. Don’t ever look back.

The Digital Mason’s Creed

This brings us back to Digital Masonry. The Digital Mason chisels not stone, but configuration files. This is a lifelong process. With time the system becomes more and more perfect.

While contemplating the concept of Digital Masonry, the Rifleman’s Creed from the movie Full Metal Jacket came to mind.

https://youtube.com/watch?v=Hgd2F2QNfEE

Here is the adapted version for the Digital Mason (props to Grok for the adaptation). Repeat after me:

This is my config. There are many like it, but this one is mine.

My config is my best friend. It is my life. I must master it as I must master my machine.

Without me, my config is useless. Without my config, I am useless.

I must declare it true. I must refine it sharper than the defaults that try to own me.

I must chisel it before it chisels me. I will.

Before the terminal, I swear this creed: my config and myself are defenders of my sanity, we are the masters of our bloat, we are the saviors of my workflow.

So be it, until there is no friction, but flow.

Go Forth & Chisel Your Config

There you have it. No need for robes or secret handshakes. Only need the mindset of a craftsman. Look at your system like a stone that you adapt to your preferences. It grows with you. It supports you. It empowers you.

Go build your own temple with one keystroke at a time.