Open
Conversation
Contributor
Author
|
I figured out now that most of the custom patches are not necessary if you just overlay the default nodejs package: overlays = [ (self: prevPkgs: {
nodejs = prevPkgs.nodejs-16_x;
}) ]So if we can add an overlay in an extra file that would be the the simplest solution 🤔 |
r17x
reviewed
Nov 21, 2022
Comment on lines
+23
to
+30
| # Yarn | ||
| (pkgs.yarn.override { | ||
| nodejs = cfg.package; | ||
| }) | ||
|
|
||
| # Pnpm | ||
| (pkgs.nodePackages.pnpm.override { | ||
| nodejs = cfg.package; # sadly doesn't suffice, but I found this: |
There was a problem hiding this comment.
I think it could be like this:
- override nodejs pkg in
pkgs.nodePackages
let nodePackages = pkgs.nodePackages.override {
nodejs = cfg.package
};- define packages
devshell.packages = [
cfg.package
nodePackages.yarn
nodePackages.pnpm
]
Contributor
Author
There was a problem hiding this comment.
I think I tried this, but don't remember.
I figured that the overlay is much better and will then cover everything dependant on nodejs (e.g. yarn toplevel)
But I don't know how to do that in a devshell extra, do you?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm new to nix but managed to throw together
what I needed to have consistent nodejs version for:
Usage:
I think in the end it might be better or more DRY to use something like:
https://github.com/cprussin/nixjs
But it's a bit outdated and I did not figure out how to define overlays in an extra file. 😢
(I still would love to know)