auto-nix-shell enters or exits nix-shell automatically when you cd into or out of a directory that contains a default.nix file. It reloads nix-shell for the next command if default.nix was changed, so git pull works seamlessly. It does not handle the case where a script modifies default.nix then runs commands dependent on the new version.
With fisherman
fisher chrismwendt/auto-nix-shell
Then add this to your ~/.config/fish/config.fish:
if test -e ~/.config/fish/functions/auto-nix-shell.fish
. ~/.config/fish/functions/auto-nix-shell.fish
end- Clone this repo
- Download bash-preexec
- Add this to your
~/.bashrc:
if [ -e ~/auto-nix-shell/auto-nix-shell.sh ]; then
. ~/auto-nix-shell/auto-nix-shell.sh
ficd into a directory that contains default.nix and auto-nix-shell will enter a nix-shell for you.