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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user