Hello.
I’m going to try and learn Rescript, and step one of learning a language is getting the LSP working.
I can’t install it from the nodePackages package set because it doesn’t exist.
I am trying to package it as a flake so that I can use it in my directory where I’m going to build a toy frontend with Rescript (as a learning exercise).
I’m having a hard time because the language server project’s directory structure has several package.json files in it.
This is my repository: github.
In the README I described the issues I was having and what I’m trying to do.
There is a ‘postinstall’ script in the top-level package.json of the rescript language server repository that is running a script that assumes that npm install
for directories that consumers of the LSP don’t seem to need, like the tools
directory, will succeed.
In my flake, I have tried to tell NPM to not do the ‘postinstall’ script and instead let me handle building the parts that need building in the buildPhase
. I have tried setting the dontNpmInstall
and dontNpmBuild
flags for the top-level package to true
, and I’ve tried writing dummy installPhase
s that just echo a string in the bash shell. Even though I did that, running $ nix build
prints an error message, and when I look at the log in the nix store, I see that it has failed because it’s still trying to run this ‘postinstall’ package.json script.
I like Flakes and if possible I wanted to package this as a flake so that Nix users could easily use it in project-level flakes like the one that I am trying to make, but I also understand that contributing to the nodePackages
package set may be the correct thing to do.
I’ve only ever made one Nix ‘package’ in my life, and that builds Neovim for me and installs my plugins repo. I was fortunate there in that I didn’t need to do anything with Javascript dependencies.
I’m hoping for some advice about which direction I should take to try and package this Rescript language server.