This distro finally fixes Linux
Tags: linux, nixos
Published: 2024-04-18 00:18:03

Probably one of the biggest roadblocks for people who want to use Linux is its complexity. And those people are not wrong Linux is quite complex compared to your typical macOS or Windows(eww). 

Unless your using Ubuntu then you will most likely find Linux can be quite unstable, just one system update and whoops my Arch setup isn't booting the graphical environment anymore!

That was me during my first two years of Linux, constant issues, every update was like poking a sleeping bear to see if it would wake up, sometimes it did..

But now that the preamble is covered let's talk about what you really came here for. A Linux distro that fixes everything we have covered so far. No more worrying about your system breaking when you update, no more needing to write massive bash scripts to recreate your system if you ever need to install again, no need to write documentation for your own system just so you can remember how you fixed all those issues!

I present to you all, NixOS. A fully declarative distribution, where all packages can be individually controlled and version locked to get exactly what your system needs.


![NixOS Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xo3fziiry1yppawewrn0.png)

## What is NixOS?

Ok well lets break that down, "what do you mean it's declarative?". Well most Linux systems are 'imperative', you have to do many things in succession to accomplish your system which results in those long bash setup scripts we all have seen at least once. 

Whereas a 'declarative' system means just about everything in the system is controlled by a few configuration files, "Oh but Jasper that is literally every system, its called dot-files", well yes and no. 

Dot-files on most system are your window manager, terminal and other configs but on NixOS you actually combine every single modification to your system in a small set of files or even all of them in one single file!

## How NixOS works

Here is a quick example, on most systems to setup your timezone you would have to either run a command or change a system file, just take a look at the [Arch Wiki](https://wiki.archlinux.org/title/System_time#Time_zone) on changing the time. But as you can see below on NixOS its controlled by a single line in your sole system configuration file.

```nix
time.timeZone = "Australia/Sydney";
```

And this is just one example, with NixOS all you need is a single `.nix` file and your can do just about anything you could do with a few hundred commands on another distro.

And let's say you have made this massive config, well now you can run that config on ANY other system and it will be created the exact same it was on the original system thanks to NixOS's version locking, which we will look at soon.

So once you make a change to your config you just run the `nixos-rebuild` command and then pass in `switch` if you want to apply the changes to your system immediately, `boot` if you want to apply them at the next boot, `build` if you just want to build without applying any changes and EVEN `build-vm` which lets you build a virtual machine of your system to test if the changes work without actually testing it on your system.

The last thing I'll mention is that on NixOS whenever you install a package, (which is done by simply adding the package name to your config) that package is version locked and can never change unless you update your system or specify another specific version of the package, no more needing to worry about a package updating and breaking without your knowledge!

## Conclusion

After using NixOS myself for a few years now I have never had a single problem with my system that couldn't be easily solved by making a quick change to my config.

While NixOS has a steep learning curve it is well worth it. But don't fear there are alot of great resources on how to start with NixOS. In fact I have written an entire documentation page on NixOS with links to plenty of helpful resources to get started.

Check it out here and make sure to share it with others, I frequently update the site with new content!

[docs.windswept.digital/nixos](https://docs.windswept.digital/nixos.html)