I recently had the mad idea to swipe my OS disk and try something different. That resulted in me installing NixOS as my main driver. This is a "logbook" of my thoughts and experiences during the process of doing this, updated as I go.
Installation
So the installation went like this: I cleaned my OS disk and installed NixOS according to the manual that can be found here. By refering to my "OS disk", I mean the SSD in my laptop containing the OS. All of my files are stored on another crypted SSD that is mounted after boot.
So, for the installation process, I decided to try to replicated my previous system. The overall layout looks like this:
> $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 953.9G 0 disk
├─sda1 8:1 0 100M 0 part
└─sda2 8:2 0 953.8G 0 part
└─1tbssd 254:3 0 953.8G 0 crypt /mnt/HDD
nvme0n1 259:0 0 223.6G 0 disk
├─nvme0n1p1 259:1 0 500M 0 part /boot
└─nvme0n1p2 259:2 0 223.1G 0 part
└─root 254:0 0 223.1G 0 crypt
├─vg-swap 254:1 0 8G 0 lvm [SWAP]
└─vg-root 254:2 0 215.1G 0 lvm /
sda
is my "Data drive" containing two partitions: sda1
is an unencrypted partition containing some information on how to mount the drive and who to contact (me) if this drive is lost. (The drive is built into a laptop, but I started this with external drives and routinely did this to that drive). sda2
is the second partition containing a luks volume. I currently manually mount it to /mnt/HDD
, but would like to automatically mount it to /home
as in my previous system.
nvme0n1
is my "OS drive" containing two partitions: a "boot" partition and a "root" partition. The "root" partition contains two volume groups: vg-swap
and vg-root
. The former for swap and the latter for the actual system.
Installing the system went really well, the NixOS guide seemed well worked out, simple to use and overall made sense.
I did, by mistake, overwrite the partiton table of my data drive, but could fall back to my backup. hint: make backups!
Installing the system
I would say, starting with a blank shell and putting together the blocks for a functional OS (pun intended) to work was always a tedious task in my honest opinion: Things always kind of broke, something didn't work, stuff broke and it kind of always felt like it was just randomly working.
The NixOS approach was quite nice: As I wanted to rebuild the system setup like my previous setup, I kind of knew what I wanted. That included the i3wm window manager. Simply browsing for "nixos i3" brought up this wiki artikle from the nixos wiki as the first result. The content I was presented was exactly what I was searching for: simple instructions on how to enable the system.
Fun thing: I inserted the code shown into my
/etc/nixos/configuration.nix
file, asked myself how to actually apply the defined state and was delighted to find a small note under the code instructing me to enternixos-rebuild switch
in a root shell to let nixos "Build and activate the new configuration, and make it the boot default".
As I continued working on the system, I really started liking the whole system: enabling CUPS: services.printing.enable = true;
. Fighting with pulseaudio to get some sound: Nope! sound.enable = true;
and it works out of the box. Bluetooth? sure: services.blueman.enable = true;
.
Using the system
As soon as I had installed the system, if kind of felt like all the other systems, but with some little cool extras: on the one hand installing wanting to install a package, but not actually wanting to install the package can be solved by using a nix-shell like this: nix-shell -p mtr
. This starts a shell with the specified packages present, in this case, my system and the mtr
package.
Another thing I kind of like is the stability: I've got my configuration stored in a git repo, and make commits on all working builds. This makes it possible to literally "rebuild" the complete state of the system on a new nix install.
Symlinks are kind of everywhere. So many things rely on them and they are everywhere. I like this, as I've setup my projects folder with lots of symlinks, but I never escalated it like this
Conclusion
My motivation for this was to try something new, and after…
- … 2 days, The system is setup and feels fully functional. I've still got to figure out how to automatically mount my crypted data drive after boot.
- …