anchor.diff:    }:
       let
   
  -      callPackage = pkgs.newScope {
  +      mkScope = scope: ({
           inherit fetchUrlNamespaced fetchUrlWithHeaders namespaceTokens;
  -        inherit pkgs nodePackages buildNodePackage brokenPackage;
  -        inherit extras;
  -        inherit (nodePackages) namespaces;
  -      };
  -
  -      nodePackages = joinSets (map (e: e.nodePackages) extensions) //
  -                     (import nodePackagesPath {inherit callPackage;});
  +        inherit pkgs buildNodePackage brokenPackage extras;
  +      } // scope);
  +
  +      callPackage = pkgs.newScope (mkScope nodePackages);
  +
  +      initialNodePackages = self: 
  +        let
  +          oldExtensions = joinSets (map (e: e.nodePackages) extensions);
  +          packageSet = pkgs.callPackage nodePackagesPath { 
  +            callPackage = pkgs.newScope (mkScope self);
  +          };
  +        in
  +          oldExtensions // packageSet;
  +
  +      nodePackages = makeExtensible (extends overrides initialNodePackages);
   
       in
  -    {
  -      inherit callPackage namespaceTokens pkgs node-build-tools;
  -      nodePackages = nodePackages // {inherit nodejs;};
  -      nodeLib = self args;
  -    };
  +      { inherit callPackage namespaceTokens pkgs node-build-tools;
  +        nodePackages = nodePackages // {inherit nodejs;};
  +        nodeLib = self args;
  +      });
   }
  
positive.code:   # directory for all of the package files and generate a big attribute set
    # for all of them. Re-exports the `callPackage` function and all of the
    # attribute sets, as well as the nodeLib.
    generatePackages = {
      # Path to find node packages in.
      nodePackagesPath,
      # Extensions are other node libraries which will be folded into the
      # generated one.
      extensions ? [],
      # If any additional arguments should be made available to callPackage
      # (for example for packages which require additional arguments), they
      # can be passed in here. Those packages can declare an `extras` argument
  
negative.code: } @ args:
  
  let
  
    inherit (pkgs.lib) extends makeExtensible makeOverridable;
  
    # Function to replace dots with something
    replaceDots = c: replaceChars ["."] [c];
    inherit (builtins) readDir removeAttrs length getEnv elemAt hasAttr;
  