is it possible for direnv to run an interactive bash session (nix-shell)?
let
pkgs = import <nixpkgs> { };
in
pkgs.mkShellNoCC {
shellHook = ''
readlink /proc/$$/exe
bind
'';
}
“echo nix-shell --pure > .envrc” direnv gives me (not “use nix”)
direnv: nix-direnv: Renewed cache
/nix/store/qqz0gj9iaidabp7g34r2fb9mds6ahk8i-bash-interactive-5.2p32/bin/bash
/nix/store/9ip31vbkgg0lp4rx042svlllv3945nxq-stdenv-linux/setup: line 227: bind: warning: line editing not enabled
with a plain nix-shell (no direnv)
$ nix-shell
/nix/store/qqz0gj9iaidabp7g34r2fb9mds6ahk8i-bash-interactive-5.2p32/bin/bash
# bind works
with use nix
in envrc
/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash
/home/rithvij/.config/direnv/lib/hm-nix-direnv.sh:2067: bind: command not found
Also same situation with use flake
and nix develop
for flake devShell.
cc @zimbatm (since direnv)
I’m also using nix-direnv, but I’ve tried it via disabling nix-direnv and got the same error.
There was previous discussion about this here, but didn’t solve it for me.
created an issue in direnv allow interactive bash sesssion with direnv · Issue #1340 · direnv/direnv · GitHub