Extra_files_script in nixos-anywhere's terraform module

I’m trying to provision a Hetzner server running NixOS by using nixos-anywhere’s terraform module. The terraform module has an input variable named extra_files_script, whose definition is given by:

variable "extra_files_script" {
  type        = string
  description = "A script file that prepares extra files to be copied to the target host during installation. The script expected to write all its files to the current directory. This directory is copied to the target host during installation to the / directory."
  default     = null
}

It’s not clear to me how this variable should be used. Judging by its use (nixos-anywhere/terraform/install/run-nixos-anywhere.sh at f99d120b3788a286989db4e592a698f5d310d2f6 · nix-community/nixos-anywhere · GitHub), this is supposed to be a file path. But how would I get the actual script on the machine? When I use a remote-exec provisioner to create the script on the server, the file isn’t available anymore by the time the install phase of the nixos-anywhere terraform module runs (because the disk is partitioned before).

resource "hcloud_server" "test_node" {
  name        = "test-node"
  server_type = "ccx13"
  image       = "ubuntu-20.04"
  ssh_keys    = [hcloud_ssh_key.my_ssh_key.id]
  public_net {
    ipv4_enabled = true
  }

  provisioner "remote-exec" {
    inline = [
      "mkdir -p /secrets",
      "echo '${var.sops_key_to_copy}' > /secrets/key.txt",
      "chmod 600 /secrets/key.txt",
      "echo '${var.sops_pub_key_to_copy}' > /secrets/pub-key.txt",
      "chmod 644 /secrets/pub-key.txt",
      "echo '#!/bin/bash' > /cp_files_script.sh",
      "echo 'cp /secrets/key.txt key.txt' >> /cp_files_script.sh",
      "echo 'cp /secrets/pub-key.txt pub-key.txt' >> /cp_files_script.sh",
      "chmod +x /cp_files_script.sh"
    ]

    connection {
      type        = "ssh"
      user        = "root"
      private_key = file("~/.ssh/id_rsa")
      host        = self.ipv4_address
    }
  }
}

So how am I supposed to create the script and get my sops keys on the machine?