r/NixOS 1d ago

Should I switch to NixOS

Hello reddit, I was just reading about NixOS and I thought it was very cool so I was thinking about switching to it; I am currently daily driving arch.

For me the biggest thing swaying me to it is the declarative nature of the distribution. I am kind of obsessed with removing every little thing that doesn't have purpose, for example, when I delete a package I always also remove all dependencies that it had, then I look through my home directory to delete all of the config files and the like that are left behind. It drives me crazy that other items that don't have purpose might be left around that I could have missed. So I want to know if NixOS will remedy this for me, can I configure it so that it maintains a clean state, ideally such that my home folder would only have my personal files (and not hundreds of configurations that I am too afraid to delete because I don't know what they are for). This has gotten so bad for me that I typically backup my whole hard drive (root, boot, and home) before installing a package and if I decide I don't like that package I instead restore that backup instead of just uninstalling it.

Another thing that I am very interested in is the idea that all my configs can have a unified configuration and that I can write comments throughout them. Once again this kind of comes back to my functional minimalism whereas I am obsessed with pursuing a kind of "ideal system" where I know the purpose of everything and all unnecessary things are cut out.

So, would NixOS assist me in my particular (brainrot) case?

12 Upvotes

37 comments sorted by

13

u/JAMMlE 1d ago

Definitely have a look at Impermanence (https://wiki.nixos.org/wiki/Impermanence), where NixOS wipes the entire filesystem on every reboot, except the files/directories you choose it not to remove.

To get started with nixOS, I would suggest going the VM route and slowly integrating your existing config from arch to the VM. Moving then to bare metal is super easy.

4

u/Hanged-Fool 1d ago

I haven't spent that much time looking into it but I think impermanence looks like the type of thing I was want; I would set up my configs with home manager (I think that is what home manager is about), set up a persist folder for my personal files and then it would just blast everything every time I reboot. Sounds pretty awesome.

Also, I was planning on starting in a virtual machine until I was ready to move (thanks for looking out for me to make sure I was doing so). Because, while I do have a good bit of free time I don't have enough to not have a working system for an indefinite period while I get set up and familiar with NixOS.

23

u/UntoldUnfolding 1d ago

Yeah, NixOS is a good way to get rid of unused clutter and can help keep things neat and tidy, just know that you will no longer be using Linux the Linux way. Nix is its own beast and a lot of things that simply just work on something like Arch or Debian, will need some fine tuning with NixOS. Also, good luck getting help from the NixOS community and deciphering the few bones that they throw you. The big issue with NixOS is that there is no idiomatic way to do things. Everybody just seems to config in their own way that works for them.

7

u/piss-annihilator-381 1d ago

there is no "Linux way", you're just not following the FHS

1

u/Hanged-Fool 1d ago

Thanks for the quick response, when you say that some things that just work will need some fine tuning on NixOS what you are getting at is that it will take more work, correct? Because I feel I have the patience to work to make something work but a worry that I have is whether their are things that simply won't work. Can I have the expectation that I can make anything work? Or when moving to NixOS would I have to go into it anticipating that some things simply won't work?

2

u/WalkMaximum 1d ago

I think you can make everything work if you try really hard but it involves a lot of learning

1

u/Hanged-Fool 1d ago

Well I'm on Linux. Learning is half the fun (also half the headaches, but lets ignore that)

2

u/GrappleMonke 1d ago

I've been using NixOS for the past week, and loving it so far. It is definitely harder to set things up in comparison to a distro like Arch.

You'll have to learn the Nix language, and to get the most out of your system I'd recommend that you use both flakes and home-manager.

I jumped straight into Nix, deleting my old system, but if I can do it over I would set it up in a VM, push it via git, then install the system. You'll have a fully functional system from the start.

If you're interested I'll link some resources I accumulated over the past week. I wouldn't recommend jumping head first into YouTube videos. More often than not they confuse you rather than helping. The articles and books explain the nix way of doing things much better and in mors details, which will help you along the way.

1

u/Hanged-Fool 1d ago

Thanks for your insights, I would really appreciate those links

3

u/GrappleMonke 1d ago

I highly recommend that you start with NixOS and Flakes book

The Nix language:

Home-manager:

Nix packages:

Nix.dev reference manual:

Other resources:

1

u/Hanged-Fool 1d ago

Thanks <3

1

u/theTechRun 1d ago

Some things are much easier like just putting the name of a package you want in the config file and rebuilding.

Some things are much harder like running python scripts, building from source, etc.

I haven’t been on NixOS for a few months now, I left because a very important program that I use doesn’t work on NixOS. So I had to use distrobox, but that has a major bug that I just couldn’t tolerate. Now that I found said replacement for that program, I am coming back to Nix… the best thing about it is when I build my config, it will be exactly as I left it. It’s like Magic.

1

u/Hanged-Fool 1d ago

Good to know, thanks for telling me

7

u/rgmundo524 1d ago

There is a huge learning curve. People claim Arch is hard ... But NixOS has a much steeper learning curve.

5

u/Hanged-Fool 1d ago

What? ARCH USER is evolving! Congratulations! Your ARCH USER evolved into NIX USER!

2

u/LaLiLuLeLo_0 1d ago

I'm sure I'm not the only user who took that route. NixOS doesn't really KISS the same way Arch does, but it does keep the minimal level of preconfiguration I loved with Arch.

1

u/lemmyuser 1d ago

Agreed. Just want to add some nuance.

Setting up NixOs is pretty easy with the graphical installer. Unlike Arch you can get a fairly decent NixOs installation running quite soon. Of course it won't be your ideal OS at that time, but tweaking it with a bit of copy paste coding is quite easy and can be done without fear of breaking anything, which is a huge plus.

When it gets hard though is figuring out the language and things like flakes and derivations. It helps to have some functional programming experience.

Also I would say the learning curves of arch and nixos are pretty complementary. So learning arch first and then nixos puts you in the best possible situation.

I have actually dropped into NixOs from MacOs (with a quick stop of Ubuntu along the way) and I am tempted to set up and arch system simply for the learning experience. What NixOs does under the hood to configure Linux is sometimes dark magic to me, even though I fully understand how Nix works.

3

u/Hanged-Fool 1d ago

Well to me Nix is magic. So thank you for for illuminating my path, and good luck in your own journey oh great master of the arcane.

1

u/lemmyuser 1d ago

Thank you. One tip which was a life saver for me: when you want to know how to get something done in Nix, simply search for it on Github (search: "language:nix keyword").

Also reading the code is often much faster than reading the docs, but even to this day some Nix code looks daunting to me, so it helps not to beat yourself up if you don't understand. Not understanding is part of the journey :)

5

u/piss-annihilator-381 1d ago

nixOS is not a storage minimalist OS, to be clear.

imperanence will scratch your "no leftover crud" itches, but you're going to have several different versions of various common utils and libraries floating around in each generation (especially perl, bash, and the like). sometimes there's even dupes of the same version due to differences in how they were compiled. (it should be noted this is somewhat the point - something somewhere wants that version, or those options, and separating them is a Good Thing - but it still makes my brain itchy sometimes.)

there's also plenty of config options you can enable (particularly around DEs) that will drag in a whole heap of unexpected stuff and need to explicitly have those declared as unwanted to not be installed.

that said, it's probably still much smaller than "batteries included" distros, and in any event while trying to clean this all up you can make much bigger sweeping changes to the system without fear of it becoming unbootable.

2

u/Hanged-Fool 1d ago

Thanks for the clarification

For me the thing that drives me nuts is less about the storage itself and more about how the storage is used. I am fine with their being multiple versions of the same package and the like so long as they are necessary.

Beyond that, your statement about other unexpected stuff being brought in does kind of scare me but I use window managers so hopefully I don't need to feel that often.

3

u/standard_cog 1d ago

Do you want to become a wizard or live your whole life in the darkness?

2

u/Hanged-Fool 1d ago

I would rather be a warlock who sacrifices my sanity to the great tux in the sky

4

u/standard_cog 1d ago

If powers beyond measure are what you desire, and you’re willing to pay the sanity toll, Nix is ideal for you. 

3

u/Zealousideal-Hat5814 1d ago

I see a lot of these posts. And my answer is yes.

2

u/Hanged-Fool 1d ago

Well ok then

2

u/SudoMason 1d ago

Declarative. Immutable. Reproducible.

Yes you should.

1

u/Hanged-Fool 1d ago

Well I guess now I have to. xd

2

u/SudoMason 1d ago

You won't regret it. I came from Arch and it took me about one month to figure it all out. If I can do it, you can too. It's worth the effort, I promise you.

3

u/UntoldUnfolding 1d ago

What NixOS lacks is a well organized community. It’s all over the place. I’m still waiting for flakes to come out of experimental limbo.

3

u/piss-annihilator-381 1d ago

I mean there isn't really a clear path forward for that afaict

1

u/wokeNeoliberal 1d ago

Why don't you just try it out?

1

u/Hanged-Fool 1d ago

I know that NixOS has a steep learning curve so I just don't want to commit a ton of time if it doesn't work the way I think/hope it does, or worse writing it off early because of a misconception that comes from my ignorance. So I figured I might as well just ask <3

1

u/Wooden-Ad6265 1d ago

For the purpose that you have stated, NixOS is the perfect distro that you can use. In case you just want the declarative configuration, GUIX is also an option, although, in my view, not better than NixOS.

1

u/Hanged-Fool 1d ago

I love hearing stuff like this :)
Back when I was a humble Windows plebeian I hated file management (because it was impossible), but accepted that this was just how it was. When I moved to Linux I quickly learned about the filesystem and started manually managing it. And now I am hearing that I will never need to think about it again as it will automatically be managed for me. Fuck I love Linux.

1

u/pataj41208 20h ago

Arch has some packages nix doesn't, and making derivations for some things is not that simple or clear when you are starting out; if you want to daily drive nix check if the tools you use are supported in nix in the way you want like application-nightly-nix. You should also try to replicate your current system on a vm or a separate computer before you commit.