anchor.diff:    # file pattern and if the plugin is not found it will try to download it
     # from the Internet. With sandboxing enable this test will fail if that is
     # the case.
  -  terraform_plugins_test = let
  -    mainTf = writeText "main.tf" ''
  -      resource "random_id" "test" {}
  -    '';
  -    terraform = terraform_0_12.withPlugins (p: [ p.random ]);
  -    test =
  -      runCommand "terraform-plugin-test" { buildInputs = [ terraform ]; } ''
  -        set -e
  -        # make it fail outside of sandbox
  -        export HTTP_PROXY=http://127.0.0.1:0 HTTPS_PROXY=https://127.0.0.1:0
  -        cp ${mainTf} main.tf
  -        terraform init
  -        touch $out
  -      '';
  -  in test;
  +  terraform_plugins_test =
  +    let
  +      mainTf = writeText "main.tf" ''
  +        resource "random_id" "test" {}
  +      '';
  +      terraform = terraform_0_12.withPlugins (p: [ p.random ]);
  +      test =
  +        runCommand "terraform-plugin-test" { buildInputs = [ terraform ]; } ''
  +          set -e
  +          # make it fail outside of sandbox
  +          export HTTP_PROXY=http://127.0.0.1:0 HTTPS_PROXY=https://127.0.0.1:0
  +          cp ${mainTf} main.tf
  +          terraform init
  +          touch $out
  +        '';
  +    in
  +    test;
   
   }
  
positive.code:           actualPlugins = plugins terraform.plugins;
  
            # Make providers available in Terraform 0.13 and 0.12 search paths.
            pluginDir = lib.concatMapStrings (pl: let
              inherit (pl) version GOOS GOARCH;
  
              pname = pl.pname or (throw "${pl.name} is missing a pname attribute");
  
              # This is just the name, without the terraform-provider- prefix
              plugin_name = lib.removePrefix "terraform-provider-" pname;
  
              slug = pl.passthru.provider-source-address or "registry.terraform.io/nixpkgs/${plugin_name}";
  
              shim = writeText "shim" ''
                #!${runtimeShell}
                exec ${pl}/bin/${pname}_v${version} "$@"
              '';
              in ''
                TF_0_13_PROVIDER_PATH=$out/plugins/${slug}/${version}/${GOOS}_${GOARCH}/${pname}_v${version}
                mkdir -p "$(dirname $TF_0_13_PROVIDER_PATH)"
  
                cp ${shim} "$TF_0_13_PROVIDER_PATH"
                chmod +x "$TF_0_13_PROVIDER_PATH"
  
                TF_0_12_PROVIDER_PATH=$out/plugins/${pname}_v${version}
  
                cp ${shim} "$TF_0_12_PROVIDER_PATH"
                chmod +x "$TF_0_12_PROVIDER_PATH"
            ''
            ) actualPlugins;
  
            # Wrap PATH of plugins propagatedBuildInputs, plugins may have runtime dependencies on external binaries
            wrapperInputs = lib.unique (lib.flatten
  
negative.code: { stdenv
  , lib
  , buildGoModule
  , fetchFromGitHub
  , makeWrapper
  , coreutils
  , runCommand
  , runtimeShell
  , writeText
  , terraform-providers
  , fetchpatch
  }:
  
  let
    generic = { version, sha256, vendorSha256 ? null, ... }@attrs:
      let attrs' = builtins.removeAttrs attrs [ "version" "sha256" "vendorSha256" ];
      in
      buildGoModule ({
        name = "terraform-${version}";
  
        inherit vendorSha256;
  