Skip to content

Commit e6b86e6

Browse files
authored
Merge pull request #6 from nrdxp/fix-nix-run
`nix run` is now `nix shell`
2 parents 8c857d4 + b90891b commit e6b86e6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# any-nix-shell
2-
`fish` and `zsh` support for the `nix run` and `nix-shell` environments of the Nix package manager.
2+
`fish` and `zsh` support for the `nix shell` and `nix-shell` environments of the Nix package manager.
33

44
Features:
55

6-
* When entering a `nix run` or `nix-shell` environment, the shell stays the same.
6+
* When entering a `nix shell` or `nix-shell` environment, the shell stays the same.
77
* Inside those environments, your prompt prints the loaded packages to the right.
88
* Alternatively, print that information by executing: `nix-shell-info`
99
* `nix-shell --command` or the like still execute inside `bash`, such that scripts don't break.
@@ -81,4 +81,4 @@ The `any-nix-shell` command (which is used for enabling the plugin in a specific
8181

8282
| Flag | Description |
8383
| - | - |
84-
| `--info-right` | While in a `nix run` or `nix-shell` environment, display information about the loaded packages at the right. |
84+
| `--info-right` | While in a `nix shell` or `nix-shell` environment, display information about the loaded packages at the right. |
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fns () {
1010
pos=$((pos-1))
1111
elif [[ $arg == -* ]]; then
1212
if [[ $arg == -c ]] || [[ $arg == --command ]]; then
13-
command nix run "$@"
13+
command nix shell "$@"
1414
return
1515
elif [[ $arg == --arg ]] || [[ $arg == --argstr ]]; then
1616
pos=2
@@ -27,6 +27,6 @@ fns () {
2727
if [[ -n $name ]] && [[ $name != shell ]]; then
2828
pkgs+=" "$name
2929
fi
30-
env ANY_NIX_SHELL_PKGS="$pkgs" IN_NIX_RUN=1 nix run "$@" --command $which_shell
30+
env ANY_NIX_SHELL_PKGS="$pkgs" IN_NIX_RUN=1 nix shell "$@" --command $which_shell
3131
}
32-
fns "$@"
32+
fns "$@"

bin/any-nix-shell

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ end
1212
1313
# Overwrite the nix command
1414
function nix
15-
if test \$argv[1] = run
15+
if test \$argv[1] = shell
1616
set argv[1] fish
17-
$(which .any-nix-run-wrapper) \$argv
17+
$(which .any-nix-wrapper) \$argv
1818
else
1919
command nix \$argv
2020
end
@@ -51,9 +51,9 @@ function nix-shell () {
5151
5252
# Overwrite the nix command
5353
function nix () {
54-
if [[ \$1 == run ]]; then
54+
if [[ \$1 == shell ]]; then
5555
shift
56-
$(which .any-nix-run-wrapper) zsh "\$@"
56+
$(which .any-nix-wrapper) zsh "\$@"
5757
else
5858
command nix "\$@"
5959
fi

0 commit comments

Comments
 (0)