by TheYumasi · 4y ago · 0 comments
I found my understanding of the Nix language became a lot better once I started learning some Haskell. Specifically once I understood what currying was about.
My real gripe with Nix is the lack of a complete, easy to find, documentation of its "standard library". Nix Pills & a few wiki pages are far from enough.
How hard have you tried? It's literally two clicks and one scroll away from the official home page: https://nixos.org/ -> click "Learn" -> Scroll down -> click "Full Nix Manual":
https://nixos.org/manual/nix/stable/expressions/builtins.htm...
After months of "It's obviously this" and "you're not even trying" and "have you even looked?" and "there are plenty of examples out there already" and "you should start out by reading the introduction docs" and "you obviously don't know how functional languages work", I just stopped bothering.
I was trying to figure out how to install new machines from a central build host. Neither the straightforward install CD process, nor system.build.qcow2 made sense. I popped into the IRC channel to ask, and it turns out a 'nix build' 'nix copy', 'nix-env --store --set' and 'switch-to-configuration boot' did the trick. That's an extreme amount of power and simplicity that just kind of obviates a whole set of heavyweight processes (eg Debian automated-install). But if you are searching around for the usual type of automated install process, you just come up empty handed looking for it.
I'm still a long ways from understanding everything Nix/NixOS completely, but I've never gotten these kinds of comments apart from the extremely reasonable "you should start out by reading the introduction docs" - that the directions lead with.
And if you have a problem with that, I can see how you might have provoked that kind of response that seems so out of character to me.
I ask questions when I have them, and sometimes I get answers from them, and sometimes I answer them myself.
But I started off reading as much of the docs as I could tolerate before and while getting started, and always trying to self-help before asking for help.
I actually tried to help for awhile, and even started a help guide https://github.com/kstenerud/nixos-beginners-handbook/
But eventually one gets ground down and demoralized enough to just give up. It's a real shame, because I LOVE what NixOS is trying to accomplish.
I hope my original comment doesn't read that way. I mean more "the Nix language isn't much different from something you're familiar with".
> "you should start out by reading the introduction docs"
This one I kinda buy, though.
With programming, with many things, you can get quite far without having to understand all the details. And many tools do quite well by being intuitive to use.
Nix is quite weird. And can be quite difficult. And it's got a small community, so it's under-documented and you won't always be able to find someone who's run into the same problem with a good explanation as to how to fix it.
But I would put up with a lot, if the payoff is more knowledge.
You may not like the reply, but the fact remains: the comment I replied to was a lie. It says there's hardly anything but Wiki pages and Nix Pills and that there's no "easy to find, documentation of its "standard library". And the exact document has been two clicks away from them for a long time.
> I just stopped bothering.
Another problem is your impatience and inability to perform searching and research for necessary information without anyone's help. The lack of focus and motivation to spend a little extra time to discover, learn, and build an intuition around a new toolchain is on you. How much time have you spent on useless media content on youtube or netflix lately instead having another try with the tool?
A couple of examples I've run into:
https://github.com/NixOS/nix/issues/2259 showed people trying to make use of the "hello world" package which was given in the NixPkgs manual, but couldn't quite figure out how to get it to build.
e.g. if you want a package that's a simple script, "writeScriptBin" seems like what you'd want. -- But it's really not clear how to use it from the manual; you'd have to read the nixpkgs source. https://nixos.org/manual/nixpkgs/stable/#trivial-builder-wri...
Is it too much to ask from developers in 2022? At source, the function is well documented and is provided with an example [1]. The only missing part is a rendered HTML with the same information.
[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-supp...
On the other hand, I think it's fair to say NixOS will sometimes require a high level of involvement from its users. When something goes wrong on another OS, it's easy to search for the answer. With NixOS, you have to understand both the Linux part, and the NixOS part.
In 2022 it's not too much to ask from the developers of the tools to provide:
- consistent and up-to-date documentation (that's built and updated together with the source code)
- consistent, readable and understandable error messages
It's not too much to ask for non-production ready software. If nixos is supposed to be production ready, then yes.