Adding rescript package to nodePackages locally

First off, I really appreciate the well-thought-out response and the code examples. Thank you for taking the time to break it down for me!

Overlays don’t magically create or install packages; that you still need to do yourself.

Yep! I realized I was on the wrong track a little while after posting, that said I didn’t realize how much work it would actually take to get rescript up and running!

What you also fail to realize is that nix is lazy. Just because you created that attribute doesn’t mean nix will use it, or even build whatever you define.

Correct! I’ve read it, I just need to remember it. :slight_smile:

I realize this is all a lot to take in, but I hope it helps - ask away if you need more help! On the up side, once you grok all this there’s not much else to learn about nix.

Overall, I’d suggest learning how to do this with something more straightforward than npm packages. It’s not the easiest thing to understand, and the complexities of thousands of dependencies will just make it harder.

That’s finally starting to sink in for me. Since I’ve already committed to NixOS, it looks like the best course of action is going to be falling back to buildFHSUserEnv and chipping away at a “pure” nix experience in parallel in such a way that it doesn’t block dev activities.

This post gives me a lot to draw from and should keep me busy for a while. I’ve been hedging on actually reading the Nixpkgs manual, but it sounds like this, along with the other links you’ve provided, will be the next step(s)!

One more question for you or anyone who has a good answer. Are there any secrets for debugging and code completion in nix? Or is the answer some combination of “use the repl”, “RTFM”, search GH, etc.? For instance, you mentioned above using legacyPackages, which I went to look up in the Nixpkgs manual but couldn’t find, but did manage to find this thread here in the forum. You also linked to the overlays option, which is super useful to look over, but would be a needle-in-a-haystack for me to find had you not linked it! Honestly, even if the answer is something like: Ctrl-F in the Nixpkgs manual followed by a GH search of usage, that would at least let me know I’m not missing out on a better approach!