NixOS 2

Let's continue the series of notes about migrating to NixOS.

Part 2. Preparation

1️⃣ Once the decision to migrate had been made, I needed to figure out how to do it as painlessly as possible while accounting for the specifics of NixOS, such as, for example, the declarative configuration of the whole system.

🤓 I read tons of articles and documentation pages and watched plenty of videos.

2️⃣ The principle was clear, and I couldn't wait to get started. The first thing I did was order myself a second 2 TB nvme drive for the laptop. I'd long wanted to do an upgrade, since the stock 1 TB nvme was already starting to run short, and here was the perfect excuse. The new system, in fact, will be installed on the new drive, while I keep a perfectly working old system on the old drive. That's convenient, since I still occasionally pull some data out of it.

3️⃣ While waiting for the order, I decided not to waste time and installed NixOS in a virtual machine, building a system there as close to my working environment as possible. Then I'd simply apply the ready-made config to the real installed system. Surprisingly, no major problems came up, and working in the virtual system became quite comfortable: all the needed packages were already installed, and the minimal configuration for accessing the corporate VPN and k8s clusters was functioning too. Of course, there were still plenty of small but important touches left, but I decided to do those on the real system as I went.

I'll say upfront that this approach paid off, because besides my main laptop I also needed to replicate the configuration on a second (travel 🏝) one. I wasn't planning to upgrade it the same way (and couldn't have — it only has 1 slot), so I decided to wipe the old stuff and install nixos using the ready-made config. Unfortunately, not 100% of the parameters could be set via a single configuration file; a small part of the work, like configuring some gnome extensions, had to be redone by hand. Still, those are minor details.

✅ So, with the new drive inserted, the preparation was complete. Everything is ready for the migration, which I'll cover in more detail next time.