7 ms·
> Maybe that is difficult for people who haven't had an experience with pure/functional programming? I found my understanding of the Nix language became a lot
by TheYumasi 5y ago
> Maybe that is difficult for people who haven't had an experience with pure/functional programming?
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.
- ghostwriter 5y ago> 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/ https://nixos.org/ -> click "Learn" -> Scroll down -> click "Full Nix Manual": https://nixos.org/manual/nix/stable/expressions/builtins.html https://nixos.org/manual/nix/stable/expressions/builtins.htm...
- rgoulter 5y agoNix is wonderful, but absolutely is under-documented. (In part due to a small community, etc.). A couple of examples I've run into: https://github.com/NixOS/nix/issues/2259 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-writeText https://nixos.org/manual/nixpkgs/stable/#trivial-builder-wri...
- ghostwriter 5y ago> you'd have to read the nixpkgs source. https://nixos.org/manual/nixpkgs/stable/#trivial-builder-wri 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-support/trivial-builders.nix#L187-L199 https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-supp...
- HotHotLava 5y agoIt's one thing to look at the source, it's another thing to know that you have to look inside `pkgs/build-support/trivial-builders.nix` to find the documentation. One of the main advantages of reference documentation is a central place to look up what things do.
- ghostwriter 5y ago`writeScriptBin` is the second topmost link on Google search that leads directly to that file in a central repository of nixpkgs. Unique function names have the advantage of being transparent references that you can find either via google, or github search, or grep on your local checkout of nixpkgs.
- rgoulter 5y agoIn 2022, I think it's a reasonable expectation that API documentation can be accessed as rendered HTML. -- e.g. Haskell's or Rust's documentation even links to the source for the packages. 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.
- dmitriid 5y ago> Is it too much to ask from developers in 2022? 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
- darkarmani 5y ago> Is it too much to ask from developers in 2022? It's not too much to ask for non-production ready software. If nixos is supposed to be production ready, then yes.
- ghostwriter 5y ago
- kstenerud 5y agoThe other problem is the condescending replies from the higher tier nix folks while everyone else struggles. I almost think they garner a sadistic pleasure in watching everyone fail. 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.
- rgoulter 5y agoRight, it's unpleasant to see snark. 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.
- mindslight 5y agoI think the impedance mismatch is because some things are really simple, but are not documented in a way that is discoverable by someone who doesn't know, and is searching in the paradigm they do know. 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.
- all2 5y agoThis right here is enough for me to not even bother tying this OS. I'm always interested in operating systems (and the adjacent config systems that live on top of the Linux kernel, Arch Linux is one of those, Gentoo is another). But I'm not so interested in adding vitriol to my life, no matter the technical excellence. I'd rather live with a mundane kludge than deal with knowledge elitism.
- deleted 5y ago[deleted]
- jonringer117 5y agoAll builtins functions can how render doc with `:doc` in the `nix repl`. I think there's work to make this possible with any arbitrary function.