this post was submitted on 19 Jun 2023
33 points (94.6% liked)

Linux

54078 readers
501 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 6 years ago
MODERATORS
 

Hi everyone!

I saw that NixOS is getting popularity recently. I really have no idea why and how this OS works. Can you guys help me understanding all of this ?

Thanks !

(page 3) 34 comments
sorted by: hot top controversial new old
[–] chris@lem.cochrun.xyz 1 points 2 years ago

I've been using it for over a year and love it. A config file for your entire system, and built in rollbacks anytime something goes wrong. One language to configure everything, although in practice that doesn't always work. But I love it.

Some others have started why it works, here is some how. Nixos completely disregards the fhs. Packages don't install to anywhere standard, every package and configuration change gets it's on directory in /nix/store but through smart use of tracking everything there, it symlinks all those files to proper places and sets up the environment for them to know where libraries are.

This is then also why you don't need sudo privileges to install things. Your profile has an environment that is aware of your users packages and configurations, the system itself isn't effected because everything is symlinked.

Then because every update means new directories in /nix/store you can role back to your last configuration because plasma broke something or whatever.

However, it's a LOT to learn. Best place I know of is https://piped.video/watch?v=AGVXJ-TIv3Y&t=0

This guy did a good job for me. Hope this helps!

[–] authed@lemmy.ml 1 points 2 years ago

Never tried NixOS but I think I will try Qubes-Whonix next: https://www.whonix.org/wiki/Qubes

[–] 20gramsWrench@lemmy.dbzer0.com 0 points 2 years ago* (last edited 2 years ago) (8 children)

I'm really not sure of where this would be anymore usefull than a simple bash script to install all packages you need since it doesn't do configs and that rollbacks are supported by some filesystems already. Also Having version specific dependencies is already a thing for flatpacks and such

[–] kevincox@lemmy.ml 1 points 2 years ago

There is a world of difference between a bash script and something like NixOS. The most important difference is that with NixOS something that you don't specify won't be there. Whereas a bash script (or other config management tools like Puppet, Chef or Ansible) only mutate things listed.

So it is very easy to write a script like:

ensure_installed python3
write_file /etc/foo.cfg 'thing = 7'
chgrp users /mnt/backups

But if you remove ensure_installed python3 it will stay installed. You can try to be very careful and always add ensure_not_installed python3 but this is both error prone and dead code as soon as you run it. I used to have a script like this and I used each of configuration management tools mentioned above and always ran into these issues. The exact error flow would be something like this:

  1. Enable/setup some service A that pulls in package X.
  2. Disable service A or remove package X because it isn't needed anymore.
  3. Write configuration for service B.
  4. Forget to add ensure_installed X but it works anyways because X is still installed from step 1.

Now you have a non-reproducible config because if you try to re-install or setup service B on a new machine it won't work because X isn't present. This may sound like a niche problem but I ran into it almost every time I tried to bring up a new machine using my config.

It is still possible to do this in NixOS as it isn't completely reproducible (you can have mutable state) but in general it is much harder because any configuration that isn't specified doesn't exist. As soon as you remove package X or service Y from your config it is removed from your system. I've been using NixOS for 8 years now and this problem is mostly gone. It is definitely more reproducible than bash scripts and it has a tangible effect on my workflow.

I wrote a blog post about it a long time ago but the core is still relevant: https://kevincox.ca/2015/12/21/service-management-with-nixos/.

load more comments (7 replies)
[–] curtismchale@lemmy.ca 0 points 2 years ago (3 children)

I've been looking at it after numerous times I update Fedora only to have some tool break that I use daily. Then I spend a chunk of the day getting Virtualbox working again so I can do my job (write code for websites).

I haven't made the jump, but it looks very interesting.

load more comments (3 replies)
[–] torafugu@kbin.social 0 points 2 years ago (1 children)

I don't get the hype. I'm staying with Arch, as Nix seems to be mainly for developers.

load more comments (1 replies)
[–] bloodfart@lemmy.ml 0 points 2 years ago

They don’t know about Debian stable.

[–] JRepin@lemmy.ml 0 points 2 years ago (1 children)

I tried it about a year ago and I don't know it did not convince me. Yeah it might be great for some niche developer oriented needs or deployment but for a normal OS usage, meh. I kind of see it as a current hype, just like crypto/NFT before, and AI now. For normal everyday usage I find openSUSE Tumblweed much more suitable and much more widely applicable.

load more comments (1 replies)
[–] hyperspace@kbin.social 0 points 2 years ago (8 children)

What about Nix's financial issues? Have they been resolved yet?

load more comments (8 replies)
[–] blackstrat@lemmy.fwgx.uk 0 points 2 years ago (1 children)

All I year about from the linux community is NixOS and btrfs, neither of which I have any interest in. It almost feels like someone with an agenda is promoting these two with how prevelant they are.

[–] 80KiloMett@discuss.tchncs.de 0 points 2 years ago (2 children)

I like using btrfs with Arch because of the snapshots. If an update breaks something I can just boot into a snapshot from grub keep using my PC and solve the problem later. It's very useful... yes... very... you should try it... come... try btrfs... it's warm and cozy... INSTALL IT!

load more comments (2 replies)
[–] joneskind@lemmy.world -1 points 2 years ago* (last edited 2 years ago)

I don’t know NixOS. My Linux machine runs Pop_OS and Manjaro.

What are the pros and cons of NixOS ?

[–] Raphael@lemmy.world -3 points 2 years ago (1 children)

They're not but nixos users are REALLY loud, as in, they can't spend a single day without talking about it.

New Arch. Both still worse than Silverblue.

[–] that_leaflet@lemmy.world 0 points 2 years ago* (last edited 2 years ago) (1 children)

Agreed, Silverblue is great. I would love a declarative system, but Nix just doesn't make it easy with its sprawling documentation and mix of new and old parts. I was trying to follow a guide for Home Manager, but couldn't use it because they were using flakes, I was still on the "old" configuration.nix style.

You can't make all things declarative either. If I can only have things 50% declarative, it kinda defeats the point.

I also still tried to use flatpaks since nix doesn't have sandboxing and is slower on updates, but its font configuration was broken.

Nix overall feels like it's requires a lot of workarounds, moreso than Silverblue.

But hey, at least if I ever want to try it out again, I just need to copy in my configuration.nix and make things work from there.

[–] PainInTheAES@lemmy.world 1 points 2 years ago

Yup, I did the same thing. I really wanted to make it work but I think it just needs some time to mature. Once it has some clean documentation and polishing it'll be really cool.

I really liked how NixOS has a hardware config repo. I have a Framework, used the config, and everything just worked. I mean it usually does on other distros too but it's nice to know that if there's a config it'll be guaranteed to work.

I'm currently really enjoying kinoite. I think it also has some documentation issues but it's also not as radically different from your average distro as NixOS..

load more comments
view more: ‹ prev next ›