this post was submitted on 13 Jan 2025
360 points (94.3% liked)

Linux

49007 readers
841 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
 

I recently took up Bazzite from mint and I love it! After using it for a few days I found out it was an immutable distro, after looking into what that is I thought it was a great idea. I love the idea of getting a fresh image for every update, I think for businesses/ less tech savvy people it adds another layer of protection from self harm because you can't mess with the root without extra steps.

For anyone who isn't familiar with immutable distros I attached a picture of mutable vs immutable, I don't want to describe it because I am still learning.

My question is: what does the community think of it?

Do the downsides outweigh the benefits or vice versa?

Could this help Linux reach more mainstream audiences?

Any other input would be appreciated!

you are viewing a single comment's thread
view the rest of the comments
[–] ivn@jlai.lu -1 points 1 day ago (3 children)

I wouldn't call NixOS immutable.

[–] Chewy7324@discuss.tchncs.de 10 points 1 day ago* (last edited 1 day ago) (1 children)

NixOS is immutable and atomic, but it isn't image-based.

Immutable simply refers to how the running system configuration can't be changed by simply putting a file somewhere (e.g. copy a binary to /bin, which is a bad idea).

For example, Fedora Atomic and derivatives are image based, although they are more flexible than the A/B types like SteamOS.

OpenSUSE MicroOS uses btrfs snapshots to apply updates atomically, and is more flexible than most image based immutable distros.

Edit: But I don't think those terms have a single definition, so how would you differentiate these terms?

[–] ivn@jlai.lu 4 points 1 day ago (3 children)

I'm on NixOS right now and just dropped a Chewy in my /bin, only had to sudo touch /bin/chewy.

[–] prole@lemmy.blahaj.zone 3 points 1 day ago

As someone who hasn't looking into nixOS much, I feel like I had a stroke reading your comment lol

[–] Chewy7324@discuss.tchncs.de 3 points 1 day ago

Good point. I'll have to stop using immutable and stay with atomic (and declarative).

Interestingly /bin and /usr/bin are not in PATH by default, so /bin/chewy can only be executed by its path directly and won't affect the systems reliability.

[–] priapus@sh.itjust.works 2 points 1 day ago (1 children)

That doesn't make it not immutable. /bin is not a critical directory in NixOS, only the contents of /nix are, which are immutable. /bin isn't even part of your path by default.

[–] ivn@jlai.lu 2 points 1 day ago (1 children)

Well that was an approximation to keep it simple and disprove the given example. There are other directories in the root filesystem that are in the path by default, or used in some other critical way (like /etc). Even if they are links to directories in the nix store you can replace the link.

[–] priapus@sh.itjust.works 1 points 1 day ago* (last edited 1 day ago)

I understand, but it didn't really disprove anything. Immutable distro's protect core components from being modified. /bin is hardly relevant on NixOS, so of course it wouldn't be made immutable.

/etc is also generally not considered a core component, and every immutable distro I've used left it writable. By default, every binary installed through NixOS is put in /run/current-system/sw/bin, which is immutable. Many other important files are also linked to /run/current-system, which is why the whole directory is immutable. It essentially takes the place of what the root directories would be on an FHS distro.

I don't know any other path used in critical ways that is not immutable. The primary paths that immutablility is relevant for in FHS distros are /usr, /lib, /lib64, and /bin. None of these paths are really used on NixOS, besides some files symlinked there for edge cases, like /bin/sh.

If you were to remove all the symlinks you are able to, the system would still work for the most part. You would lose custom configurations in /etc, but that is true for most immutable distros. Most apps have a default configuration to fallback to.

The misunderstanding comes from the fact that immutable is a poor description for any OS, which is why many now use atomic instead. Even in immutable distros, many files can still be modified, and things can still be broken if you try hard enough. Still, NixOS definitely falls under the general description of and immutable distro, as the core of the OS is immutable.

[–] zwerdlds@lemmy.ml 2 points 1 day ago (1 children)

It can be made to be by pinning various things which are not by default.

[–] ivn@jlai.lu 1 points 1 day ago* (last edited 1 day ago) (1 children)
[–] zwerdlds@lemmy.ml 1 points 1 day ago (1 children)

At the surface, you can pin the commit you pull packages from, but if you want to go deeper, you can essentially define your own channel and dependent binaries, allowing you to store every aspect of how a generation is built.

[–] ivn@jlai.lu 1 points 1 day ago (1 children)

Yes, or use flakes which gives you a lockfile pinning everything. But this is related to reproducibility, not immutability.

[–] zwerdlds@lemmy.ml 1 points 1 day ago (1 children)

If you control everything in the build it is, and every generation is immutable.

[–] ivn@jlai.lu 1 points 1 day ago (1 children)

Isn't immutability related to the root filesystem being read-only? I can write on my root filesystem, even if it's mostly links to the store I can replace those links.

[–] zwerdlds@lemmy.ml 1 points 1 day ago (1 children)

I guess that's true, tbh the reproducibility aspect is really what I like about nix, and I guess I'm confusing a bit here. I guess I'm saying nix gives a good compromise with immutable generations and high repro, but you've convinced me it's not immutable per-se.

[–] ivn@jlai.lu 1 points 1 day ago

Well in the end I think I'm needlessly nitpicking. It doesn't matter if it's strictly immutable or not. What matter is that it has the good parts of reproducibility, immutability and declarativity.

[–] jamesbunagna@discuss.online 2 points 1 day ago (1 children)

In your opinion, when can we refer to a distro as being immutable? How do you regard the likes of Fedora Atomic, openSUSE Aeon or Vanilla OS? Are any of these immutable in your opinion?

[–] ivn@jlai.lu 3 points 1 day ago

To be honest I don't know these very well. I only use NixOS. My understanding is that in an immutable distribution the root filesystem is read-only. Granted in NixOS the nix store is immutable and most things in the root filesystem are just links to the nix store, but the root filesystem itself is not read-only.