diff --git a/pkgs/tools/misc/nix-direnv/default.nix b/pkgs/tools/misc/nix-direnv/default.nix index 6aaf8cc8a523..833f8313f617 100644 --- a/pkgs/tools/misc/nix-direnv/default.nix +++ b/pkgs/tools/misc/nix-direnv/default.nix @@ -15,9 +15,8 @@ stdenv.mkDerivation rec { # getting sourced, not executed: postPatch = '' substituteInPlace direnvrc \ - --replace "grep" "${gnugrep}/bin/grep" \ - --replace "nix-shell" "${nix}/bin/nix-shell" \ - --replace "nix-instantiate" "${nix}/bin/nix-instantiate" + --replace "\''${NIX_BIN_PREFIX:-}" "\''${NIX_BIN_PREFIX:-${nix}/bin/}" \ + --replace "grep" "${gnugrep}/bin/grep" ''; installPhase = ''