Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Support custom shell in nix-shell/nix run #2681
EDIT: Any changes to
One could also consider those environment variables to be arbitrary default commands that are executed when
Issue #419 (nix-shell ignoring SHELL enviroment variable) proposed to use
bash-only install scripts of course wouldn't run. However, why would you disallow using nix-shell with another shell, just because there use cases, where bash is needed?
direnv looks appropriate for the job.
Since that's the common oppinion here, I'm no going to remove the
* Use `$NIX_RUN_INTERACTIVE_SHELL` (if present) as interactive shell for `nix run` If `--command` or `-c` are given, then bash is still used. One could also consider those environment variables to be arbitrary default commands that are executed when `nix run` is ran interactively and without a command. However, I think the most common use case (by far) is to set them to a shell, hence the name `[...]_INTERACTIVE_SHELL`. Previous work: Issue #419 (nix-shell ignoring SHELL enviroment variable) proposed to use `$SHELL` as interactive shell for `nix-shell`. This is of course not desirable for `nix-shell` since it's mainly inteded for reproducing builds with bash build scripts. For `nix run` such a feature seems however appropriate.