Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for nix shell detection#573

Open
scaryrawr wants to merge 2 commits intoIlanCosman:main from
scaryrawr:tide-detection-upstream
Open

Add support for nix shell detection #573
scaryrawr wants to merge 2 commits intoIlanCosman:main from
scaryrawr:tide-detection-upstream

Conversation

@scaryrawr
Copy link

@scaryrawr scaryrawr commented Mar 28, 2025

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.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

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.
Copy link

calops commented Mar 31, 2025

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?

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@IlanCosman IlanCosman Awaiting requested review from IlanCosman IlanCosman is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Detect nix shell (in addition to nix-shell)

2 participants

Comments

AltStyle によって変換されたページ (->オリジナル) /