diff --git a/pkgs/nix-tools/nix-script.sh b/pkgs/nix-tools/nix-script.sh index 1d0fe137..b9de5f6c 100755 --- a/pkgs/nix-tools/nix-script.sh +++ b/pkgs/nix-tools/nix-script.sh @@ -141,8 +141,10 @@ done if [ -z "$action" ]; then action='repl'; fi -if [ -z "$src" -a -f ./default.nix ]; then - src='./.' +if [ "$action" = instantiate -o "$action" = build -o "$action" = shell ]; then + if [ -z "$src" -a -f ./default.nix ]; then + src='./.' + fi fi if [ "$#" -gt 0 ]; then