summary refs log tree commit diff
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2020-04-13 07:44:05 -0500
committerGitHub <noreply@github.com>2020-04-13 07:44:05 -0500
commit66e43c6588049a4cbe4e758bfde3f1994e4b917d (patch)
tree9364157e9f2db9fb0b173d72a3f6402589f3ee56
parentf6e64feb14bbc35fe1cd160f28094321c6e685fa (diff)
parent16243290e2cf5cb6f80c7699e3c37f26d114873f (diff)
downloadnixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar.gz
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar.bz2
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar.lz
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar.xz
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.tar.zst
nixpkgs-66e43c6588049a4cbe4e758bfde3f1994e4b917d.zip
Merge pull request #84599 from doronbehar/nodejs-python3
nodejs: use python3 if possible
-rw-r--r--nixos/modules/programs/npm.nix11
-rw-r--r--pkgs/development/web/nodejs/nodejs.nix6
-rw-r--r--pkgs/development/web/nodejs/v10.nix7
-rw-r--r--pkgs/development/web/nodejs/v12.nix7
-rw-r--r--pkgs/development/web/nodejs/v13.nix7
5 files changed, 27 insertions, 11 deletions
diff --git a/nixos/modules/programs/npm.nix b/nixos/modules/programs/npm.nix
index b351d80c7ac..f101a44587a 100644
--- a/nixos/modules/programs/npm.nix
+++ b/nixos/modules/programs/npm.nix
@@ -13,7 +13,14 @@ in
     programs.npm = {
       enable = mkEnableOption "<command>npm</command> global config";
 
-      npmrc = lib.mkOption {
+      package = mkOption {
+        type = types.path;
+        description = "The npm package version / flavor to use";
+        default = pkgs.nodePackages.npm;
+        example = literalExample "pkgs.nodePackages_13_x.npm";
+      };
+
+      npmrc = mkOption {
         type = lib.types.lines;
         description = ''
           The system-wide npm configuration.
@@ -40,7 +47,7 @@ in
 
     environment.variables.NPM_CONFIG_GLOBALCONFIG = "/etc/npmrc";
 
-    environment.systemPackages = [ pkgs.nodePackages.npm ];
+    environment.systemPackages = [ cfg.package ];
   };
 
 }
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 9f7a2cc9e28..5eeed80007b 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, python2, zlib, libuv, utillinux, http-parser
+{ stdenv, fetchurl, openssl, python, zlib, libuv, utillinux, http-parser
 , pkgconfig, which
 # Updater dependencies
 , writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix, runtimeShell
@@ -55,7 +55,7 @@ in
     buildInputs = optionals stdenv.isDarwin [ CoreServices ApplicationServices ]
       ++ [ zlib libuv openssl http-parser icu ];
 
-    nativeBuildInputs = [ which utillinux pkgconfig python2 ]
+    nativeBuildInputs = [ which utillinux pkgconfig python ]
       ++ optionals stdenv.isDarwin [ xcbuild ];
 
     configureFlags = let
@@ -145,5 +145,5 @@ in
       platforms = platforms.linux ++ platforms.darwin;
     };
 
-    passthru.python = python2; # to ensure nodeEnv uses the same version
+    passthru.python = python; # to ensure nodeEnv uses the same version
 }
diff --git a/pkgs/development/web/nodejs/v10.nix b/pkgs/development/web/nodejs/v10.nix
index 51ab303f77e..612cccbe877 100644
--- a/pkgs/development/web/nodejs/v10.nix
+++ b/pkgs/development/web/nodejs/v10.nix
@@ -1,7 +1,10 @@
-{ callPackage, openssl, enableNpm ? true }:
+{ callPackage, openssl, icu, python2, enableNpm ? true }:
 
 let
-  buildNodejs = callPackage ./nodejs.nix { inherit openssl; };
+  buildNodejs = callPackage ./nodejs.nix { 
+    inherit openssl icu;
+    python = python2;
+  };
 in
   buildNodejs {
     inherit enableNpm;
diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix
index 6d7f213536a..14b64094efa 100644
--- a/pkgs/development/web/nodejs/v12.nix
+++ b/pkgs/development/web/nodejs/v12.nix
@@ -1,7 +1,10 @@
-{ callPackage, openssl, icu, enableNpm ? true }:
+{ callPackage, openssl, icu, python2, enableNpm ? true }:
 
 let
-  buildNodejs = callPackage ./nodejs.nix { inherit openssl icu; };
+  buildNodejs = callPackage ./nodejs.nix { 
+    inherit openssl icu;
+    python = python2;
+  };
 in
   buildNodejs {
     inherit enableNpm;
diff --git a/pkgs/development/web/nodejs/v13.nix b/pkgs/development/web/nodejs/v13.nix
index 8676214b50b..0728e7fc70f 100644
--- a/pkgs/development/web/nodejs/v13.nix
+++ b/pkgs/development/web/nodejs/v13.nix
@@ -1,7 +1,10 @@
-{ callPackage, openssl, icu, enableNpm ? true }:
+{ callPackage, openssl, icu, python3, enableNpm ? true }:
 
 let
-  buildNodejs = callPackage ./nodejs.nix { inherit openssl icu; };
+  buildNodejs = callPackage ./nodejs.nix { 
+    inherit openssl icu;
+    python = python3;
+  };
 in
   buildNodejs {
     inherit enableNpm;