anchor.diff:    # Allow packages to be overriden globally via the `packageOverrides'
     # configuration option, which must be a function that takes `pkgs'
     # as an argument and returns a set of new or overriden packages.
  -  # `__overrides' is a magic attribute that causes the attributes in
  -  # its value to be added to the surrounding `rec'.  The
  -  # `packageOverrides' function is called with the *original*
  +  # The `packageOverrides' function is called with the *original*
     # (un-overriden) set of packages, allowing packageOverrides
     # attributes to refer to the original attributes (e.g. "foo =
     # ... pkgs.foo ...").
  -  # We don't want stdenv overrides in the case of cross-building, or
  -  # otherwise the basic overrided packages will not be built with the
  -  # crossStdenv adapter.
  -  overrides = (getConfig ["packageOverrides"] (pkgs: {})) pkgsOrig //
  -    (if pkgsOrig.stdenv ? overrides && crossSystem == null
  -     then pkgsOrig.stdenv.overrides else { });
  -
  -  pkgsOrig = pkgsFun { }; # the un-overriden packages, passed to packageOverrides
  -  pkgs = pkgsFun overrides; # the overriden, final packages
  +  pkgs = applyGlobalOverrides (getConfig ["packageOverrides"] (pkgs: {}));
  +
  +
  +  # Return the complete set of packages, after applying the overrides
  +  # returned by the `overrider' function (see above).
  +  applyGlobalOverrides = overrider:
  +    let
  +      # Call the overrider function.  We don't want stdenv overrides
  +      # in the case of cross-building, or otherwise the basic
  +      # overrided packages will not be built with the crossStdenv
  +      # adapter.
  +      overrides = overrider pkgsOrig //
  +        (lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) pkgsOrig.stdenv.overrides);
  +
  +      # The un-overriden packages, passed to `overrider'.
  +      pkgsOrig = pkgsFun pkgs {}; 
  +
  +      # The overriden, final packages.
  +      pkgs = pkgsFun pkgs overrides; 
  +    in pkgs;
  +
  +
  +  # The package compositions.  Yes, this isn't properly indented.
  +  pkgsFun = pkgs: __overrides:
  +    with helperFunctions;
  +    let defaultScope = pkgs // pkgs.xorg; in
  +    helperFunctions // rec {
  +
  +  # `__overrides' is a magic attribute that causes the attributes in
  +  # its value to be added to the surrounding `rec'.  We'll remove this
  +  # eventually.
  +  inherit __overrides;
   
   
     # We use `callPackage' to be able to omit function arguments that
  
positive.code:     in
        # allow both:
        # { /* the config */ } and
        # { pkgsOrig, pkgs, ... } : { /* the config */ }
        if builtins.isFunction configExpr
          then configExpr { inherit pkgs pkgsOrig; }
          else configExpr;
  
    # Return an attribute from the Nixpkgs configuration file, or
  
negative.code:   python24 = lowPrio (callPackage ../development/interpreters/python/2.4 { });
  
    python26Base = lowPrio (makeOverridable (import ../development/interpreters/python/2.6) {
      inherit (pkgs) fetchurl stdenv zlib bzip2 gdbm;
      arch = if stdenv.isDarwin then darwinArchUtility else null;
      sw_vers = if stdenv.isDarwin then darwinSwVersUtility else null;
    });
  