33
NixOs why? (lemmy.ml)
submitted 1 year ago by 0therbit5@lemmy.ml to c/linux@lemmy.ml

Hi everyone, someone can explain, in simple words, why considering to switch on NixOs over other distro? And the use case? I think would help a lot of people (including me) to understand it better :D

you are viewing a single comment's thread
view the rest of the comments
[-] chayleaf@lemmy.ml 26 points 1 year ago* (last edited 1 year ago)

You know why reinstalling Linux is annoying? Because you have to remember (or write down) every piece of config you ever changed. Dark mode in KDE? Change it in settings. Some systemd unit tweak? Change it in /etc/systemd. Want to run some commands at boot? Use systemd (see above), or write an initrd hook (distro-specific). Need a specific version of an app? Need some files in /opt? Need certain packages installed? You better remember to do that!

In NixOS, you "reinstall" your OS every time you change a single setting, because reinstalling NixOS isn't scary at all - everything that needs to be changed is configured in your configuration - just make sure /home and /var/lib are saved (and perhaps some other dirs, I have root on tmpfs and bind mount all persistent files I need to ensure I know what needs to be preserved on clean reinstall and what doesn't).

Want to move it to a different PC? No problem, copy the files in /home and /var/lib and simply install NixOS using the configuration you already have on the new PC. Want to create a boot option with slightly different kernel or kernel options, or maybe even another DE? No problem, specializations got you covered.

And of course, this also means it's easy to share configurations for specific use cases. Want to run on some specific hardware that doesn't work out of the box? Perhaps nixos-hardware got you covered. Want a certain program set up? Maybe there's already a NixOS option for system-level config or a home-manager option for user-level config, worst case you can write it yourself and share for everyone else in the community using flakes, and maybe open a PR to nixpkgs/home-manager. Want to share configuration between systems? That's easy, put them in the same flake and write a common module shared between all of your systems.

Basically, if you're fine with whatever comes out of the box in any Linux distro, you don't need NixOS, but if you need configuration, if you run servers, it is a lifesaver. I switched from Arch, no regrets. I run my personal laptop, my server, which I effortlessly migrated from Oracle Cloud when they quit Russia, and my router on it, here's my NixOS/home-manager config.

The only downsides are the learning curve and the fact that you can't "just" run programs that expect a FHS layout. You can do it with workarounds like steam-run or appimage-run anyway, but overall be prepared to learn to package stuff for NixOS. Also if you have no experience with functional programming, the Nix language may be hard to understand at first.

[-] 0therbit5@lemmy.ml 1 points 1 year ago

Really exhaustive comment, I can say from my side that for my daily use is not my distro but apply on a server side is not bad at all!! Thanks 😊

load more comments (7 replies)
this post was submitted on 03 Jul 2023
33 points (97.1% liked)

Linux

47332 readers
1244 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