I don't know Linux§

Go away.
If you’re looking for a beginner’s guide, this is not it. This is a postmortem of a bad idea that worked.

I sadly do not possess much time, and quite frankly, most of the rest of this page/series will go over your head.
However, if your tastes are sufficiently messed up - or if you enjoy watching someone over-engineer their computer to the point of absurdity - this might hopefully be a fun read.

My entire life has been a contradiction of sorts, notwithstanding the OS I currently use. I chose arguably the most difficult distro to learn to use specifically so I would never have to learn how to fix it again.

What is this "NixOS" thing?§

If you've ever used Linux before (like Ubuntu or Arch), you know the drill: you install the OS, you run a bunch of terminal commands to install software, you edit a text file here and there, and eventually, you have a system that feels like home.

But you also know the fear.

The fear that if you delete the wrong file, mess with the wrong package, or even upgrade to a new release, your computer might implode, and you'll have no idea how to get back to the way things were.

That's it I'm <redacted> switching back to Windows forever
--> Me (right after the 69420th distro-hop that caused my system to crash and burn)

NixOS is different.

Basically, you define a blueprint - a single configuration file that describes exactly how you want your computer to function. You want Firefox? You write firefox in the file. You wanna set your wallpaper? Just chuck it into the file.

After you're done, Nix reads it, and builds your entire operating system to match exactly what you wrote. If you mess up, you just undo the text in the file, and your computer goes back to being perfect. And oh, lest I forget to mention, you’d never have to deal with the godforsaken dependency hell 1.


And now for the theatrics...

The Descent into Madness§

It started innocently enough. I just wanted a system that was reproducible.

I began with Nix Flakes, the "Gateway Drug" 2 of the ecosystem. Instead of vaguely gesturing at a repository and hoping for the best, flake.nix declares every input my system depends on, and flake.lock pins each one to an exact revision. It is the ultimate insurance policy: if I build this system today, or in about 10 years in the midst of an imminent meteor strike, I will get the exact same system 3.

But having a reproducible system wasn't enough. It had to be obedient.

I pulled in Home Manager because configuring the OS wasn't enough; I needed to micromanage my user config files too. Then came Stylix. I declare a single image and a color scheme, and Stylix enforces this theme across everything. It generates CSS for Waybar, restyles all my apps, and even bullies my terminal into submission. But why stop there? I grabbed Spicetify to force Spotify to match my aesthetic, and Nixcord for Discord cuz why the heck not.

"Okay, it's pretty," you say. "But is it useful?"

You have no idea 3.

I don't "install" development tools. I have a directory that defines isolated environments for C++, Python, JavaScript and so on. When I cd into a project, Direnv and Lorri kick in, and the compiler, linter, LSP and whatnot along with all of their configuration just appear in my shell. When I leave, they vanish.

Every little thing is specified in code, from backups to network settings and even complex editor workflows (thanks for your concern, but I very likey my trusty VS Code). Heck, even my Printer configuration is defined in a Nix file.

Well what else do ya need?

I still wanted to play games and run Android apps. A normal person would dual-boot or use an emulator.

I run Waydroid to run Android in a container. Then, for the pièce de résistance, I set up VFIO GPU Passthrough 4. I pass that GPU directly into a Windows VM and use Looking Glass to stream the video output back to my PC screen with negligible latency.

I've also declaratively configured Minecraft Servers (cuz that 2 week period happens every other month for me, don't judge).

At this point most people would stop

Well I didn't.

I needed to know that my system was spiritually pure. So I formatted my drive with ZFS (its own merits aside) and implemented Impermanence. Every time I reboot, my root dataset rolls back to an empty snapshot. Wiped. Gone. My OS comes back from a blank slate every boot, preserving only what I explicitly whitelist on a separate dataset. To manage secrets without em dying in the purge, I use sops-nix to encrypt passwords and API keys using GPG, directly into my publicly hosted git repo, without leaking any sensitive data.

The result of all this?

If I buy a new computer today, I don't spend a week installing drivers and recovering my workflow.

I clone my repository. I run one single command.

And I doomscroll. Soon as I return 3, I spin up an AAA Windows game, displayed on a tiling Linux WM (heck, even choose between Hyprland and Niri), on a system that deletes and rebuilds itself on every boot.

God, I love NixOS, and I hate it cuz now I can't go back to anything else.

A Fair Warning§

Before you rush off to install this magical operating system, we need to have a serious chat.

NixOS is hard.

And I don't mean "Linux is hard" kind of hard. Its more "I have to relearn how everything works" kind of hard.

  • It is not standard Linux: Most tutorials you find on the internet simply will not work here. You can't just apt install your problems away.
  • The Documentation is... sparse: Sometimes you will be reading a manual, and sometimes you will be reading 10-year-old Reddit threads praying for an answer.
  • Patience is key (or severe OCD tbh): If you are not acquainted with the command line, programming languages, random crash logs, or want a computer that "just works" to play games or browse the web, consider yourself warned. Cuz this setup costs time, sanity, and a concerning amount of self-restraint.

Still Reading?§

If you really want to get dirty with Nix and decide to invest oodles of your time into building your own configuration, my repository can be used as inspiration. You can check out the list of links below to resourceful Nix documentation/tutorials/projects that may be helpful in your endeavour, as they were in mine.

See: A Curated List of the best resources in the Nix Community
Also: This website for beginners starting out with NixOS and Flakes

Other Sources§

  • Tweag Article introducing Flakes
  • Serokell's Blog on Flakes
  • Jordan Isaac's Blog for porting configuration to Flakes
  • Jon Ringer's Videos on general NixOS Tooling and Hackery
  • Justin's Notes on using Nix
  • Lan Tian's Series of Blog Posts on NixOS
  • Christine's Blog Posts addressing NixOS Security
  • Graham's and Elis' Blog Posts on Ephemeral Partition Schemes

Other Configurations§

Here are some repositories that I may have shamelessly rummaged through for building my dotfiles:
Thanks a lot! ;)


1

Wiki for life

4

Arch Wiki my love

3

T&C Apply ;)