nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

direnv tries to run bash from $PATH

Open akho opened this issue 6 years ago • 3 comments

Describe the bug Installing direnv without having bash in $PATH makes the shell throw errors on every command

To Reproduce Steps to reproduce the behavior:

  1. No bash executable in $PATH
  2. nix-env -i direnv
  3. Do anything in the shell

Expected behavior Direnv works regardless of presence of bash in $PATH.

Notify maintainers @zimbatm

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.84-microsoft-standard, Alpine Linux, noversion
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.3.4
  • channels(root): ""
  • channels(akho): "home-manager, nixpkgs-20.09pre226586.571212eb839"
  • nixpkgs: /home/akho/.nix-defexpr/channels/nixpkgs

akho avatar May 28 '20 21:05 akho

Putting

export DIRENV_BASH="$(nix eval -f ~/.nix-defexpr/channels/nixpkgs --raw bash)/bin/bash"

in .zshrc before

eval "$(direnv hook zsh)"

solves this for me.

akho avatar May 29 '20 12:05 akho

thanks for the report!

zimbatm avatar May 29 '20 14:05 zimbatm

Thank you! That was very quick.

akho avatar May 29 '20 15:05 akho