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-build: support for non-bash shells with nix-build / nix-shell #498

Open
blueyed opened this issue Mar 6, 2015 · 12 comments
Open

nix-build: support for non-bash shells with nix-build / nix-shell #498

blueyed opened this issue Mar 6, 2015 · 12 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Mar 6, 2015

#355 (comment) mentions that you can use $NIX_BUILD_SHELL to specify the shell being used.

This does not work for zsh (and probably any non-bash shell) however:

% NIX_BUILD_SHELL=zsh nix-shell '<nixpkgs>' -A hello
zsh: no such option: rcfile

Source:

    $ENV{BASH_ENV} = $rcfile;
    my @args = ($ENV{NIX_BUILD_SHELL} // "bash");
    push @args, "--rcfile" if $interactive;

In #113 / ed09d0c, it was changed to use "bash" instead of $SHELL (by default).

Is it possible and worthwhile to add support for non-Bash shells?

This would also include patches to scripts like https://github.com/NixOS/nix/blob/master/dev-shell then probably.

@retrry
Copy link

retrry commented Apr 18, 2015

Yes, please.

@jyrimatti
Copy link

Meanwhile, I think you can do it like this:

nix-shell '<nixpkgs>' -A hello --command "exec zsh; return"

@avnik
Copy link

avnik commented Aug 30, 2015

Would be nice to allow nix-shell inherit user preffered $SHELL when use default.nix and/or shell.nix

@gebner
Copy link
Member

gebner commented Aug 31, 2015

I have made a pull request for this: #545

@jasom
Copy link

jasom commented Apr 27, 2016

If you just want a zsh inside a nix shell, this should work find: nix-shell -p zsh --run zsh ...

@josiah14
Copy link

josiah14 commented May 22, 2016

@jasom Your suggestion doesn't work for development sandbox types of purposes.

For instance, if I run nix-shell . --run zsh or nix-shell . --command zsh for a Ruby development shell, I can't see the shell sandbox environment's bundle command that is declared in default.nix

@jcrben
Copy link

jcrben commented May 6, 2018

nevermind, posted to the wrong issue - see NixOS/nixpkgs#29960

@chisui
Copy link

chisui commented Jun 22, 2018

<plug shameless="true">In the meantime zsh users can use my zsh-nix-shell plugin.</plug>

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-shell-does-not-use-my-users-shell-zsh/5588/6

@stale
Copy link

stale bot commented Feb 15, 2021

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

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

stale bot commented Apr 30, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 30, 2022
@WhyNotHugo
Copy link
Contributor

Can this be re-opened? It's still an issue.

@thufschmitt thufschmitt reopened this Feb 24, 2023
@edolstra edolstra removed their assignment Apr 26, 2024
@stale stale bot removed the stale label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests