Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近开始几乎所有的脚本
#!/usr/bin/env nix-shell #! nix-shell -i bash set -e
但这要求default.nix/shell.nix与脚本位于同一目录中,但情况并非总是如此。有没有办法告诉nix-shell查看*.nix文件的所有父目录?
default.nix
shell.nix
nix-shell
*.nix
后面的项目#! nix-shell基本上是常规nix-shell参数,所以你可以像这样添加文件名。
#! nix-shell
#!/usr/bin/env nix-shell #! nix-shell -i bash ../shell.nix set -e
路径解析相对于脚本文件发生。当您使用目录路径时,它会在目录中查找default.nix,而不是shell.nix在目录中。