Skip to content

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

Closed
vcunat wants to merge 1 commit into
NixOS:masterfrom
vcunat:p/nix-shell-var
Closed

vcunat wants to merge 1 commit into
NixOS:masterfrom
vcunat:p/nix-shell-var

Conversation

@vcunat

@vcunat vcunat commented Jun 9, 2016

Copy link
Copy Markdown
Member

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

... to allow detecting --pure
@vcunat

vcunat commented Jun 9, 2016

Copy link
Copy Markdown
Member Author

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

@solson

solson commented Jun 18, 2016 •

Copy link
Copy Markdown
Member

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

vcunat commented Jun 21, 2016

Copy link
Copy Markdown
Member Author

@edolstra: this PR is very simple.

@edolstra

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

vcunat commented Aug 11, 2016

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Member

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

@vcunat

vcunat commented Aug 11, 2016

Copy link
Copy Markdown
Member Author

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

@domenkozar

Copy link
Copy Markdown
Member

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

@vcunat

vcunat commented Aug 11, 2016

Copy link
Copy Markdown
Member Author

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

vcunat commented Aug 11, 2016 •

Copy link
Copy Markdown
Member Author

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

@domenkozar

domenkozar commented Aug 11, 2016 •

Copy link
Copy Markdown
Member

@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
Copy Markdown
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

yurrriq commented Nov 29, 2018

Copy link
Copy Markdown
Member

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

@vcunat

vcunat commented May 9, 2019

Copy link
Copy Markdown
Member Author

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.

8 participants