anchor.diff:  }@args:
   
   let stackCmd = "stack --internal-re-exec-version=${stack.version}";
  +
  +    # Add all dependencies in buildInputs including propagated ones to
  +    # STACK_IN_NIX_EXTRA_ARGS.
  +    addStackArgsHook = ''
  +for pkg in ''${pkgsHostHost[@]} ''${pkgsHostBuild[@]} ''${pkgsHostTarget[@]}
  +do
  +  [ -d "$pkg/lib" ] && \
  +    export STACK_IN_NIX_EXTRA_ARGS+=" --extra-lib-dirs=$pkg/lib"
  +  [ -d "$pkg/include" ] && \
  +    export STACK_IN_NIX_EXTRA_ARGS+=" --extra-include-dirs=$pkg/include"
  +done
  +    '';
   in stdenv.mkDerivation (args // {
   
     buildInputs =
  
positive.code: 
    configurePhase = args.configurePhase or ''
      export STACK_ROOT=$NIX_BUILD_TOP/.stack
    '';
  
    buildPhase = args.buildPhase or "${stackCmd} build";
  
negative.code:   STACK_PLATFORM_VARIANT="nix";
    STACK_IN_NIX_SHELL=1;
    STACK_IN_NIX_EXTRA_ARGS = extraArgs;
    shellHook = addStackArgsHook;
  
  
    # XXX: workaround for https://ghc.haskell.org/trac/ghc/ticket/11042.
  