Fully agree, but the given example isn't such a case but rather incorrect code.
The example is somewhat akin to writing the following Python code and expecting it to print "hello".
def main():
print 'hello'
It wouldn't work because you need to call the main function. It's not a problem of Python not addressing common use cases.I understood that an argument was needed, that error was clear and when I googled it I found the solution that I wrote.
I supposed it's meant to plug in to something bigger maybe and that's why there are arguments without import everywhere.. maybe? But I've given up now, so I'll never know, we're just gonna suck it up and keep using brew and try to make it idiot-proof somehow.
It just feels like a shame that nix is so unapproachable. It's just as much apple's fault though - if xcode has some open command line tools I'm sure there would have been ready-made formulas for everything we needed. At least I got to vent.
It's on the NixOS website, but IMO it's worth making it more visible to newcomers:
https://nixos.org/guides/nix-pills/
From my experience, it became considerably more easier to figure out or search for solutions once I've grasped the basics from "Nix Pills." Once I became comfortable enough, I also relied heavily on the Nixpkgs repository[1] as a great source of information. It has an approachable codebase and some quick grepping gave me many examples when trying to figure out how to write packages for a particular language.
> I understood that an argument was needed, that error was clear and when I googled it I found the solution that I wrote.
So in this case the advise was worst than useless? Had you been figuring things out on your own, would it have been less bad?
> It's just as much apple's fault though - if xcode has some open command line tools I'm sure there would have been ready-made formulas for everything we needed.
Yes that is too true. Keeping things working with apple is so draining it's hard to have energy left over to do other things right.
I'm about to dive headfirst into this nix business and this is intimidating, lol