How to invoke `nix-shell` with the contents of an URL (e.g., a raw GitHub link)?

@jtojnar provided the answer on Stackexchange:

nix-shell -E "import (builtins.fetchurl $url)"

Also drew my attention to the NixOS/nix issue of Feature request: Use nix eval with process substitution or with pipes · Issue #2734 · NixOS/nix · GitHub which describes the same problems I ran into when trying to use pipes or <(...) so I updated it as well.

2 Likes