Skip to content

Commit ee9a623

Browse files
committed
nodejs: use .finalPackage for ease of overriding
Previously, the nodejs `passthru.pkgs` attribute refers to the package fixed point derived in the current context, without considering potential overrides to the main nodejs package. This is fixed here with the `.finalPackage` attribute, which refers to the final package fixed point, after potential overrides. For example, previously, after overriding nodejs with `nodejs.override`, `nodejs.pkgs` would still refer to the original package, instead of the overridden one. After this fix, `nodejs.pkgs` would be correctly based on the overridden `nodejs` package.
1 parent 453402b commit ee9a623

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

pkgs/development/web/nodejs/nodejs.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ let
4444
(builtins.attrNames sharedLibDeps);
4545

4646
extraConfigFlags = lib.optionals (!enableNpm) [ "--without-npm" ];
47-
self = stdenv.mkDerivation {
47+
48+
package = stdenv.mkDerivation (finalAttrs:
49+
let
50+
/** the final package fixed point, after potential overrides */
51+
self = finalAttrs.finalPackage;
52+
in
53+
{
4854
inherit pname version;
4955

5056
src = fetchurl {
@@ -235,5 +241,5 @@ let
235241
};
236242

237243
passthru.python = python; # to ensure nodeEnv uses the same version
238-
};
239-
in self
244+
});
245+
in package

0 commit comments

Comments
 (0)