Home Posts X GitHub

My uncommon webdev setup - part 2 (OS)

This is a three-part series covering hardware, OS, and software that I used in 2023 for web development. I’ll post a new part until next year. Stay updated by following me on X.

Reminder

As you already know, there’s no silver bullet. Tools and workflows should bring happiness and therefore are very personal, so this article is not a “you should use X and Y”.

In an area where Apple hardware and software are prevalent, my setup might be uncommon, but it’s by no means unique. A lot of people work with such setups.

As 2023 is ending, I just want to share some tools that made me happy this year.

NixOS

Imagine starting with a fresh OS install each time you boot your computer. A setup you can modify without cluttering your system. Each shutdown erases all changes, except for the selected persistent folders.

That’s what you can get with NixOS and Erase your darlings - immutable infrastructure for mutable systems.

So this summer, I switched to NixOS following the excellent NixOS: tmpfs as root guide.

Since these resources provide comprehensive insights, I’ll focus on my personal experience and the aspects of NixOS that resonated with me.

configuration.nix

In traditional Linux distributions, system configuration is often done through multiple text files or GUIs.

In contrast, NixOS centralizes all configurations, including users, networks, and packages, within a single file: configuration.nix.

Since the system is immutable, changes are only possible by editing configuration.nix and generating a new system.

This approach offers some unique benefits:

tmpfs as root filesystem

Everything except /boot and /nix is stored in RAM using tmpfs, meaning all data is wiped when the computer is powered off.

Of course, this may not be practical for everyday work. Impermanence allows for selecting specific files and directories to persist between reboots.

I’ve chosen to persist my projects, browser history, and downloads.

The rest, residing in 16GB of RAM, ensures a faster system (up to 20x faster than SSD storage) and automatic cleaning. A simple reboot brings back a clean state.

In practice, the speed difference is rarely noticeable but it’s a nice side effect.

Trying Nix on macOS

For those interested in Nix without fully committing to NixOS, replacing Homebrew with Nix on macOS is a viable option.

This allows you to create a reproducible development environment, similar to what NixOS offers, without needing to switch operating systems.

This approach can be a practical way to familiarize yourself with Nix’s capabilities and workflow.

Closing thoughts

NixOS is rewarding but it can be challenging to master, particularly for those new to it. It simplifies some things but makes others more complex.

Getting it set up right took me several attempts.

Ultimately, the ideal operating system is one that aligns with your needs.

As for 2024, here are some other interesting Linux distributions you can try:

Next

In the next post, I’ll discuss the software I enjoyed this year.

You can also sponsor me if you liked this post or my projects. Additionally, I’ll be open for new work opportunities starting January 2024.