Saving it to file, and using that temporary file works fine,
$ url="https://raw.githubusercontent.com/toraritte/shell.nixes/main/deno-latest-shell.nix" $ curl $url > default.nix $ nix-shell # or $ nix-shell default.nix
but how can one do this without using a temporary file? Here's what I tried so far:
$ curl $url | nix-shell -
This downloads the file and the ... just nothing happens.
$ curl $url | nix-shell
This will throw an error that there is no
default.nix (of course).
$ nix-shell <(curl $url) # ... output... error: getting status of '/dev/fd/pipe:': No such file or directory
But when I change
cat, it works, just as if I had saved the
curl output into a regular file, and printed its contents.
(Maybe hitting the same issue with this approach that is explained in Why doesn't the process substitution <() work with ssh -F? The solution there was using zsh with its special
=(...) operator, that basically uses a temporary file behind the scenes.)
I know there is
nix-shell -E, but it would probably be problematic even if my specific example Nix expression didn't contain comments...