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.
The Nix package manager got ported to OpenBSD, so that part of NixOS must be excellent.
I’m surprised, and really pleased; I was under the impression that Nix required Systemd, and was thus a Linux exclusive. Good to see
Nix (the package manager) does not depend on systemd in any capacity; just like apt, apk or Pacman do not depend on systemd.
NixOS currently uses systemd and cannot be ported without major restructuring. So far the enthusiasm to do that has been very limited. InitWare may be the path forward but that project seems to have stalled.
Note that NixOS also does not support any kernel other than Linux either.It is also available on macos
Note that, while the Nix package manager can technically run on OpenBSD to some capacity, that doesn’t mean packages in Nixpkgs are compatible with OpenBSD.
I can’t comment on the current situation from first-hand experience but I can say that there is no support guarantee as there is for Linux and macOS and that there is no binary cache either. You have to build everything yourself and I’m not even sure we can build even basic packages such as
hello
on BSDs yet.OpenBSD has no intention of trying to use Nix packages, my point was that the Nix package manager has useful enough features and functonality that it was ported to OpenBSD to use for managing OpenBSD software and packages.
That’s what porting does, it’s making a program fully functional on a different operating system or different hardware architecture. Compatibility serves a different purpose from porting.
my point was that the Nix package manager has useful enough features and functonality that it was ported to OpenBSD to use for managing OpenBSD software and packages.
My point was that support for BSDs in Nixpkgs (which is the de-facto “standard library”) is still in its infancy. Nix without Nixpkgs is like C without a libc.
That’s what porting does, it’s making a program fully functional on a different operating system or different hardware architecture. Compatibility serves a different purpose from porting.
Terminology on this is a bit loosely defined. What I meant was that the packages in Nixpkgs largely haven’t been “ported” to BSDs yet.
Many of the packages might already be “ported” and would work if other packages lower down in the tree worked. In Nixpkgs we don’t really differentiate between fixing packages so that the package works as upstream intends or making something work that was never intended to work.
There is zero interest in Nix pkgs, that’s all Linux stuff. Every and all Linux packages is incompatable with BSD, and there is no way to make Linux packages ever compatable with BSD.
To port Nix package manager to BSD they change the source code to run on BSD libraries, look for BSD compiled programs, and how run on BSD dependancies, interacting with a BSD kernel.
Installing Nixpkgs on BSD is the same as talking about making Mac OS programs run on Linux, that’s physically impossible.
OpenBSD is not trying to run the whole Nix distribution, they only tool the Nix package manager and changed the source code of the Nix package manager but removing all referances to Nix and Linux, changed the code to run on BSD libraries and changed the Nix package manager source code to look for BSD format files.
Nix package manager on OpenBSD has no knowledge and no understanding of Linux or NixOS files.
I may not have been precise enough here with the wording.
To clarify: Nixpkgs is a source distribution. You can see all of it here: https://github.com/NixOS/nixpkgs
From Nixpkgs, Hydra builds binary artifacts which then get distributed through the binary cache (cache.nixos.org). Users usually use binaries substituted by the cache but these binary artifacts are a direct result of the source, a small set of parameters (mainly platform), some time and some energy, so we usually rarely talk about them. They’re not interesting to us; we could reproduce them at any time by just building again.What I’m talking about all happens at the “source” level, not the binary level. You obviously can’t take a Linux binary to a BSD and expect it to run but you can take a package definition initially made for Linux, try to build it on a BSD and run the result of that.
From experience with Darwin, this works in the majority of cases and usually only requires very few adjustments to the build recipe. With Nix, we have a full expression language at our hands, so we are able to to things like optionally adding some dependencies depending on the platform. We usually do not maintain separate build recipes for separate platforms; they usually use the same build definitions with different parameters.OpenBSD is not trying to run the whole Nix distribution, they only tool the Nix package manager
What do you mean by this? OpenBSD “forking” Nix (a la Guix) would be news to me. Do you have some links for me?
Nix package manager on OpenBSD has no knowledge and no understanding of Linux or NixOS files.
The Nix package manager has no knowledge or understanding of “Linux or NixOS files” on any platform, including Linux/NixOS.
Its purpose is to know how to evaluate and realise Nix expressions.
I can evaluate a Nix expression for OpenBSD on my macOS machine. Nix doesn’t care.
(Obviously I can’t build it but I could theoretically cross-compile it, if support for that was to be wired up in Nixpkgs.)I think you’re misunderstanding a bit how Nix and Nixpkgs work with different platforms.
In the OpenBSD ports and packages tree for user installation here
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.
Yeah if your knew to nix its even hard to figure out how to install a simple package.
The Arch wiki is pretty distro-agnostic (barring package names and
pacman
specific stuff). I’ve been distro-hopping for past decade and I’ve always used it as a reference for setting things up.I think NixOS needs an approachable installer or config builder
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.enable
and 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.extraConfig
option 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.package
tells 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.enable
which 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.gamescopeSession
does 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.gamescopeSession
is 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.
You’re underrepresenting the complications of NixOS and overrepresenting the complications of Arch. For example, to install Steam I would run
sudo pacman -Syu steam
. On a typical Arch setup that’s all that’s needed.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.
And that’s why the Arch wiki is so great - it has details and links about everything that goes into making something work. If you want to learn more or if something goes wrong it’s all right there.
But yes, I think you hit the nail on the head at the end there - hackability is Arch’s strength, everything is exposed and flexible to tinkering. It’s easy to make almost anything work, and easy to learn how it works. That’s very different from NixOS’s core philosophy of stability and reproducibility.
There are inherent pros and cons to both approaches - it really comes down to a mix of personal preference and using the right tool for the right job. They’re apples and oranges, and the article framing NixOS as a superior successor to Arch is as silly as the reverse would be.
For example, to install Steam I would run
sudo pacman -Syu steam
. On a typical Arch setup that’s all that’s needed.That is incorrect to my knowledge. Back when I used Arch, you still needed to enable multilib which I don’t think has changed. You need a wiki entry to tell you how to do that.
AFAIK you also need to manually install yourself a Vulkan driver. I’ve recently helped a person who had opted for AMDVLK here and it broke in one game but was working fine in others.
That sort of thing doesn’t really happen with NixOS because enabling desktop support implies the presence of a Vulkan driver and we provide a sane one by default (currently RADV via mesa or nvidia when you enable proprietary drivers).
I use Nix btw.
That font is fucking horrible and so small… I had to make it 160%…
😄 🤣 😂
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.
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 withhello
andcoreutils
in 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
hello
andcoreutils
”. 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 pointhello
will 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 fromautoremove
and 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.
Each version of a library (or any package) will only exist once, and things are garbage collected when not referenced.
Tbh i would not mind the extra bloat if it meant i get stability.
Is it just me or do large portions of this article feel AI-generated?
Not sure, but either way the article is crap.
The fake excitement sounds like a YouTube influencer acting, but maybe it’s AI. Either way it’s crap.
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.
Wtf no one told me yall had moved here already
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
This article reminded me of how I haven’t run in a single dependency version conflict for years, I’m starting to get what debian users feel like seeing all this new distros fixing problems they never had in the first place
You can thank Flatpak for that. Dependency hell is real, especially on Debian, which ships old libraries. If you stick to default repos, you’re unlikely to directly run into dependency issues, but once you install a program manually or from another repo, it’s another story.
One example you may not have noticed, but which is a direct consequence of dependency hell, and a serious security issue, is for Firefox on Debian 11: it took around 6 months after it was EOL for Debian to update Firefox ESR. Twice (in other words, every single Firefox update on Debian 11).
There were similar issues for Chromium.
Source: https://www.phoronix.com/news/Web-Browser-Packages-Debian (same thing happened the year after, at least for Firefox, I don’t know about Chromium).
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.
That’s the main crux with NixOS, it does a lot of stuff in the background for you that in my opinion you should know why it’s being done the way it is. As such I consider Arch a good distro for a beginner who wants to learn the inner workings of Linux, while NixOS is a better-engineered distribution that takes care of the system for you. Arch’s goal is to be simple for the maintainers which means it’s very close to what one might consider a “standard Linux”, and its wiki is mostly a documentation of exactly that.
Nix and Common Lisp seem to sit in the same space – it’s spoken of extremely fondly but has difficulty escaping the lab. For some reason it’s extremely technically capable, but fails to find widespread adoption.
Add Guix to this.
Removed by mod