- cross-posted to:
- operating_systems@beehaw.org
- nixos@infosec.pub
- cross-posted to:
- operating_systems@beehaw.org
- nixos@infosec.pub
NixOS needs what is IMO the killer feature of Arch: the wiki.
Comprehensive documentation on not only the OS but the additional packages that we use is what drew me to Arch, and the thing that makes me swear in frustration whenever I have to use Ubuntu/Debian.
NixOS is an excellent OS that has the promise of being every bit as hackable as Arch, but far more stable. Problem is, configuration is very different and needs extensive documentation to reduce that friction point.
Yeah true, whenever I have problems with some packages like Wayland and its alternative Xorg tools or games, its Arch wiki that helps extremely to fix or understand the situation. Its like many experiences are combined and written in a simple language everyone can easily understand.
On Ubuntu for example, everything feels like its hardcoded, not the standard and its just not even documented. And the wiki has minimal info about the packages.
These are pretty good points.
NixOS needs what is IMO the killer feature of Arch: the wiki.
NixOS has a killer feature which obviates a wiki for most such purposes: NixOS options. They document themselves!
You don’t need to look up a wiki on how to install and enable i.e. paperless and all the other services it depends on, you simply set
services.paperless.enableand NixOS configures everything for you internally.The option tells you roughly what it does internally and the other options provide pointers for things you might want to tweak about it. The
services.paperless.extraConfigoption for example tells you how to configure it (pointing to upstream documentation in this case) and even gives an example on what you might want to do.Another example is how to install Steam. In Arch, the wiki must tell you all the manual steps required to enable multilib, install the steam package, install 32bit dependencies, yada yada.
In NixOS, you simply set
programs.steam.enable = true;. Off to your games.
You wanna customise the Steam package to add additional flags, pass env vars or add additional packages your weird Linux-native indie game needs?programs.steam.packagetells you how to do that right in the place where you do it.
While you’re looking forsteam, you might also come acrosshardware.steam-hardware.enablewhich you need to set in order to make your Valve Index and Steam Controller work properly.
You wanna start Steam in a gamescope session right from the display-manager?programs.steam.gamescopeSessiondoes it for you. No need to copy paste some snippet that you’ll instantly forget about and maybe breaks in a few months.programs.steam.gamescopeSessionis maintained upstream by NixOS, so if it breaks, someone will go and fix that and nobody needs to adjust any of their copy-pasta because they’ll just update as they always do and it just starts working again.None of this is perfect yet and the quality of documentation of NixOS options really varies but I think you get the idea here. I already rarely look at the NixOS wiki to configure my system because the system configuration tells me what I need to do already and this will only get better as options get refined.
the promise of being every bit as hackable as Arch
I don’t think it makes that promise and I don’t think it’s true.
NixOS is about doing things “properly”; applying software engineering to software environment management.
Whipping up a quick hack is much more complicated and time intensive on NixOS than doing so on Arch because it’s way more abstract. You can’t just quickly replace some binary with your own compiled one, you need to use NixOS’ systems to wire in the binary and build it with Nix to begin with.
Maintaining a system (even one with terrible hacks) is much simpler in NixOS however.
Having options is not the same thing as documenting those options; well outlined documentation doesn’t just dictate how to do something but also points out what you may want to do i.e. filling out unknown-unknowns.
Just because NixOS makes for an excellent DevOps template doesn’t mean it can’t also be an excellent platform for hacking together random crap. I understand that NixOS advertises itself as the former, but when I say “promises to be” I don’t mean “makes a promise to be”, but “has promise for being”.
Features like: a common configuration interface, safe rollback, atomic changes, nixos-hardware all are features that enable developers to safely hack together solutions, and then have an excellent log detailing what they just did.
Having options is not the same thing as documenting those options; well outlined documentation doesn’t just dictate how to do something but also points out what you may want to do i.e. filling out unknown-unknowns.
Agreed. The point is however that, with NixOS options, you do not necessarily need such documentation for unknown-knowns.
With many things however, we can simply delegate to the upstream documentation for some thing. See i.e. the paperless extra config example. We don’t need to tell users how to configure their paperless, we just tell them that any upstream option goes into this settings option as an attrset.
NixOS options do to a degree fill out unknown-unknowns though, see I.e. the steam-hardware example. I’ve stumbled upon many handy options by searching for related options.
Just because NixOS makes for an excellent DevOps template doesn’t mean it can’t also be an excellent platform for hacking together random crap.
While the initial “hacking the crap together” phase is indeed harder in most cases, maintaining these hacks is much simpler thanks to overrides/overlays and the additive nature of NixOS options.
That quality can arguably make it “excellent” too.
Fun fact: I use NixOS since six years now and at least in the first two years the Arch Wiki helped me a lot to understand the NixOS configuration options.
I use Nix btw.
I use Arch btw.
I use Nix btw
Does nix have access to the AUR?
There is a part of me that wants to try this, but I have one question.
I believe this distribution allows you to have multiple versions of the same library to work with different programs at the same time, correct? Does this mean that each program downloads all its dependencies independently? If the answer is yes, I am staying with Arch. Too much bloat.
Yeah. I feel the same way. I remember NPM (nodejs) had this exact issue and you would end up having so many duplicate packages.
Not exactly. If one package needs foo as a dependency, and another package also needs foo, it won’t download a second copy.
But if another package needs, say, an older version of foo, it can download the older version of foo and you’ll have two foo packages.
This is possible because Nix packages have hashes to differentiate between them, so any package can ask for the exact version of foo it needs instead of asking for foo in general and hoping the version it gets isn’t incompatible.
Pretty sure this is also different from other containerized package managers, like Flatpaks or Snaps, which I believe throw all the dependencies in with their packages so each package has exactly what it needs in its container, and which is obviously going to be much more bloated than having shared dependencies. As far as I know Nix on the other hand doesn’t get any more bloated than other distros (keep in mind that regular distros like Arch will still sometimes have multiple versions of a package, for example Python).
Each version of a library (or any package) will only exist once, and things are garbage collected when not referenced.
this distribution allows you to have multiple versions of the same library to work with different programs at the same time, correct?
That is correct. You can even have programs from entirely different releases running on the same system without conflicting with another; one with i.e. glibc 3.34 and one with 3.37 for example. Or even wilder setups with some packages using musl, other glibc and others yet being built statically.
Does this mean that each program downloads all its dependencies independently?
Each program references all of its (exact) dependencies. Nix then looks at the program and its references and builds a tree of dependencies.
Then it tries to “realise” these dependencies (make them, well, real), possibly by substituting (downloading) them from a binary cache or automatically building them on your machine if they’re not available in any configured cache.However, if some package with the same exact version already exists in the Nix store, no action will be taken. Why should it, it’s already there.
For example, if you were in an empty world and built an environment withhelloandcoreutilsin it, they’d both depend onglibc. If both came from the same revision of Nixpkgs, chances are that they depend on the exact same version of glibc.
What Nix would do here is fetch 1x glibc, 1x hello and 1x coreutils.Note however that you don’t need to manage any of this. You just say “I want
helloandcoreutils”. Nix takes care of getting the correct dependencies in place but they won’t be in your immediate environment. When you then say that your environment should no longer containhello, it does that. At this pointhellowill still exist in the Nix store but it won’t be in your PATH any longer, so it’s not polluting any shared state; it just sits there on disk and the worst it could do is waste disk space. It’s not “installed” in the same sense as what it’d mean to have an unused dependencies installed on an FHS system.
In order to reclaim disk space from unused Nix store paths, you can simply run a garbage collection. You don’t need to care about that one specific hello store path here though, you just say “remove all unused store paths for me, thanks” and Nix removes it along with all other unnecessary paths. In NixOS, you can even have that ran periodically for you.
(Note that this is distinct fromautoremoveand the like; those “clean up” the shared state and free up disk space. In NixOS, these are separate processes and dependencies which you don’t explicitly declare are never in the shared state to begin with.)You see, while this could be seen as “bloat”, it has none of the negative consequences bloat has on other systems such as more packages for you to manually manage, more binaries in your PATH or weird interactions of other programs. It’s just easily managed disk space and disk space is honestly quite cheap.
I believe shared dependencies are not duplicated.
Wtf no one told me yall had moved here already
That font is fucking horrible and so small… I had to make it 160%…
Tiny font and anime GIFs. WTF
😄 🤣 😂
I think Nix is a really cool distro but the whole config things is really hard to learn, I wish there documentation was easier to understand as a nix noobie. I’ve used arch and many rolling release but nix configs are hard to learn. I really want to learn how to use nix, if anyone has any good sources for learning configs, id be much obliged
Try this: https://zero-to-nix.com/
Thanks!
Thank you because the configs are one of my biggest hurdles as well
Tried Guix (Yeah not Nix, but similar principles), didn’t really like it and came back to Parabola.
Nix has just been removed from the university computers here. They admit it’s nice, but the new (smaller) team just doesn’t have the time to create the packages themselves. That’s the flip side.
On a side-note - what an awesome website.
Removed by mod











