DEV Community

Cover image for I Changed My Mind - NixOS is NOT the Best Linux
Jasper
Jasper

Posted on

I Changed My Mind - NixOS is NOT the Best Linux

Well I didn't expect to be writing this post, ever.

Most of my posts on here have just been NixOS and praising its glory to all but recently I have been greatly disliking NixOS more and more.

But what does this mean for you? It could mean nothing, or it could mean everything...

NixOS Pros

I can't say NixOS isn't great, it has so many amazingly useful features that just make using Linux so much easier.

  1. All packages are version locked. (Easy to roll back versions)
  2. All package dependencies are per package so version conflicts are prevented.
  3. Thousands of services are now easily configurable from the ground up thanks to NixOS Options.
  4. It provides a similar format to docker in that your whole system is a container that can be perfectly and precisely replicated anywhere!

These have been the reasons I stuck with NixOS for the past year.
But the way NixOS does some of these things has also been its downfall for me.

NixOS Cons

The greatest problem I have experienced with NixOS is actually development.
Working with anything that requires external libraries like C, Java or even Rust has been so much of a pain I have just given up on projects because of it.

But what is the problem exactly?
NixOS makes it very difficult to simply, install a library and have it accessible to the rest of your system.

On Arch setting up a OpenGL environment for C is as easy as:

sudo pacman -S gcc cmake make glfw glew libglv
Enter fullscreen mode Exit fullscreen mode

On NixOS you can't just add these packages to your package list and call it a day, you need to setup whatever LD_LIBRARY_PATHs are and even then I couldn't get it to work.

It turns a simple idea of, "Hey I'm going to have a crack at some C and write a OpenGL program", to, "I literally don't understand how to even get this setup, at this point I haven't even wrote any code and I'm burnt out".

I got so fed up I started looking into switching Distro's entirely.
"Where did that lead you, back to me" - Arch Linux"

Arch, dangerous but simple

Now don't worry I'm not actually abandoning NixOS. But I will be using an Arch Virtual Machine to do any kind of graphics or library dependent development.

Thanks to my guide on installing Arch is was really easy to setup and like I illustrated earlier it took my around 30 seconds to get my environment ready and I could just start coding, wonderful!

Arch does make it slightly more tedious to setup the actual operating system, but its a sacrifice I can make for being able to quickly spin up any development environment I want.

Conclusion

Arch makes the operating system tedious, but the development environment easy.
NixOS makes the operating system easy, but the development environment torture.

It really seems like there is no perfect Linux distribution. Not yet at least.

Until next time, thank for tuning in.
Jasper out.

Top comments (5)

Collapse
 
freelock profile image
John Locke

I'm feeling like a Nix newbie still, have been using NixOS about ~7 months. I think you're missing a huge part of Nix's value proposition -- that it's super easy to get dev environments set up, even on non-NixOS systems!

That said I'm only scratching the surface here -- but I have used Nix several times to build ancient React apps, by creating a flake.nix for the project that pulls in ancient versions of node, npm, and yarn to make things build faster.

And a few days ago I just got a new PHP version up for a single project, while keeping older versions on other projects -- in a matter of a couple minutes, in something that transfers to an Ubuntu server (with Nix installed) and it spins right up there, too!

Check out dev shells with Nix -- you should be able to create a flake.nix in your project directory specifying the packages your project needs, and use direnv to auto-load it when you change into that directory. It's pretty amazing...

Collapse
 
jasper-clarke profile image
Jasper

I completely get what your saying.
For me though I have just found the whole dev shells on NixOS really frustrating and difficult to get working correctly.
I'm quite busy myself so I also don't have the time to do the amount of research that I clearly need to get what I want out of NixOS.
Super glad your finding it smooth though!

Collapse
 
olafkfreund profile image
olafkfreund

I don't agree with your conclusion at all, but I get it. Don't give up yet. If you need help reach out to the community and we (they) will help you reach your dev goals. I'm sure.

Collapse
 
ani_chisom_17 profile image
ani chisom

Nice
Do you have any update a-z guide on using arch linux subsystem for windows

Collapse
 
jasper-clarke profile image
Jasper

I don't sorry!
I don't use Windows myself and have no experience with WSL.
This might be helpful though?
wsldl-pg.github.io/ArchW-docs/