One command to rule them all
September 11, 2025

I've always hated manually setting up a new machine from scratch. It eats up time, and something always ends up off.
Syncing configuration files isn’t too bad, but apps and programs? That’s a whole different headache.
I want the same fonts, the same apps, and the same setup on every device — at home, at work, on my laptop, and on my desktop. Anything less just feels… wrong. And yeah, maybe I’m a little obsessed (but not really).
The solution (mine at least)
The internet is full of configuration tools — stow, chezmoi, you name it. Most manage your dotfiles, but that's just scratching the surface.
Then there's home-manager, which doesn't just manage files. Nix powers it, and Nix manages... well, everything.
I will write another blog to explain them in more detail. But basically, with nix
and home-manager
, you write down what you want your environment to look like once, and then you can recreate it perfectly on any machine, anytime, with a single command.
Here's a quick example with git
. Normally, we'd do something like this in our shell:
The problem? Every new machine means repeating these same steps. What if I made a typo in the email? What if I forgot to set the default branch? Sure, it's manageable for git
alone—but what about when you're configuring your terminal, editor, shell aliases, development tools, fonts, and dozens of other applications? Those manual steps add up fast, and the chances of missing something (or doing it slightly differently) skyrocket.
With nix
and home-manager
, though:
That's it. Run home-manager switch
and git is installed AND configured exactly as specified. No typos, no forgotten steps, no "wait, what was my exact setup again?"
The magic? This same config works on Ubuntu, macOS, NixOS—anywhere home-manager runs—one file, infinite machines, perfect consistency every time.
Why not just a .sh
script?
I tried that first! Shell scripts can work across systems if you write them carefully, but they still have fundamental issues.
When your script runs apt install git
or brew install git
, Which version do you get? Whatever happens to be the latest that day. Six months later on a different machine, you'll get a different version, and suddenly things behave slightly differently. Plus, running scripts multiple times can cause weird side effects.
Nix is different: instead of telling your computer what commands to run, you tell it what you want the result to look like. Nix figures out how to make it happen, handles platform differences, locks specific package versions, and can even roll back if something breaks. True reproducibility.
I'll dive deeper into how Nix achieves this magic in future posts, but for now, let's see it in action.
Configuring an entire $HOME
Now imagine scaling that git example up, with more config like shell aliases, your VS Code configurations, and extensions:
Even fonts (this is a must for me):
Did I say it can manage services too? Yep, actual daemons
:
One home-manager switch
command installs and configures everything—your shell, editor, applications, fonts, aliases. Everything exactly how you want it, every single time.
The best part? Your entire digital life is now documented in a single file. No more wondering 'how did I set that up again?' Your configuration IS your documentation.
But wait ...
Let me be honest—learning Nix wasn't easy. The syntax feels weird, error messages are cryptic, and I still don't consider myself an expert. I'm constantly googling things that should be simple.
If you're considering learning Nix, be aware that it's not a weekend project. You'll get frustrated, confused, and maybe even give up once. That's normal.
But the payoff is incredible. The first time you set up a new machine in minutes instead of hours, you'll understand why it was worth it. Your future self will thank you every time you avoid that setup marathon.
I'll write more detailed Nix guides in future posts, but here's the truth: if you stick with it, you'll never regret learning it.
End of the prologue
One command to rule them all isn't just a catchy title—it's reality. Nix and home-manager turned my biggest productivity nightmare into something I actually enjoy. If that sounds worthwhile, welcome to the journey.