Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VS Code extension] Automate Nix NPM dependency file generation #974

Open
sir4ur0n opened this issue Dec 6, 2022 · 0 comments
Open

[VS Code extension] Automate Nix NPM dependency file generation #974

sir4ur0n opened this issue Dec 6, 2022 · 0 comments

Comments

@sir4ur0n
Copy link
Contributor

sir4ur0n commented Dec 6, 2022

Currently the VS Code extension is an NPM package, i.e. there are package[-lock].json files listing the dependencies.
As we build with Nix, we need a Nix way to convert those NPM files into Nix files.
This is currently done by node2nix.

A limitation of node2nix is that the files must be generated manually and version-controlled, meaning that:

  • updating the NPM dependencies always requires a manual step, which is easy to forget
  • NPM dependencies update automation via Dependabot opens PRs that fail CI, and require manual update to build

We originally attempted to address this problem by switching to yarn-plugin-nixify in #944 but it turns out this plugin does not seem mature enough for our use case.

There exists other solutions out there, including:

  • npmlock2nix
  • yarnpnp2nix
  • rolling out our own IFD: build a derivation that runs node2nix, stores the output Nix files, then import those files

The balance is tricky to find between:

  • automated vs manual
  • library vs hand rolling our own solution
  • popular/idiomatic vs unpopular/confusing

Each solution (node2nix, npmlock2nix, yarn-plugin-nixify, yarnpnp2nix, custom) seems to only check 2 out of the 3 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant