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.
This commit is contained in:
Bryan Lai
2024-07-24 22:09:15 +08:00
parent 453402b94f
commit ee9a623f89
+9 -3
View File
@@ -44,7 +44,13 @@ let
(builtins.attrNames sharedLibDeps);
extraConfigFlags = lib.optionals (!enableNpm) [ "--without-npm" ];
self = stdenv.mkDerivation {
package = stdenv.mkDerivation (finalAttrs:
let
/** the final package fixed point, after potential overrides */
self = finalAttrs.finalPackage;
in
{
inherit pname version;
src = fetchurl {
@@ -235,5 +241,5 @@ let
};
passthru.python = python; # to ensure nodeEnv uses the same version
};
in self
});
in package