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

nix-shell: extend the meaning of $IN_NIX_SHELL #933

Closed
wants to merge 1 commit into from

Conversation

vcunat
Copy link
Member

@vcunat vcunat commented Jun 9, 2016

... to allow detecting --pure, e.g. in NixOS/nixpkgs#15571 (comment)

... to allow detecting --pure
@vcunat
Copy link
Member Author

vcunat commented Jun 9, 2016

I tested the variable really is defined. Someone skilled in perl would better read the change...

@solson
Copy link
Member

solson commented Jun 18, 2016

I'd like to bump this to make sure it doesn't get missed. It seems like a quick thing for the right person to review.

I had to work around the SSL_CERT_FILE problem in multiple contexts and everyone I know who uses nix has had to deal with it, and the sooner this goes through, the sooner that gets solved, right?

The worst case was that the nixos-unstable install CD required setting SSL_CERT_FILE to use the binary cache.

EDIT: I suppose the latter case is somewhat unrelated and should be covered by NixOS/nixpkgs#15579.

@vcunat
Copy link
Member Author

vcunat commented Jun 21, 2016

@edolstra: this PR is very simple.

@edolstra
Copy link
Member

This breaks Nixpkgs, which has two checks for $IN_NIX_SHELL being equal to 1:

lib/trivial.nix:  inNixShell = builtins.getEnv "IN_NIX_SHELL" == "1";
pkgs/development/tools/pypi2nix/default.nix:    if [ "$IN_NIX_SHELL" != "1" ]; then

@domenkozar domenkozar added the feature Feature request or proposal label Jul 22, 2016
vcunat added a commit to NixOS/nixpkgs that referenced this pull request Aug 11, 2016
... to be compatible with NixOS/nix#933
while not breaking compatibility with current nix.
@vcunat
Copy link
Member Author

vcunat commented Aug 11, 2016

@edolstra: I fixed that up in nixpkgs master NixOS/nixpkgs@d4de02c46. It was trivial; unfortunately the notification for your answer was missed by me somehow.

@domenkozar
Copy link
Member

Note that nix-shell has been meanwhile rewritten to C++: #1018

@vcunat
Copy link
Member Author

vcunat commented Aug 11, 2016

Still, this PR would be a trivial merge for the meantime before we get perl-free.

@domenkozar
Copy link
Member

Pretty sure next Nix release will be perl free, all scripts have been ported ("just" need review): #341

@vcunat
Copy link
Member Author

vcunat commented Aug 11, 2016

C++ equivalent implemented: shlevy#2. I'm actually much more comfortable with C(++) than Perl.

vcunat added a commit to vcunat/nix that referenced this pull request Aug 11, 2016
An equivalent was originally filed against the perl version:
NixOS#933
@vcunat
Copy link
Member Author

vcunat commented Aug 11, 2016

My experience with nix repo is that "just review and merge" tends to take significantly more real time than actual implementation.

@domenkozar
Copy link
Member

domenkozar commented Aug 11, 2016

@vcunat yes, that's because Eelco maintains software that a few thousand people use.

It's also the reason I talked to Shea about the perl port, to get the bus factor down.

We'll improve this, but it's a slow process. I'll help when I can :)

@Ericson2314
Copy link
Member

Only this PR, and not the perl-to-C++ one, has the documentation update.

edolstra pushed a commit to NixOS/nixpkgs that referenced this pull request Sep 20, 2016
... to be compatible with NixOS/nix#933
while not breaking compatibility with current nix.

(cherry picked from commit d4de02c)
@shlevy shlevy added the backlog label Apr 1, 2018
@yurrriq
Copy link
Member

yurrriq commented Nov 29, 2018

I just came across this accidentally. Any chance we can get this updated and merged? Seems like a cool feature.

@vcunat
Copy link
Member Author

vcunat commented May 9, 2019

The feature is present in nix >= 2.0 via 1bffd83.

@vcunat vcunat closed this May 9, 2019
@vcunat vcunat deleted the p/nix-shell-var branch May 9, 2019 07:48
@vcunat vcunat restored the p/nix-shell-var branch May 9, 2019 09:17
@vcunat vcunat deleted the p/nix-shell-var branch May 9, 2019 09:18
adrianpk added a commit to adrianpk/nixpkgs that referenced this pull request May 31, 2024
... to be compatible with NixOS/nix#933
while not breaking compatibility with current nix.

(cherry picked from commit d4de02c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants