MercuryTechnologies / nix-your-shell

A `nix` and `nix-shell` wrapper for shells other than `bash`
MIT License
85 stars 12 forks source link

Detect the 'nix run' command #52

Closed arthsmn closed 5 months ago

arthsmn commented 5 months ago

Using something like nix run nix -- develop isn't working, this is important because you can run different versions of nix with this command (nix run nix/2.19.1 -- develop).

9999years commented 5 months ago

I think this is a broader scope than what I'm interested in supporting. I think it would be challenging to figure out which Flake expressions evaluate to the Nix binary. (This would involve parsing nix registry list, which doesn't yet have JSON output, for example...)

If you're constructing a command like nix run nix -- develop, you (probably?) are going to be using it in a test script for checking a particular Nix version's support. Perhaps nix run nix -- develop --command fish (for example) would be a reasonable workaround?