Skip to content

Commit e61713d

Browse files
authored
Add support for the 'nix develop' command (#34)
1 parent 2537e5c commit e61713d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bin/.any-nix-wrapper

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fns () {
99
pos=0
1010

1111
# `nix run` only launched a shell from Nix 2.0.* to 2.3.*
12-
if nix --version | grep -vq ' 2\.[0-3][^0-9]'; then
12+
if [[ "$subcommand" == "run" ]] && nix --version | grep -vq ' 2\.[0-3][^0-9]'; then
1313
exec nix "$subcommand" "$@"
1414
fi
1515

bin/any-nix-shell

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases["nix-shell"] = "@(\$(which .any-nix-shell-wrapper)) xonsh @(\$args)"
1010
1111
# Overwrite the nix command
1212
def __nix(args):
13-
if args and args[0] == "run":
13+
if args and ( args[0] == "run" or args[0] == "develop" ):
1414
@(\$(which .any-nix-wrapper)) xonsh @(args)
1515
else:
1616
@(\$(which -s nix)) @(args)
@@ -44,7 +44,7 @@ end
4444
4545
# Overwrite the nix command
4646
function nix
47-
if test \$argv[1] = run
47+
if test \$argv[1] = run or test \$argv[1] = develop
4848
$(which .any-nix-wrapper) fish \$argv
4949
else
5050
command nix \$argv
@@ -82,7 +82,7 @@ function nix-shell () {
8282
8383
# Overwrite the nix command
8484
function nix () {
85-
if [[ "\$1" == "run" ]]; then
85+
if [[ "\$1" == "run" ]] || [[ "\$1" == "develop" ]]; then
8686
$(which .any-nix-wrapper) zsh "\$@"
8787
else
8888
command nix "\$@"

0 commit comments

Comments
 (0)