File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 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
44Features:
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. |
Original file line number Diff line number Diff 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 " $@ "
Original file line number Diff line number Diff line change 1212
1313# Overwrite the nix command
1414function 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
5353function 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
You can’t perform that action at this time.
0 commit comments