curl foobar.com/myfile.sh | sh and sh -c "$(curl foobar.com/myfile.sh)" are common idioms. I’m curious if there’s a way to do something like this with #!/usr/bin/env nix-shell scripts.
I’ve tried a few different permutations curl ... | sh, sh -c "$(curl ...)", curl ... | nix-shell, curl ... | /usr/bin/env, etc but without any success. Is there anything better than just curl script.py && chmod +x script.py && ./script.py && rm script.py?