summary refs log tree commit diff
path: root/pkgs/development/web/nodejs/nodejs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/web/nodejs/nodejs.nix')
-rw-r--r--pkgs/development/web/nodejs/nodejs.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 22eb772da1f9..3f0ab5ff5067 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -1,11 +1,14 @@
 { stdenv, fetchurl, openssl, python2, zlib, libuv, utillinux, http-parser
 , pkgconfig, which
+# Updater dependencies
+, writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix
+, gnupg
 , darwin ? null
 }:
 
 with stdenv.lib;
 
-{ enableNpm ? true, version, sha256, patches }:
+{ enableNpm ? true, version, sha256, patches } @args:
 
 let
 
@@ -59,6 +62,8 @@ in
 
     setupHook = ./setup-hook.sh;
 
+    pos = builtins.unsafeGetAttrPos "version" args;
+
     inherit patches;
 
     preBuild = optionalString stdenv.isDarwin ''
@@ -84,6 +89,12 @@ in
       cp -r ${concatStringsSep " " copyLibHeaders} $out/include/node
     '';
 
+    passthru.updateScript = import ./update.nix {
+      inherit writeScript coreutils gnugrep jq curl common-updater-scripts gnupg nix;
+      inherit (stdenv) lib;
+      majorVersion = with stdenv.lib; elemAt (splitString "." version) 0;
+    };
+
     meta = {
       description = "Event-driven I/O framework for the V8 JavaScript engine";
       homepage = https://nodejs.org;