anchor.diff:        in
           # The derivation along with its outputs, which we recur
           # on to splice them together.
  -        if lib.isDerivation defaultValue then augmentedValue
  -          // splicer (tryGetOutputs buildValue) (getOutputs runValue)
  +        if lib.isDerivation defaultValue then augmentedValue // splicer
  +          (tryGetOutputs valueBuildBuild) (tryGetOutputs valueBuildHost) (tryGetOutputs valueBuildTarget)
  +          (tryGetOutputs valueHostHost) (getOutputs valueHostTarget)
  +          (tryGetOutputs valueTargetTarget)
           # Just recur on plain attrsets
  -        else if lib.isAttrs defaultValue then splicer buildValue runValue
  +        else if lib.isAttrs defaultValue then splicer
  +          valueBuildBuild valueBuildHost valueBuildTarget
  +          {} valueHostTarget
  +          valueTargetTarget
           # Don't be fancy about non-derivations. But we could have used used
           # `__functor__` for functions instead.
           else defaultValue;
  
positive.code: lib: pkgs: actuallySplice:
  
  let
    defaultBuildScope = pkgs.buildPackages // pkgs.buildPackages.xorg;
    # TODO(@Ericson2314): we shouldn't preclude run-time fetching by removing
    # these attributes. We should have a more general solution for selecting
    # whether `nativeDrv` or `crossDrv` is the default in `defaultScope`.
    pkgsWithoutFetchers = lib.filterAttrs (n: _: !lib.hasPrefix "fetch" n) pkgs;
    defaultRunScope = pkgsWithoutFetchers // pkgs.xorg;
  
    splicer = buildPkgs: runPkgs: let
      mash = buildPkgs // runPkgs;
      merge = name: {
        inherit name;
        value = let
          defaultValue = mash.${name};
          # `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
          buildValue = buildPkgs.${name} or {};
          runValue = runPkgs.${name} or {};
          augmentedValue = defaultValue
            // (lib.optionalAttrs (buildPkgs ? ${name}) { nativeDrv = buildValue; })
            // (lib.optionalAttrs (runPkgs ? ${name}) { crossDrv = runValue; });
          # Get the set of outputs of a derivation. If one derivation fails to
          # evaluate we don't want to diverge the entire splice, so we fall back
          # on {}
  
negative.code: 
    splicedPackages =
      if actuallySplice
      then
        splicer
          defaultBuildBuildScope defaultBuildHostScope defaultBuildTargetScope
          defaultHostHostScope defaultHostTargetScope
          defaultTargetTargetScope
        // {
          # These should never be spliced under any circumstances
          inherit (pkgs) pkgs buildPackages targetPackages
            buildPlatform targetPlatform hostPlatform;
        }
      else pkgs // pkgs.xorg;
  
  in
  