Add support for `nix shell` detection
Description
When using nix shell, the IN_NIX_SHELL variable is not set.
A common workaround is to check if /nix/store/ is on the PATH.
Motivation and Context
nix shell does not set $IN_NIX_SHELL
Closes #542
Screenshots (if appropriate)
How Has This Been Tested
- [ ] I have tested using Linux.
- [x] I have tested using MacOS.
Checklist
- [x] I am ready to update the wiki accordingly.
- [x] I have updated the tests accordingly.
A common workaround is to check if /nix/store/ is on the PATH.
Is that really a common workaround? Wouldn't that always identify a NixOS environment as a nix shell?
A common workaround is to check if /nix/store/ is on the PATH.
Is that really a common workaround? Wouldn't that always identify a NixOS environment as a nix shell?
Ah, maybe not common, but it is how starship treats it. They have an unknown option vs pure/impure where if they're in an NixOS environment.