A journey through Windows and OSX to Linux and NixOS

Windows was the first operating system I ever used and was what I almost exclusively used until the end of my university degree. As part of my studies I dabbled with Linux but never thought I would use it full time and I didn't think highly of OSX. In 2013 I started my first full time job out of university and they gave me a Macbook. The unexpected happened. I couldn't imagine using anything else for software development. Then in 2015 I resigned and gave back my Macbook. So bought myself a windows laptop and installed Linux. That was more than 18 months ago and again, I couldn't imagine using anything else for software development. Today I want to share with you some of the things I've learnt and learnt to love through this journey.


My Linux Journey

My first introduction to Linux was at university in a course called Operating System Architecture. We were given a login to a very large shared Unix (I think it might have been Solaris) system that the university hosted. I used this system for all of our programming assignments during that course. At the time I also had an old laptop and I experimented by installing Ubuntu, Fedora, and Even Arch Linux on it. I enjoyed it but it didn't feel practical enough that I could use as an every day desktop.

18 months ago I bought an Asus Zenbook, I initially installed Ubuntu as it seemed like the lowest barrier to entry having not used Linux on a desktop in years. I had issues with driver support for the touchpad due to an old linux kernel, and some general instability. I then installed Fedora and was much happier.

When I started at uSwitch I continued where I left off with and installed Fedora on the Thinkpad they gave me. It was actually a very seamless migration as I simply copied my entire home directory across. As time went on I wanted more customisation and moved from Gnome to AwesomeWM, and then spurred on by encouragement from some colleagues I installed NixOS, which is still what I'm using today.


Hardware support

This is one of the big difference you'll see across  the different operating systems. Windows you'll often need to download and install drivers, OSX is built for the hardware and like most things Apple makes it usually just works out of the box, Linux however sits between the two, often everything will work out of the box but sometimes drivers will need to be installed.

The Linux kernel is quite good at supporting most hardware, however sometimes it takes a little time for the latest kernel to make it down into some distributions. This was the case with Ubuntu and the touchpad on my Asus when I bought it, but this was right before a new version was released which had a newer kernel and full support.

My Asus laptop also has dual graphics cards, one built into the motherboard and NVidia card. With Windows the laptop is designed to automatically switch between the two cards depending on the need. Linux has a project that is designed to support this - Bumblebee, unfortunately I managed to somehow corrupt my installation more than once trying to get it to work and gave up. Thankfully I didn't need it to work as I don't do very much that's graphics intensive.


Package Management

At the time I used windows package management wasn't really a thing (Chocolatey existed but wasn't very big), and at the time wasn't something I missed. .exe's and .msi's installed into program files and could be removed through the control panel, it all kind of worked.

When I began to use OSX I was introduced to Homebrew. I loved it. It was everything I hadn't realised I wanted. It was one of the major contributors that helped me adjust to the command line over having a GUI for everything.

Package managers on Linux are almost as diverse as the number of distributions (RPM and debian packages being the most common format). They also have vastly different package repositories, which makes the job of keeping repositories up to date an un-envious job.

NixOS, however, has a radically different package manager, and in fact it's package repository is a git repository - https://github.com/NixOS/nixpkgs, and new packages are added through pull requests. It's configuration and installed packages is in a consistent format, in one place which allows you to version control it - https://github.com/firthh/nixos-config

Using the Nix package manager everything gets installed in isolation and if it's dependant on another project you need to figure out how to link to it. Take Skype as an example (https://github.com/NixOS/nixpkgs/blob/f1dc2dd552a7db4a9010f8cbe9f02a2243092619/pkgs/applications/networking/instant-messengers/skype/default.nix#L44) as you can see it needs to make changes to the dynamic linker to link to the other packages it's dependant on.

NixOS also allows us to not globally install things like Ruby, or Java. We can instead install them just in the project we need to use them. Which also means we don't need tools to manage different versions of tools like RBEnv, RVM, or NVM - https://nixos.org/wiki/Development_Environments. Nix-shell allows specific versions to be available on the path when we need them. This may at times cause issues with things like emacs where for Clojure development it assumes that Leiningen is globally available on the system path.



Overall I'm extremely happy with my setup and how much I've learnt. The more I learn about Linux the more I realise there is to know. I'm really happy with NixOS but that might just be until the next shiny new thing comes along. What I'm enjoying the most is that a lot of my configuration lives in version control so I can easily rebuild my whole machine if I were to accidentally screw something up (which I have a tendency to do).