I’ve been here a week ago already asking if Arch would be fine for a laptop used for university, as stability is a notable factor in that and I’m already using EndeavourOS at home, but now I’m curious about something else too - what about Arch vs NixOS?

I heard that NixOS is pretty solid, as due to the one file for your entire system format you can both copy and restore your system easily whenever, apart from your normal files and application configurations of course.

Are there any major downsides to NixOS compared to Arch apart from the Arch Wiki being a bit less relevant? I’d also lose access to the AUR, but admittedly I don’t think I’ve ever actually needed it for anything, it’s just nice to have. Also, since NixOS has both rolling release and static release and you can mix and match if you wanna get packages from unstable or not, I’m not losing Arch’s bleeding edge, which is nice.

  •  ani   ( @ani@endlesstalk.org ) 
    link
    fedilink
    30
    edit-2
    10 months ago

    I’d recommended Arch because with NixOS you end up having to tinker too much. Besides, if you need to use Linux for development purposes, Arch follows the usual Linux/Unix conventions, while with NixOS you would end up tinkering…And you can always use the Nix app from Arch.

    Just use Arch with Gnome or KDE, that will save you a ton of time.

      • Comparatively, NixOS is complex, while Arch is simple. NixOS diverges very much from traditional Linux distributions, beginning with using a diferent filesystem hierarchy, which breaks a ton of apps, requiring workarounds like patches, simulating a standard filesystem… In the long run, you will have to deal with many NixOS-specific issues.

        Because you’re going to Uni, it’s better to focus on having a mostly just works distro with updated repository, and that’s Arch. On your free time in the future, maybe try NixOS in a VM just so you have a feel for it. And again, you can use Nix on Arch so you use apps from Nixpkgs.

        This all comes from an originally Arch user turned into an experienced NixOS user.

      •  Auli   ( @Auli@lemmy.ca ) 
        link
        fedilink
        English
        110 months ago

        Nix is a pain. Not everything works. Example Netword supposed to be able to put options in some confines. Sure most work but I have two in my config that nix well not put in. Why they are valid an I’m running them on my current Os but my nix van refuses to build with them. Another nftsble rules. Again supposed to put them in config file. But I have some nix does not like, completely valid rules but nix won’t build with them. I’ll tinker with it but it still needs work.

    • This is my experience as well. I went back to Arch after trying NixOS for a few weeks. I just ended up spending way too much time tinkering with the system instead of using it. Also, I feel like a major advantage to nixos is only viable if you have multiple machines. I only have a main desktop.

  • Using NixOS for more than six months, and I think I’m eligible to say what I like and hate about it.

    What you’ll like:

    • easy configuration - just refer https://search.nixos.org, it’s that easy. I’m not taking that comment about “NixOS being hard to configure” seriously - and this is coming from someone who hasn’t even learnt the language properly. Yes, my configuration.nix is slightly polluted with Starship configs, and I might want to break them into modules, but it is still a job done decently.
    • won’t break easily except in some extreme situations - Laptop accidentally slipped from my hand during nixos-rebuild switch --upgrade - I guess it was the physical trauma to my device messed up the mount path to /boot, but it was rescued by a single CLI command from the recovery USB, and I didn’t lose any files.
    • upgrade is not prone to breakage, and even if it does, you can rollback - just don’t walk while holding your device and drop it.
    • it is a serious distro, not a “hobby” OS, and the experiences you will gain from learning Nix will help you with SaaS platforms like Replit or Railway, if you’re interested in using them sometimes in the future.

    What you won’t like:

    • Binaries do not work properly - since Nix store is a completely different storage system compared to your usual FHS, most of the binaries will suffer from incorrect RPATH and dynamic loader issues - you might have to autopatchELF them, which is kind of irritating. This is also the case for AppImages, by the way.

    • Nix language is more like a custom DSL and less of a general purpose language, so you’re gonna have to use another language for automation (Shell, Python, Ruby), which might pollute your self-hosted Nixpkgs - Guix fixes this issue.

    • The bad part about NixOS is writing Nixpkgs expressions. The repository is damn huge and it is hard to maintain spaghetti code, writing your own package can be pretty hard, there’s some “hack”-y stuff you’re gonna have to use for building in, let’s say, using buildRustPackage and buildDotnetModule, and you’re gonna have to work with a senior maintainer.

    Honestly, if I had to avoid Nix, I would go for Guix, Gentoo or Devuan. But yes, if you’re a beginner, I’d ask that you refrain from touching NixOS.

    • Guix

      +1, since for me it’s much easier to grok the language and the schema at a single glance.

      Plus for those worrying about linux-libre kernel not having the right drivers for your hardware, non-guix has you covered and you can easily switch to linux-mainline. I’m really enjoying Guix a lot right now.

      •  Dario   ( @dario@feddit.it ) 
        link
        fedilink
        4
        edit-2
        10 months ago

        After having used Parabola GNU/Linux-libre for more than ten years, I seriously considered moving to GNU Guix System. The only thing holding me back is that I saw some seriously out of date packages in the repository. Off the top of my head, GNOME was like three major versions behind. How do you deal with that?

        • Its pretty easy to update the packages yourself, just bump the version and the hash, or if needed add some missing libraries.

          Because the review process is slow, sometimes it’s easier to just check the Guix Patches buglist for existing submitted patchfiles and then add them to your tree

    • I’m a bit surprised to see that you disagreed with the “NixOS is hard to configure” bit, but then also listed some of the reasons why it can be hard to configure as cons.

      By “configure”, they probably didn’t mean just setting up say, user accounts, which is definitely easy to set up in Nix.

      The problems start to arise when you want to use something that isn’t in Nixpkgs, or even something that is out of date in Nixpkgs, or using a package from Nixpkgs that then has plugins but said plugin(s) that you want aren’t in Nixpkgs.

      From my experience with NixOS, I had two software packages break on me that are in Nixpkgs - one of them being critical for work, and I had no clue where to even begin trying to fix the Nixpkg derivation because of how disorganized Nix’s docs can be.

      Speaking of docs inconsistencies you still have the problem of most users saying you should go with Flakes these days, but it’s still technically an experimental feature and so the docs still assume you’re not using Flakes…

      I was also working on a very simple Rust script, and couldn’t get it to properly build due to some problem with the OpenSSL library that one of the dependent crates of my project used.

      That was my experience with NixOS after a couple of months. The concept of Nix[OS] is fantastic, but it comes with a heavy cost depending on what you’re wanting to do. The community is also great, but even I saw someone who heavily contributes to Nixpkgs mention that a big issue is only a handful of people know how Nixpkgs is properly organized, and that they run behind on PRs / code reviews of Nixpkgs because of it.

      I’d still like to try NixOS on say, a server where I could expect it to work better because everything is declarative such as docker containers - but it’s going to be a while before I try it on my PC again.

  •  Unmapped   ( @Unmapped@lemmy.ml ) 
    link
    fedilink
    19
    edit-2
    10 months ago

    The downside of NixOS is bad documentation. Which makes it take quite a while to get your config setup the way you want. Its so worth it though. I used arch for 5+ years and have been on NixOS for about 6 weeks now. I’m definitely never going back. My conifg is done, I barely have to change anything now. Its all saved in a git repo so I never have to make it again. I’ve already switched all of my machines over. And even a few of my friends. Which has been super easy to do cause I just give them my config then remove everything they don’t need. I’ve only been using it for a little while but it feels so reliable and Unbreakable even though I’m running unstable packages. Because if anything breaks you just go back to the last generation that worked. Which made me willing to just try anything when I was setting it up.

    Also you could run Nix package manager on arch for this, but the nix package repo is amazing. It has everything i’ve needed or even thought about installing. And in my opinion its way better than using AUR packages. Most of the time you just DL them and don’t have to build them. Its just so much faster and more reliable then using Paru or Yay. Plus there is a NUR( nix user repo) but tbh I’ve never even looked at it.

    The other con I know of is issues running binaries and app images. But there are was work arounds for them. I use a few app-images by just running 'appimage-run '. And so far its worked perfectly. As for a binaries you can use steam-run or I think using distrobox would work. But I haven’t had to do anything like that yet.

    I found this YouTube channel quite useful when I was setting mine up. Vimjoyer

  • I used to like the idea of nixos because it felt “tidy” to configure everything centrally. However that tidyness is achieved by adding an extra layer which just replicates the configuration options of every program. If there is a bug in that layer or something is just not implemented, either you have to learn the whole inernals of nixos and nixpkgs, for which there is no real documentation, or you have to resort to doing things imperatively again, which is hard because of the opacity of the generated system and also defeats the whole purpose. So basically, you are completely dependent on nixos developers for things you could have easily done yourself on arch.

    • I have to disagree with this, with home-manager you can pretty much put just put your normal config files inside your NixOS config and map them into wherever they’re meant to go, except now they’re managed by nix

      The built in config options are really nice but you don’t have to use them in the slightest as long as the package itsself is in nixpkgs

  •  taanegl   ( @taanegl@beehaw.org ) 
    link
    fedilink
    13
    edit-2
    10 months ago

    Let me put it like this: it’s about learning curve. Arch is relatively easy to begin with, but NixOS gets much easier the more nix you learn.

    What do I mean about that? Imagine having to patch something, which can be the thing. On arch you’d have to replace a package, which could lead to issues and conflicts, whereas NixOS gives you the option to keep two or even more versions of the same library, because it does not rely on your traditional UNIX path.

    But with this super power comes a catch. You have to learn a programming language and learn how the nix store operates, which is a pretty high learning curve. Also, NixOS suffers from a governance issue and going by the documentation is like shooting in the dark.

    That being said, the best manual for NixOS is GitHub, searching for anything and filtering by the nix language. You’ll see a ton of varying systems, be they workstations or servers.

    And no matter what all the warnings say, no, flakes aren’t EXPERIMENTAL or UNSTABLE, but rather CONTENTIOUS internally. Again: I love NixOS, but they gotta fix their governance issues.

  •  Lupec   ( @lupec@lemm.ee ) 
    link
    fedilink
    8
    edit-2
    10 months ago

    As a recent NixOS convert coming from Bazzite (Kinoite/Silverblue with user friendly daily driver and gaming tweaks), and before that mostly Arch-based distros, I’d say it boils down to the tradeoff between having way more control over reproducibility and having to deep dive into the often poorly documented domain specific rabbit hole that is Nix. If you’re comfortable with going out of your way to learn, looking for examples, reading source code to find out what options you can use or how stuff works, it can absolutely be worth it but it’s a steep price to pay for sure.

    I personally adore what Nix sets out to solve and find it extremely rewarding to learn. Plus, as a developer, I enjoy puzzling out how to get stuff done and don’t mind diving into the source if I need to, so it works for me. I’d absolutely prefer solid documentation, of course, but it’s not a deal breaker.

    When it comes to software, the Nix repo has a staggering amount of prebuilt binaries ready to download (which you can search here) and it’s often not too hard to hack together your own reproducible package if you want after you get comfortable enough with it. At least for my use cases, I haven’t really missed much from my days using Arch and the AUR. If anything, I appreciate how much more consistent it tends to be in comparison.

    If you, like myself, go for a flake (yet another rabbit hole within a rabbit hole) based setup and point to the unstable repo, you basically get a fully reproducible, easy to update and rollback rolling release not too dissimilar to using Arch with auto btrfs snapshots enabled. That’s how I used to do Arch and it feels pretty familiar.

    Anyway, that’s what I got. If you have any more specific concerns or questions I’d be happy to elaborate!

    Edit: I forgot to add but I find a nice way to get comfortable without fully commiting is using Nix as a package manager on any old distro. You could install it on Endeavour (I recommend this method) and play around with Home Manager, use it as a dotfiles manager on steroids, have it declaratively install and manage the CLI apps you can’t live without and whatnot, see how you like it. That’s how I started, I have a common HM config I’ve so far used with Debian at work, Ubuntu running under WSL when I’m on Windows and now NixOS itself.

  •  Helix 🧬   ( @Helix@feddit.de ) 
    link
    fedilink
    English
    710 months ago

    If you want to make your OS to a hobby, choose NixOS.

    If you want a system that just works, use Kinoite or Debian.

    If you want cutting edge software but fear Arch/Endeavour is prone to breakage, consider doing file system snapshots e.g. with snapper which you can boot into.

    • If you want cutting edge software but fear Arch/Endeavour is prone to breakage, consider doing file system snapshots e.g. with snapper which you can boot into.

      openSUSE Tumbleweed fits that bill perfectly.

  • NixOS’s documentation is dog. It’s not absolute dog, but it’s dog. The learning curve is brutal.

    But… the (mostly) declarative management is its strongest feature. It’s very solid and you can easily unfuck you system if you haven’t done stuff like mess with partitions or delete files manually.

    If NixOS had better documentation and GUI to manage the system, it would be a no-brainer, but unfortunately, it is about 5-10 years away from that. The community is very top heavy, but it’s easy to just do your own stuff.

  • My honest opinion? Neither. Just go with something that works out of the box like Linux mint until you’re done with school then you’ll have time to mess with your system. That’s what I did for a friend of mine when he went to college. Gave him a laptop with mint on it and never heard a single complaint from him. It has everything he needs. Focus on school now and worry about distros later.

    • I have to agree, if you’re late or have assignments that don’t work correctly because of your special Arch/Nix install, you’re going to be in for a very rough time. College is when you need to focus on learning exactly what is prescribed by the professors and instructors. Anything else you learn is secondary, and your free time is best spent on extracurriculars and trying to make friends because thats the stuff that’s really hard to do after college. Y’know what’s not hard to do after college? Scavenge a junk computer for next to nothing and install NixOS and Arch on it

    • I don’t know about everyone else, but I had a lot more spare time to tinker with linux when I was a student than after, having a full time job. But I guess if you only have the one computer and need it to work, then tinker in a VM or something. Don’t wait with tinkering and learning about linux if it is interresting to you and something you want to spend time on. You might not have the time for it in a few years.

  •  utopiah   ( @utopiah@lemmy.ml ) 
    link
    fedilink
    2
    edit-2
    10 months ago

    Going to sound like a boring pleb but… if your OS takes less than 1h to install and setup (which is my experience with Debian/Ubuntu on a SSD with a fiber connection, or even on a RPi with a modern microSD on an ADSL connection over WiFi) then it doesn’t matter much what you use. You grab a mug of coffee, click here or there from time to time and if your /home partition is saved you are good to go faster than most people even respond to an email.

    • I think the funniest part of this is I was recently preparing some laptops for work with Windows 10 and it literally took 6 hours thanks to slow updates, one laptop corrupting the keyboard and touchpad driver so completely it required a full reinstall (on a fresh install mind you) and other impressively terrible snags. Granted it would’ve been more like 1-2 hours if I started with an install image that wasn’t about 2 years old, but it was still impressive how much of a time sink it was

    • I should add if you want to tinker “shallowly” containers are amazing. If you need to tinker deep, using a VM proper or even another physical machine (with a KVM or another keyboard and monitor) while your main machine remains untouched, it should NOT affect your uptime.

  • some comments.

    • both are absolutely fine for a university laptop, though very different.
    • NixOS is more stable. It is almost impossible to brick it, you would have to delete every working old generation.
    • nixpkgs is like arch repos plus AUR together. nixpkgs is actually one of the biggest repos if not the biggest repo at the moment. so no problems there.
    • i mean, this is like highly subjective and my own opinion: go with NixOS, it’s just a cooler OS imo and your system and your abilities will only get better with time. and it’s fully reproducible by design, so almost every bit of work you put into it will be worth it, in some sense. i also believe that NixOS will become much much more relevant in the future. bigger community, better documentation, more resources!
    • …unless you don’t want to put a lot of time in it in the beginning. it will most likely be really frustrating and it will distract you from other dtuff you want to do on your computer. like just getting browser email editor etc. you will have a setup no problem pretty quickly. it won’t be more than just puttung the programs you need in your systempackages. but then you realize you need vpn, or a dropbox client, or some audio setup, and other stuff, and before you know it you are spending hours and hours or weeks trying to find out how this works… this is, i would say, the major “downside” of NixOS conpared to arch
    • if you can afford trying it out and then switching to something else and starting over again, try out NixOS!
  •  dino   ( @dino@discuss.tchncs.de ) 
    link
    fedilink
    English
    210 months ago

    You didn’t mention a single argument for why you would need a reproducible system. It sounds more like the buzz around immutable systems makes you think you are losing out on something, which is not the truth.

  • I think you are understating the value of the Arch Wiki and AUR.

    I am also a university student. I was required by one of my courses to program an Arduino using ArduinoIDE. My program, however, was not detecting my Arduino. By simply scrolling the Arch wiki, I found the issue, downloaded the fix via AUR and was able to get it working hassle-free. An equivalent of this process does not exist on NixOS.

    I do not know what programs your uni requires, but if you do plan on using them on Linux, Debian or Arch, or their many derivatives should be the go-to simply for documentation and quick-fixes alone.

  •  Astaroth   ( @Astaroth@lemm.ee ) 
    link
    fedilink
    2
    edit-2
    10 months ago

    Disclaimer: I only tried NixOS for less than a month when I was a complete Linux noob, I have since then been daily driving Arch Linux for about 2 years now.


     

    For me, at least on the surface level, NixOS just felt like Arch Linux, with more similarities than differences.

    What was nice about NixOS was the single config file for everything, although iirc I had to reboot every time for it to be applied while with Arch you can just install something and run it immediately.

    Edit: I either remembered it wrong or I was doing it wrong because you don’t have to reboot the whole system according to the reply from hallettj.

     

    What I didn’t like however was all the packages that got installed (through the list in the config file) had really strange directories which I couldn’t find easily.

    like on Arch the packages and the executables are basically all at /usr/lib/ and /usr/bin/ and iirc it was pretty much the same on NixOS, except on Arch I’ll have usr/lib/firefox but on nix it would be usr/lib/u123uadqasd782341kasjhiu3sh932s9sdasdsapzxcqw-firefox

     

    Another thing is that it works great for everything you install through the Nix config file, but it’s not necessarily going to clean up any files created by programs that got installed through it when you remove the packages from the config file.

    Like say you have installed steam and then you install some game through steam, well that game wasn’t added through the config file so there’s no guarantee that if you decide to remove steam that you will also remove whatever the programs steam installed or if they created some new files somewhere.

     

    Of course the same thing already happens on other OSes as well, so you could say that it’s an upside that Nix is better at cleaning up after itself whenever you remove something, but also because it’s supposed to all be controlled through a single config it just feels that much worse when you have to hunt down some file somewhere.


     

    Again these are mostly my anecdotes from 2 years ago when I was a complete noob. Maybe I wouldn’t have any issues if I tried it today. And chances are I was just trying to do something you shouldn’t even be doing.

    Plus at the start I used KDE Plasma 5 on Nix and Arch, maybe it will go better if I use i3wm on NixOS like I’ve been doing for a year and half or so on Arch now.

     

    At least I’m pretty sure that having daily driven Arch for 2 years now I would have much better chances with NixOS now than when I tried it with 0 experience on Linux.

    So since you’ve already got the experience from using EndeavorOS you might not have any big problems using NixOS, or at least learn how it works pretty fast.

    •  hallettj   ( @hallettj@beehaw.org ) 
      link
      fedilink
      English
      3
      edit-2
      10 months ago

      I want to make a small correction - this is not true:

      iirc I had to reboot every time for it to be applied while with Arch you can just install something and run it immediately.

      nixos-rebuild behaves like most package managers: it makes new packages available immediately, and restarts relevant systemd services. Like other distros you have to reboot to run a new kernel.

      And cleaning up Steam games is as issue with most distros too. But I kinda see your point.

      Btw Nix (both NixOS and the Nix package manager running in other distros) has this feature where you can run packages without “installing” them if you just want to run them once:

      $ nix shell nixpkgs#package-name
      

      That puts you in a shell with one or more packages temporarily installed. The packages are downloaded to /nix/store/ as usual, but will get garbage-collected sometime after you close the shell.

  • You can setup your Arch with grub menu btrfs snapshots just like NixOS for convenient rollbacks. NixOS has too steep a learning curve, coming from someone who recently tried it and ended up being somewhat disappointed by it. NixOS sounds good on paper but in reality it is a long way from a mature product for desktop or general use.

    As you mentioned Arch has AUR which packages just about anything and everything you could ever want in the future. And the Arch Wiki will never be “not relevant” so long as you are using Linux anywhere, the Arch Wiki is a handy reference.