this post was submitted on 13 Jan 2024
36 points (82.1% liked)

Linux

48338 readers
730 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
36
submitted 10 months ago* (last edited 10 months ago) by wwwgem@lemmy.ml to c/linux@lemmy.ml
 

I've been curious about NixOS for quite some time. Reading about it I couldn't see how the config sharing capabilities, setup, or rollabck would be better than Arch and sharing the list of installed packages, using downgrade or chroot.

So I decided to run NixOS in a VM and I'm still confused. An advantage I can see for NixOS is its better use of cores and parallel processing for packages install.

It's clear that I'm missing something so please help me understand what it is.

Edit: Thank you to everyone in this great community! It's always so nice to have a constructive and sane discussion.
After reading so many comments, they all confirm what I've read before and I may realize that my real problem is already having a stable system and no need for the great NixOS options that are very neat but would not benefit my specific and simplistic needs. That being said I can't refrain myself from being curious and will continue testing NixOS.

The need for only 2 config files is the top of the iceberg but hiding more complex configuration to rely on. Not that I really have too much spare time but I do enjoy learning and tweaking NixOS. With its current development state, things are changing a lot so it can keep me busy for months. That's probably what I was mostly looking for: another toy to play with.

Along my journey I will learn a lot about NixOS and may find a feature that will motivate my switch to it. Thanks again for all your precious feedback!

I'll also take this opportunity to share the best help I've found so far to start with NixOS: https://github.com/MatthiasBenaets/nixos-config And his 3 hours (!) video: https://m.youtube.com/watch?v=AGVXJ-TIv3Y

you are viewing a single comment's thread
view the rest of the comments
[–] onlinepersona@programming.dev 14 points 10 months ago (9 children)

Better in some ways, but it has the worst documentation of any distro I've seen so far. https://nixlang.wiki is trying to improve that

CC BY-NC-SA 4.0

[–] Laser@feddit.de 12 points 10 months ago (8 children)

How to read NixOS documentation:

  1. Go to wiki, see if topic exists
  2. If it does, notice how it doesn't cover your case
  3. Use the hints from the wiki to get your search engine redirect you to https://ryantm.github.io/nixpkgs/
  4. Notice it still doesn't cover your use case
  5. Use search engine again, this time with the hints from aforementioned page, to arrive in the proper code in the nixpkgs repository
  6. Read annotated source code to see what actually happens

Yeah, this is how I found https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh yesterday because I wanted to install some shell scripts that needed to be adapted.

Don't get me wrong, maintaining a distribution the way NixOS is a huge effort and I can't praise the maintainers and developers enough. The ecosystem they've built is unlike I've seen anywhere, and the technical foundation is sound – in fact I'd wager more sound than what commercial distributions offer. The latter just have more grease. But I do understand the criticism about lacking documentation. But human labor is scarce, and I mean look at me posting this here instead of improving it.

There's also no good guidance or best practices for packages in nixpkgs and stuff is permanently changing (which in my opinion is good). E.g. did you know that new derivations should be sorted by letters, not categories, and not go into all-packages.nix? At least if your derivation doesn't require fancy attributes (pardon me if that is not the correct term). Or that stdenv.mkDerivation rec {…} is not best practice, but rather stdenv.mkDerivation (finalAttrs: {…})? And why the latter even works?

Writing good documentation for a system, especially one that's permanently evolving, is not easy, and I prefer all efforts going to actually maintaining and evolving the system itself than trying to get the perfect documentation that's outdated in a matter of time. And without trying to gatekeep it, NixOS is a distribution for advanced users. I recommend it to everyone who has a solid understanding of how a Linux system is composed because I think it's important what NixOS abstracts away from you. And as an advanced user, reading commented code once in a while is fine in my opinion.

[–] onlinepersona@programming.dev 5 points 10 months ago (7 children)

The problems with nix/nixos documentation are:

  • documentation isn't sexy so not many want to do it
  • documentation is difficult to be written by beginners because... they're beginners
  • nix/nixos maintainers undervalue documentation efforts - I've tried to get in pull requests, but they just stall (not reviewed, nitpicked to death, simply not merged, etc.)
  • it isn't generated from source code

Also, the very top heavy decision making process harms the community. Some person with hundreds of commits can push through nearly any change (good or bad) relatively quickly, unless other frequent contributors are really really against it. However, fresher contributor with a great change is forced to go through a never-ending process and few stay to actually finalize it.
Pushing to master was not seldom for a long time and IINM it isn't possible anymore. But maintainers can simply (and do) create a PR, make a change and merge it.

These difficulties just make me want to fork nixos. For documentation, at least there's https://nixlang.wiki

CC BY-NC-SA 4.0

[–] Laser@feddit.de 4 points 10 months ago (1 children)

Good points. If you go through the open pull requests on nixpkgs, there's a lot of stuff that never got through and it's not obvious as to why. I was happy to see a lot of stuff merged less than a week ago. But at this point, there's a huge backlog.

As to forking NixOS, which in my opinion means forking Nixpkgs, Guix system seems like a good start. I decided for NixOS because of proprietary packages as I use Steam, and support for secure boot which while still young and only through lanzaboote works very well for what I use it.

[–] onlinepersona@programming.dev 3 points 10 months ago (1 children)

Guix system seems like a good start

I'm glad they exist. It shows that the concepts can be successful using another language. To me, the major downside is exactly what you said: no proprietary stuff. Additionally, it's LISP.
In a fork, I'd try to change the way decisions are made, which software is used, add linting and autoformatting to repositories, move away from github (maybe by the time I find the time to we'll have federated sourceforges) and github actions, maybe use nickel or haskell instead of nix, generate documentation from sourcecode, try and use a distributed cache (tahoelafs, ipfs, storj or some other distributed/decentralised file storage), etc. Getting any of that done in the current repos seems like an uphill battle.

CC BY-NC-SA 4.0

[–] Laser@feddit.de 3 points 10 months ago

Let us know when you do! It's a huge undertaking and NixOS has a pretty big network effect. Doesn't mean no one should tackle creating an alternative. I fully believe declarative distros are the future for any production environment and that the space is far from taken by current distributions.

load more comments (5 replies)
load more comments (5 replies)
load more comments (5 replies)