Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom shell in nix-shell/nix run
* Use `$NIX_SHELL_INTERACTIVE_SHELL` (if present) as interactive shell for `nix-shell` * Use `$NIX_RUN_INTERACTIVE_SHELL` (if present) as interactive shell for `nix run` If `--run`, `--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-shell`/`nix run` are ran interactive 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`. Tests: I was unsuccessful adding tests to *tests/nix-shell.sh*. Any non-interactive test doesn't trigger the feature since it's only triggered in interactive shells. 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 if people depend on `nix-shell` always using bash. With this change however, the feature is optional since it uses previously unused environment variables.
- Loading branch information
Showing
3 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters