Giphtblog

First there was a Makefile

2025-09-03 |
Estimated reading time: 6 minutes

I’ve seen countless posts on Linux subreddits: people wrestling with their Arches, their Debians, their Ubuntus, and a dozen other distros. Most of these problems feel almost trivial to me — not because I’m some kind of Linux wizard (I’m not), but because on NixOS they either don’t exist, or they’re solved in one line.

Now before you head off having your expectations about a juicy Makefile shattered, let me tell you how I got here.

I do however want to preface this by saying that I’m no expert at this, and how I’ve come to use NixOS is mostly an organic journey through wanting to do things “better”.

Developers, developers, developers, developers…

I was quite lucky during my studies. I got a job sitting evenings at the IT operations center for a large retail chain. My job mostly entailed watching for infrastructure events and delegating the incident to someone actually capable of handling it.

This, however, meant I had a lot of time on my hands in between incidents. While juggling watching Youtube and lurking on Reddit, I programmed small tools for the operation center.

The operation center was not technically a development team at all1. Without established norms to stick to, I got to try out many various technologies, languages and frameworks as a result, all because I was curious and my boss gave me free reign to pick and choose how to do things. None of these projects were slated to last very long, so maintainability was not a priority.

Then I finished my studies, and started working at the actual development department at said retailer. And there I got my own, proper development laptop. I had been living the Windows + WSL life at the operation center, and that’s how I started out as a proper developer.

From Makefiles to Madness

By the time I started at the development department, I had head mention of Nix, but I had relegated it to “something too complicated for me to bother with”, and I left it at that.

I had dabbled with setting up my WSL environment using a Makefile. The idea was to (somewhat) declaratively download and install programs, copy dotfiles, configure stuff, etc. all from one command. I vehemently studied the Make docs, and applied everything I could to keep is as DRY as possible. It became quite the mess of over-engineering. Over time, I was striving to have the Makefile act as idempotent as possible, overusing stamps as much as possible.

I wanted it to:

And it all had to be idempotent: no matter how many times I ran the setup, the machine should end up in the same state. Make gives you a hint of that for free, but for everything else, I had to hack it in myself. And oh boy, it shows.

You can also see an (admittedly neat) attempt at a declarative apt setup that allowed me to just install programs by referring to their stamp.

Over time, I split the simple Makefile up into multiple Makefiles, so titling this post “First there was a Makefile” might be a bit misleading.

This continued on for a while, and when I started a new job at Strise and was handed a shiny new MacBook, I had to add a bunch of cruft to support using brew instead of apt as my package manager.

During my time at Strise, the Makefiles had grown difficult to maintain. I started searching for alternatives, and stumbled upon Home Manager. And there was that “Nix” again, but this time it seemed more manageable than last time.

I ended up including Nix in my Makefiles as one of the many programs to set up, and left it at that for a while. I found that integrating Home Manager with my existing was practically pointless, since it would in theory entirely replace everything I had created so far.

So I created a new repo for my computer management, more appropriately named dotfiles this time. And that too has grown in complexity over the past nearly 2 years.

With Home Manager, using nix-darwin at the time, I finally achieved what I wanted all along: declarative configuration I could apply wholesale to my computer and have it set up just the way I wanted it in one command.

Nerd sniped by Nix

Looking deeper into what I could do with Home Manager and nix-darwin, I started striving towards managing more and more of my laptop through Nix. I looked into NixOS, but decided against installing it on my MacBook as it was not quite supported for use on MacBooks at the time.2

I switched from Debian to NixOS in WSL on my home computer using NixOS-WSL. I installed nix-on-droid on my phone to fiddle around more there. And I adapted my little dotfiles flake3 to handle all of these various configurations and systems in one place.

And now, at an even newer job at Lovdata, I finally have a bona fide NixOS laptop for development purposes.

Conclusion

I’ve tinkered a lot, stumbled even more, and ended up with a setup that feels more declarative than duct-taped. I might not be a Nix expert per-se, but I hope to share some of what I’ve learned so far. I want to write the articles I wanted to read while learning NixOS. This post is merely a prologue. I find tutorials on how to set up NixOS and use it to its full potential a bit lackluster online, so I’m hoping to write out a series of blog posts on getting started with NixOS. Others have done this before, but I want to take a more practical approach, while explaining things along the way.


  1. So everything was a bit “loosy goosy” when it came to “best practices” and established processes. Being closer to a “DevOps” team, there was some PowerShell development being done, but that’s about it. ↩︎

  2. Shout out to the Asahi Linux project for their effort in making Linux work on Apple Silicon. ↩︎

  3. Yeah, we’re just name-dropping the big baddie here. The “monad” of Nix. We’ll get down to talking about actual Nix stuff at a later date. ↩︎