dream2nix icon indicating copy to clipboard operation
dream2nix copied to clipboard

How to choose a node version?

Open doronbehar opened this issue 3 years ago • 4 comments

I'd like to make dream2nix use a certain nodejs version - how do I do that?

Thanks

doronbehar avatar Nov 27 '22 08:11 doronbehar

Are you looking for this? https://github.com/nix-community/dream2nix/blob/a5e098038c42528bf4dff2db6cb958b1777b00e3/examples/nodejs_eslint/flake.nix#L20

DavHau avatar Nov 27 '22 12:11 DavHau

Are you looking for this?

https://github.com/nix-community/dream2nix/blob/a5e098038c42528bf4dff2db6cb958b1777b00e3/examples/nodejs_eslint/flake.nix#L20

Yes! I see now this documented in https://nix-community.github.io/dream2nix/subsystems/node.html#example and in the README.. I just didn't think what is the meaning of it and I missed it.. Perhaps this should be renamed nodejsVersion? To match the naming scheme of pythonVersion? Or at least comment something like:

diff --git i/README.md w/README.md
index 5ac2f74..5d24c11 100644
--- i/README.md
+++ w/README.md
@@ -100,6 +100,7 @@ Extensive Example `flake.nix`:
         {
           filter = project: project.translator == "package-json";
           subsystemInfo.npmArgs = "--legacy-peer-deps";
+          # nodejs major version
           subsystemInfo.nodejs = 18;
         }
       ];
diff --git i/examples/nodejs_eslint/flake.nix w/examples/nodejs_eslint/flake.nix
index a224c6a..e83272d 100644
--- i/examples/nodejs_eslint/flake.nix
+++ w/examples/nodejs_eslint/flake.nix
@@ -17,6 +17,7 @@
       settings = [
         {
           subsystemInfo.noDev = true;
+          # nodejs major version
           subsystemInfo.nodejs = 18;
         }
       ];

doronbehar avatar Nov 27 '22 12:11 doronbehar

Good point! We should rename it.

DavHau avatar Nov 27 '22 14:11 DavHau

Now that makeFlakeOutputs is legacy, what's the right way to do this?

dacevedo12 avatar Apr 25 '25 19:04 dacevedo12