Need help figuring out if I should switch to NixOS or stick to openSUSE

Hi, this is my first post here, so I apologize in advance if I’m using the wrong category or forget to mention something…

To give some context first:
Soo… I’m kind of a noob and kind of not at the same time when it comes to Linux. :slight_smile: And by this I mean, for example, following guides on GitHub/GitLab (even the very badly documented ones :slight_smile:) and compiling/installing stuff from source fairly easily. But, if I get an error when compiling/installing and I can’t find anything about it on the internet or at least somewhat figure it out and fix it myself, I’m basically screwed.

Anyways, I’ve been recently thinking of switching to NixOS because I’ve seen a lot of videos about it, and I really liked the idea of having a replicable OS across multiple systems as well as the “config file first, terminal second” oriented approach (from what I’ve heard and what it seemed like to me, so please correct me if I’m wrong).

I’ve created a VM and installed NixOS using the GUI version (I’ve heard that it can be finicky sometimes and not install correctly/properly, although it worked fine for me while and after installing it in the VM; again, correct me if I’m wrong), but I plan to use the terminal version because of the minimum amount of packages installed by default (and it can’t be that hard to make some partitions and run some commands, right ? :sweat_smile:) if I switch to it on my host machine.

I have played a little bit with the VM and modified the config file to install some packages, and it didn’t look that hard, especially the syntax. Now, I have to mention here that I have some programming knowledge/background because I am a CS graduate (mentioning only for the context, that’s all), and I’ve used quite a few languages (outside of uni too), like C#, Java, Python, JavaScript, and C/C++ as well, but I don’t know C/C++ as well as the ones mentioned previously. And I’ve also noticed that you can have a language server running in the background while editing the configuration files to get syntax highlighting and suggestions/autocomplete, which should make my life somewhat easier.

What I wanted to know is:

  1. How friendly is NixOS to SSDs ?
    I’m asking this because I’ve read somewhere (don’t remember where) that NixOS is writing a lot of data when rebuilding/creating a new generation, and my main “fear”/concern is reaching the advertised TBW limit of my SSD too soon/quickly…

  2. How much space do I need for the root partition ?
    Basically how many GB do you recommend for the root partition ?
    And how many generations should I keep ?

  3. How’s gaming on NixOS ?
    Is it as simple as the other distros or does it need a little bit more tinkering than usual to work ?

  4. How easy or hard is it to get a Windows VM up and running with GPU passthrough ?
    I want to have a Windows VM with GPU passthrough for some edge cases so I don’t have to reboot to my actual Windows drive, i.e., running DaVinci Resolve to work with a specific codec or playing a very obscure game that runs on Windows but not at all on Linux. I have 2 GPUs, by the way.

  5. How easy is it to install kernel drivers ?
    I’ve recently found out that I can’t control my CPU and case fans like I could on Windows unless I install a specific driver for my IO controller that my Gigabyte mobo uses, and even then, I could only control the CPU fan and not the case fans as well on openSUSE. I think I did something wrong, and that’s why only the CPU fan was detected, but I gave up after a lot of searching and tinkering, and also because of some constraints at that time… :sweat_smile:

  6. Depending on the DE that I will use, will the ricing/modifying process be the same as on the other distros ? Or is it done through the config file as well ?

  7. Is there anything else that I should know or be aware of ?

  8. Should I switch to NixOS or stay on openSUSE ?

What I also have to mention (in hopes of having everything make more sense, though it might be irrelevant or off-topic, so I’ll remove it if that’s the case) is that I haven’t been daily driving Linux until one or two months ago… I started a long time ago to install a big range of distros (from Ubuntu to now openSUSE… quite a journey, you could say :sweat_smile:) on VMs or dual boot them on separate drives just to try and modify/rice them to my liking, install a couple apps/software and then forget about them…
I want to apologize again if I said anything stupid until now, sooo there you go… :slight_smile:

3 Likes

Yes, NixOS writes more data to the disk compared to most distros, but not on the order of terabytes more for the average desktop system… the salient concerns are more around disk space and network speeds.

Other than that, you have to get used to writing code to configure your system. The main purpose of NixOS is is basically using the nix programming language to generate the config files that other distros would have you writing manually. Even the graphical ISO will generate the config files that you end up having to edit if you want to change your system. So it doesn’t really matter that much if you use the graphical or minimal ISO, only the starting config will slightly differ.

If that idea appeals to you, then sure try NixOS. I would still keep the OpenSUSE system around, so if you don’t find NixOS enjoyable you can switch back, or if you have some important deadline, you can focus on that work and not worry about learning something new like “how do I get my graphics drivers working” under time pressure.

2 Likes

Thanks for clarifying things!

I would still keep the OpenSUSE system around,

or if you have some important deadline, you can focus on that work and not worry about learning something new like “how do I get my graphics drivers working” under time pressure.

The thing is: I haven’t fully finished configuring openSUSE how I like, and I still have my windows drive just in case or for other edge cases like I mentioned before. And I also wanted to nuke the current openSUSE install because I installed/modified too much :poop: that is KDE related, so it started to crash randomly, which is also why I want to switch DEs.

There are definitely trade-offs with all choices of distro, but I don’t think anyone serious would say that arch linux strictly dominates nixos. That’s objectively not true. If a major goal is a repeatable setup rooted in text files, nixos is superior.

2 Likes

im gaming on nixOS the whole time, baby. never been easier to set up a gaming environment MYSELF, with my own hands and my utter silliness, so that’s my final destination. i yearn for declarativeness!

edit: i just want to add: nixOS has taught me more than archlinux ever did. and im not even a computer person!

3 Likes

Yeah, I switched from Arch to NixOS - I never got into distrohopping, but some Arch breakages (ironically in the packaging of nix) in 2023 convinced me to give NixOS a try. Of course NixOS also has its breakages, but it’s so much easier to override the base packages with some custom patches or even revert the changes on NixOS, and I no longer have to deal with all the .pacnew mess. Main thing that was better on Arch was the Intel dGPU support, but I already keep a Windows install around for Davinci Resolve, so…

And I also game, on the GPU, on NixOS. (I play only Steam games.) Took 4 lines of config to set it up.

3 Likes

Since you mentioned you do some amount of software development, I should warn you of one thing in advance: the entire way you get development tools working on nixos is fundamentally different than on other distros. Installing libraries at the system level isn’t even possible really, because nixos has no global library path. For development, you need to use nix to create a development shell environment with the right stuff available, and that can be a challenge that you don’t have time for when you need to get to coding.

The same basic facts also mean that you cannot run executables made for “normal” linux distributions on nixos without extra steps. Depending on how you used linux up until now, this could be a major blockage to you just keeping on doing what you did before. This also affects gaming. You can usually run a downloaded linux game with steam-run, though, so it’s not too big a hassle. Running them from steam just works without extra steps once you install steam.

If you have any sort of dev environments or non-packaged programs that you need to work, definitely test them in nixos before you take the plunge.

3 Likes

Not unfriendly enough that you should be worried with modern SSDs.

NixOS does likely write more, since package updates propagate rebuilds of all their reverse dependencies (which is more “correct”, but generally not done on other distros), and therefore single updates cause more update churn. @waffle8946 is correct that this is likely not several orders of magnitude more writing though, and also we’re not in 2010 anymore, modern SSDs are a lot more reliable, more so than HDDs even.

I like the btrfs docs’ explanation of the hardware considerations when using SSDs.

Bottom line in either case is, keep offsite backups of important data (regardless of whether you use SSDs or NixOS or both), NixOS won’t drastically increase the amount you spend on SSDs.

I would suggest keeping a separate partition for the nix store. Practically all OS data is kept in /nix/store. I’m personally limiting it to ~20GB on most of my systems so I remember to regularly garbage collect, but 20-50GB seems like it’d be enough for most use cases.

The root partition itself can then be quite minimal, last I checked mine was <100MB, but I also keep /var on another partition.

If you use btrfs, you can leave behind your worries about mis-sizing partitions, as an aside. Or to a lesser extent with LVM if btrfs still worries you, despite major distros having started moving over to it from ext4.

Largely the same, with the caveats of native Linux games not distributed through steam that others have mentioned.

You may also need to understand nvidia driver details a bit better. Or at least not copy-paste the hairbrained stuff floating around on the internet and just stick to the defaults. NixOS gives you obvious configuration options to play around with that aren’t as visible on other distros so people break their systems a lot more. Everyone uses linux_latest without understanding the implications, for example.

I’ve not tried it, but one of the nice things about NixOS is that if you find someone who’s done it, you can copy their code. At the very least, having a second GPU should make it easier.

From a quick search, seems people have done it. Their code objectively falls in the category of hairbrained things not to copy-paste, though.

So I’d say possible, but you’ll want to learn how NixOS works and actually understand what you’re doing unless you want to have the nvidia problems people keep asking for help with.

Depends on what you mean by that. If you’re talking about firmware, most of the time NixOS’ bleeding edgeness means that the firmware will already be part of the distro.

If you mean a third party kernel module, much easier than other distros once you know what you’re doing, quite tricky before you know what you’re doing.

Depends on the DE. GNOME/plasma are largely done with their configuration, though you can set some things declaratively.

WMs you tend to be able to control directly through options in home-manager/NixOS, though often you can just oass your configuration file to an option, so not too different.

FWIW, most people around here prefer using the NixOS config file as much as possible - the entire idea is that you would like to be able to just reproduce your entire system from just that config file, after all, minus the data. This includes your wallpaper settings.

What @tejing said. Things are subtly different in the nix world. NixOS is not fhs compliant, so it doesn’t meet the expectations of a lot of software. You can’t expect things to always just work™, you’ll often have to follow NixOS-specific instructions, and where those don’t exist (or are horribly flawed) you’ll have to come up with your own.

It takes some getting used to, and genuine desire to learn and understand. Kinda like using Linux over Windows, you’re joining the nerds among nerds.

Personally I’ve found it worthwhile, but I also really like having full control of my OS. If you’re happy in the traditional distro world, you might not see the point. Plenty of folks see the point but don’t grok how Linux works sufficiently to make appropriate use of NixOS, too.

Your chances as a developer are better, but then there are lots of developers who are almost proud that they don’t understand git - if that’s your attitude you likely won’t manage to make the most of NixOS (after all, NixOS is basically just a way to put your entire OS in a git repo), and find it frustrating.

I can’t tell you who you are, you’ll have ultimately decide for yourself.

5 Likes

although you didnt directly ask for it, i think i should give some good advices and expiriences:

  • the graphical installer is easy, but in many cases simply not good enough, especially at disk partitioning (i believe its possible but i didnt really find out how) - if you want multiple partitions for nixos, use the minimal installer, it makes your life easier in this case, although you may need a few attempts to get it right.
  • when installing nixos, directly start using flakes. not using flakes is doesnt really have any benefits (IN MY EXPIRIENCE). dont get scared by the whole thing about it being an experimental feature.
  • never configure things outside of your config. this would completely defeat the point of nixos. take your time to configure applications via the config, although it may take a bit to get used to it.
  • dont blindly copy-paste big chunks of code into your config. you most likely will have to modify it at some point, and understanding a copy-pasted code is harder then writing it yourself.

i hope these tips are helpful for you.
also: This is my Personal Optinion/Expirience. other poeple may disagree with me, and thats perfectly fine.

1 Like

I would severly caution against this. Flakes have many issues, and the whole experimental thing really trips up new users. You also just flat out don’t need it for NixOS or home-manager, like, at all.

Flakes are cool when you start having more interesting use cases, but when starting out you’re just getting all the downsides (especially if you’re concerned with SSD wear…) with none of the upsides. Plus, various guides and “frameworks” will tempt you to effectively copy paste stuff if you go down that route.

Just… don’t use flakes until you actually understand what all the problems are and what the bickering is about. At least understand what people mean by lazy trees first. Either way, waaay too much context to gain when you’re just getting started.

The default alternative of channels aren’t the bees’ knees either, if you’ve gotten through your first week of NixOS and want to move to something nicer, try out npins first (and feel free to ask for help with it). They basically do everything you might want flakes for when configuring NixOS.

Otherwise, quite reasonable opinions.

6 Likes

Flakes are yet another layer of complexity in what’s going on, and learning them without learning how nix works without them leaves you with a lopsided view of the nix world, so there’s definitely an argument against starting out with them, but there are two arguments for doing so that I’m aware of:

  • Avoiding learning bad habits. Particularly when you’re first starting out with nix, understanding what’s happening at what point in the eval/build process and how it all interacts can be very hard. And you can end up writing things that an experienced nixer would barf at once you move beyond the “set the option to do the thing” stage. They work at first, but then break in strange ways because they’re built on a faulty model. Flakes disallow you from writing a whole class of those things. Mainly things that mix up the config itself with the runtime state of the system in some way.
  • Sort of related to the above, cleanly bounding your nix code can help you understand what it is and isn’t interacting with better.

There are definitely arguments both ways, but I will leave you with these points:

  • If you only learn nix with flakes you may misunderstand them as somehow very important. But flakes aren’t actually that big a deal. They’re just a way of packaging up nix code in a nice box. Nix code is still nix code. It can still do (almost) the same things either way. Nothing really needs flakes. Almost nothing is impossible with flakes.
  • Pure eval mode (which is how flakes are evaluated) disallows access to some aspects of the nix language which would otherwise be accessible, and this changes how you need to approach certain tasks. If you learn without flakes, you may write things that will be hard to convert to flakes later.
2 Likes

i mostly agree, you dont need flakes.
i’m sorry to not explain further, here some personal story:

i started out without any clue about what nixos was. when i started, everything worked fine, until the next major update (24.05) came out. there, my config just straight up broke entirely and i couldnt figure out why. then, i got help from someone in my school (i think i was pretty lucky to actually knew someone who had more clue abt nixos) and he showed me what broke. he then explained to me that the problem appeared because i messed up the channel switching. after that, he showed me my config, and i was completely stumped on how big but easy to understand it was. after that my config worked, but i wasnt happy with it anymore. so, i wanted to set up flakes & home-manager myself, but it was just straight up not working, and i spent nearly 1 month trying to figure it out (i still dont know what went wrong). i ended up completely setting up my nixos from scratch and installing it using the minimal installer, and thats about where i am now.

(sorry for the big chunk of text)

my opinions about this topic are Certaintly not objective in the slightest, but i thaught i could share them anyway

as i said, i had to completely set up my config from scratch because nothing worked at all, which is why i said its better to already begin with them. you greatly explained why thats not really a good idea, and i agree that its a higher learning curve, and it is probably very subjective to everyone wheather its a good idea. i first didnt think about the aspect of the added complexity (which is completely obvious and i dont know how i missed that point)

could you further explain why?

i also forgot to mention that i have still not understood the advanced concepts of nix(os), namely overrides (which i already seem to use but i have no idea what they do).

im into nixos alround 1.5 years now, why have i never heard of this? thanks definitely!


here are also my AGAIN: PERSONAL+SUBJECTIVE awnsers to things in the original question:

i had this problem only once with nvidia drivers.
you definitely wont be able to settle with the default installation guides. i ended up failing to install nvidia drives (because i had no real clue what i was doing so yeah)

you can do it the normal way, but that would kinda defeat the point of nixos.


thats also a point i missed, thanks.

and again: take these opinions with a giant grain of salt, and make sure to call me out for whatever i explained or did wrong.

And i am sorry for putting such a giant brick of text in here.

also, if anyone is interested, here is my config:

1 Like

To second @TLATER’s point, you don’t need to start with flakes.
If you decide to switch to flakes, it should be a 5-minute exercise:

At the end of the day, if you have something wrong with your config, switching to flakes would not fix that. You have to fix your config regardless. The only thing flakes for your NixOS config does is provide you with a nixpkgs input in a way that’s easier to track, as well as enforce pure eval - though, even without flakes, it’s best practice to keep your config “pure” i.e. not dependent on the environment that it’s built in.

4 Likes

When you use flakes, the way pure eval enforcement is implemented means that the repository you’re evaluating has to first be copied into the nix store. Every time you evaluate it.

This may seem not so bad at first, until you have a largeish repository and every nix command copies hundreds of megabytes around. In addition, if you use a flake that isn’t also a git repo, the entire directory is copied literally, leading to build artifacts and other detritus being copied into the nix store over and over again. You can quickly churn hundreds of gigabytes just experimenting a little on a rust project.

While the impact on SSD wear is probably still not realistically noticeable, if you’re worried about SSD wear this pointless copying is the exact type of thing you’d probably like to avoid. It causes other issues between the performance impact of copying huge trees and security implications of just copying stuff to the world readable store that users probably don’t expect to be copied.

It’s… Quite bad. Lazy trees don’t even help that much. At least understand this issue before you use flakes, because of the security, performance and disk wear implications.

Most of all though, when suggesting flakes or npins I’m worried we’re just giving a fledgling user choice paralysis. There’s enough to learn as-is, without having to figure out an experimental and poorly documented aspect of the tool. The official docs don’t help you at all with flakes, and the concept still needs massaging into NixOS. We’re simply not there yet for new users.

npins aren’t much better in terms of documentation, but at the very least they don’t turn the ecosystem on its head and have a more clear scope of what they do.

5 Likes

I’d like to give you my thoughts about picking NixOS as well.

Other distros can generally be put into two categories: “Rolling Release” Distros and “Stable Release” Distros. Both of these models have their pros and cons.

I personally started with a Stable Release Distro. But since I’m a developer, I always ran into situations where I needed the newest version of a package, which was a huge pain. Also, once or twice a year there’s the point where you need to upgrade to the next stable release. Because this usually changes A LOT and all at the same time, there’s also a lot that can go wrong. So did it for me, quite often even. So upgrading always brings that fear with it, and there’s no going back if it fails. So better only do it when you have enough time to fix your system, or even completely reinstall it.

Because of this, i switched to Arch (Rolling Release). Now i always had the latest packages, and i got updates in more “digestable” chunks. Now it happened more often that something goes wrong, but it was usually way quicker and easier to fix, because not that much changed. But still, updating always had a risk to it, and doing it before a video call was certainly a very bad idea.

What also was quite a problem for me was that my configuration files started to “rot”. When you first install normal linux systems, a default config file is copied to yor /etc. As time goes by you need to edit some of these. And that’s where the problem starts. When you get software updates, these “default configs” also change, but if you’re not on the default anymore, the package manager cannot just replace your configs with the new ones. So you’ll have to fix this manually, which you often won’t do, leading to problems in the future.

What’s cool about NixOS is that you don’t really have to choose between these two paradigms. It’s really the best of both worlds. It’s as stable as nothing else, but also has the latest software of any distro. If something goes wrong, just go back. To me it was the first time I could use my system without the fear of it failing.

Also, your config files don’t really rot, because nix knows how to “merge” your settings with the defaults. I’m using my NixOS for 6 years straight now, and it still feels like i only installed it yesterday. You won’t get this with any other distro.

But this peace of mind comes at the cost of a steep learning curve. If you haven’t experienced the problems I mentioned yourself yet, it’s probably hard to justify that cost. Which is why I usually don’t recommend NixOS to people new to linux. It’s like telling a kid not to do something. They usually have to learn by themselves the hard way :smiley:

But there are also arguments why you should use NixOS right away, even without linux experience: Since NixOS is an abstraction layer over the usual linux configuration, you won’t be confronted with the “usual” way, and won’t have to learn it in such detail. You’re mostly just learn the NixOS abstraction.

But that’s also the problem with this: Eventually, you’ll have to dig below the NixOS abstraction layer and learn the “usual” way anywy. If you’re learning from the bottom up, that’s probably less painful.

And about flakes: I’m in the camp “do it from the start”, too. At least to me, they’re really the essence of what nix is about. Without them, the benefit of using NixOS is lower, and therefore it’s even harder to justify. But granted, it adds to the learning curve again. Using Npins or something similar is also fine, but is it really simpler? And if yes, is it worth using a “less standard” solution?

1 Like

Flakes are so far away from being the “essence” of what nix is about. Statements like this drive me crazy (no offence intended, you are welcome to your opinion!). The essence of nix is removing place-oriented programming from dependency management. It’s that when you want to refer to a file in order to learn its path you have to refer to it in a nix expression and that the act of learning a path ensures that the path exists. Everything else is window dressing and could be deleted and while your ergonomics might take a dip, most of the benefit would remain.

Flake if you want to, but flakes are window dressing. They are also not standard.

7 Likes

First, I want to thank you all for the great answers that you gave me. I understand NixOS a little bit more now thanks to them.
Now I have three more questions I would like to ask that I forgot to mention in the first post (Sorry :sweat_smile:):

  1. Is BTRFS useless for the root partition ?
    Coming from openSUSE, I manly used BTRFS because of the snapshot and rollback features, which saved my ass quite a few times, now that I think of it… And since NixOS creates a new generation every time you rebuild, It feels like there’s no use case for BTRFS, at least for me. Also, resizing on the root partition is something I would rather do when installing/reinstalling the OS.

  2. Are there any good learning resources/guides or youtube channels that you recommend ?
    If you know any, please let me know. And regarding youtube channels, I started watching “Vimjoyer” and it seems quite helpful for new users like me.

  3. From what I’ve understood here and seen on the internet, flakes are somewhat similar (in terms of how they work) to the package and package-lock json files from NodeJS, is that right or I got it wrong ?
    I’m mainly asking because I might need the version locking feature in the near future.
    And are there any software that do this besides npins ?

Perhaps?

NixOS creates new generations, yes, but it does not track data. Since data can often have an impact on whether things actually work in practice, since many applications play things fast and loose when it comes to separation of data and configuration, having data snapshots can still come in handy.

btrfs snapshots are probably useless for /nix/store, but / may contain data which affects system operation. Unless you use an erase-your-darlings-style setup, of course.

Things that live less deep in / are also admittedly often less bad at separating config and state, in fairness, so you’re mostly looking at services that store things in /var.

btrfs has other useful features besides snapshots, FWIW, so even if you don’t need snapshots I would not call btrfs “useless”.

https://nix.dev/ is the best thing the community has. It’s very light on NixOS-related documentation, unfortunately.

Everything else is either reference documentation or third party, and IME third party sources are a lil’ hit-and-miss.

I appreciate this doesn’t help much, sorry, NixOS has a reputation for a documentation problen for a reason.

That’s part of the the idea for them.

Flakes are a high level concept designed to solve a whole bunch of problems the nix ecosystem has, introduced as one big set of interconnected features.

The core of it is indeed a file schema, which exposes project inputs and outputs similar to package.json, and a lockfile similar to package.lock. With it come a new CLI interface similar to npm, a concept for a nix ecosystem without a centralized nixpkgs, the new “pure” eval mode, an evaluation caching system, …

The broad scope is their main problem. You can’t use the file schema without also buying into all the rest, or vice-versa.

It’s quite unfortunate; IMO the design and intent are pretty cool at a high level, but many of the individual features are still quite rough around the edges, and have grave issues like the tree copy problem I mentioned. Since it’s all so interconnected any of the objective, important improvements are also held up by all the other stuff that isn’t really ready yet, hence their experimental status for the last 5 years.

There is also niv, both of these are just thin wrappers on top of built-in nix functionality, though, so shopping around isn’t really going to give you vastly different features.

Both are basically just lockfiles for nix projects.

3 Likes

So I should keep using BTRFS ? And if so, is there anything where I can find info about which directories/places I should take snapshots of and which not ?

Dunno, see the upstream docs to see if the features look useful to you: Introduction — BTRFS documentation

I’ve started using it on my systems, and snapshots have come in handy while migrating services (most recently because of the sudden deprecation of cunduwuit).

Assuming you don’t configure anything outside configuration.nix, /home and /var should typically be the only place actual data goes. Those directories should basically always have separate subvolumes.

/nix should never be snapshotted, worst case changing snapshots in it can break your running system and make booting other generations impossible.

All other directories are mostly optional, and may not play well with garbage collection if you do move around snapshots, but should be easily recovered with a reboot if things do go wrong, so it might be useful to keep snapshots for later inspection in case data does end up in them.

1 Like