this post was submitted on 13 Jan 2025
355 points (94.3% liked)
Linux
49004 readers
797 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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
is nixos considered immutable or mutable? kind of has characteristics of both.
I'd argue it's closer to a mutable distro than an immutable one.
Nixos tends to lean on the term reproducible instead of immutable, because you can have settings (e.g files in /etc & ~/.config) changed outside of nix's purview, it just won't be reproducible and may be overwritten by nix.
You can build an 'immutable' environment on nix, but rather than storing changes as transactions like rpm-ostree, it'll modify path in /nix/store and symlink it. Sure, you can store the internal representation of those changes in a git repo, but that is not the same thing as the changes themselves; if the nixpkgs implementation of a config option changes, the translation on your machine does too.
Interesting. If possible, could you more explicitly draw comparisons on how this isn't quite the same over on say Fedora Atomic? Like, sure changes of
/etc
are (at least by default) being kept track of. But you indeed can change it.libostree
doesn't even care what you do in your home folder. Thus, changes to e.g.~/.config
(and everything else in/var
^[1]^) are kept nowhere else by default./opt
are actually found here as well.~/.config is probably a poor comparison on my part; it's management is actually done by home-manager rather than Nixos proper, and I can't think of another OS that fills this same role.
Nixos generates (for example) /etc/systemd/network to a path in /nix/store and symlinks it to it's appropriate locations. After the files are generated the appropriate /nix/store paths are (re-mounted? Over-mounted? I'm not sure the implementation) made read-only (by default), but anything that isn't generated is absolutely both mutable and untracked, and that "not tracking everything in /etc" is more what I'm going on about.
If you use Nixos as intended (when you find that a package is lacking a config option you want, create your own nix option internally) the distro is effectively immutable, but if you use Nixos for anything moderately complex that changes frequently e.g. a desktop os, you eventually run into the choice: become competent enough to basically be a nixpkgs contributor, or abandon absolute immutability.
I think the first option is worth it, and did go down that route, but it is unreasonable to expect the average Linux consumer to do so, and so something like fedora atomic is going to remain more "immutable" for them than nixos.
This need to git gud is thankfully lessening with every commit to nixpkgs, and most people can already get to most places without writing their own set of nix options or learning how to parse //random markup language// into nix, but you'll eventually run into the barrier.
nixos and guix are immutable and two of the only immutable distros I like
The store is immutable but the system itself definitely isn't.
Packages in nix are in the store directory, each package in a dir named after the package hash. So you can have 15 versions of firefox installed, for instance, and the different versions go in different folders with different hashnames.
When it's time to set up a user env, their specific version of firefox is (conceptually) symlinked into the users profile. When that user executes firefox it gets one out of the 15 versions. Another user may get a different one.
Anyway, the package store is off limits to users, and a real bad idea to modify for root too.
That's not what sandboxed means and Nix isn't sandboxed.
Sandboxed means it runs in a separate container, often with limited permissions; raising security at the cost of performance.
What namespace are you talking about?