Making a PR to Nixpkgs
johns.codes
johns.codes
Like the other commenter mentioned how npmlock2nix exists but it's hard to figure out that these tools exists.
Im hoping that flakes help solve alot of problems to make it easier for users to jump in. Then hopefully the documentation problem will naturally start going away as more people start using nix.
The main pain points people identified:
- Getting started with Nix is hard.
- The documentation isn't great for getting started, for getting some task done, and is spread across many places.
- Debugging bad Nix code is hard.
- Contributing back to Nix is hard.
Despite the above, I think most of the respondents had just started using Nix within the last year or two.
I think some of the Summer of Nix effort is towards improving documentation. e.g. https://discourse.nixos.org/t/summer-of-nix-documentation-st...
Python has docstrings, Java has javadoc, Hare has haredoc, Lua has emmylua... etc. Every language has SOME WAY of leaving explanation on what a function does, and what values it takes. Nix doesn't seem to have such a thing (if it does, it's a well-kept secret!).
Functions being lazy doesn't help, since that makes it very hard for tools to provide feedback without actually executing the right codepaths. And finding the definition of a function is HARD.
I'd partially blame the software as well. You can't standardise what doesn't want to follow standards. A lot of software or their developers work against the Nix model, some do so actively. The most visible example is the XDG-BD standard (https://wiki.archlinux.org/title/XDG_Base_Directory), but there are a bunch of other things like that which make packaging difficult.
I think using nix for personal projects helps build your mental model a lot more. Once you take the time to build a package manually alot of it clicks.
As a user of nixos/nix if you're not building packages it's great. Nixos is quite declarative for most settings. The main issue is just figuring out what options exist...
We not-so-smart developers tend to go for the simplest solution possible (but usually, no simpler).
I believe it's not very weird if someone says "I messed up my Arch Linux installation, and so re-installed from scratch". (Although I don't think it's common for people to re-install all the time).
Or the most ubiquitous way of deploying software from one machine to another is to build a Docker/container image. i.e. to package the built binaries of executables and libraries in such a way that they can be run portably. -- Prob'ly the most common way to build Docker images is to write a Dockerfile, which is more/less a simple sequence commands to run.
I mean.. lots of stuff involving installing/distributing/configuring packages is very hard, and conventional solutions are layers of familiar beat-things-into-shape solutions, where you don't need a deep understanding of what's going on to get things done.
Some of the implementation in Nixpkgs is complicated (like lazy fixpoint stuff), but I've also seen e.g. developers not like Nix because they don't like the idea of learning the Nix language.
The same is true of the often bashed systemd - system boot is a hard problem, it gives a correct solution over incomplete but simple ones, and thus it will be more complex. But some complexity is inherent, so we just have to deal with that. (Rust could be another example - correct manual memory management necessities some added complexity )
Think of it this way, if the commit works on its own it should remain as-is. If it's a hodgepodge of ten commits that inter-depend then they probably should be squashed.