Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set environment variable NIX_SHELL_NAME to derivation name #2406

Closed
wants to merge 1 commit into from

Conversation

kampka
Copy link
Contributor

@kampka kampka commented Sep 7, 2018

When in a nix-shell environment, I like to have the derivation name exposed on my prompt.
At the moment this is a bit tricky to do, thus this change introduces an environment variable that exports the derivation name.

@copumpkin
Copy link
Member

You should get this automatically today from the name environment variable. It's not uppercase or prefixed so might not feel like your average environment variable, but on the plus side behaves like all other derivation fields so is less special-casey. Does that suit your needs?

@kampka
Copy link
Contributor Author

kampka commented Sep 7, 2018

That is actually what I am currently doing, but it feels very implicit as name is a very ambiguous token.
The main purpose of this request is to make the use very explicit.

@kampka
Copy link
Contributor Author

kampka commented May 28, 2019

ping

Would be nice to have a decision (or discussion) either way.

@edolstra
Copy link
Member

IMHO the combination of $IN_NIX_SHELL and $name already allows doing what you want.

@kampka
Copy link
Contributor Author

kampka commented May 29, 2019

True, but as I already said, this PR is not about making it possible, it's about making it explicitly clear what's what instead of relying on a generic token name $name.

@stale
Copy link

stale bot commented Feb 13, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 13, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants