nix-community / nix-direnv

A fast, persistent use_nix/use_flake implementation for direnv [maintainer=@Mic92 / @bbenne10]
MIT License
1.78k stars 101 forks source link

direnv stopped working all of a sudden #481

Closed ylbeethoven closed 6 months ago

ylbeethoven commented 6 months ago

Hi everyone,

I notice that direnv stopped working all of a sudden. When I cd to the same project folder (which use flake.nix to load CLI tools for the project) like I used to, it just did not give me all the CLIs.

Running direnv allow does not have any output, I even tried adding new packages on my flake.nix and direnv allow again and nothing happened.

nix develop works as expected.

Can anyone please advise how I can debug this?

➜ direnv version
2.34.0
➜ direnv status
direnv exec path /nix/store/h960xs3n0qh0809620kp9955sh56rgp1-direnv-2.34.0/bin/direnv
DIRENV_CONFIG /home/<username>/.config/direnv
bash_path /nix/store/a1s263pmsci9zykm5xcdf7x9rv26w6d5-bash-5.2p26/bin/bash
disable_stdin false
warn_timeout 5s
whitelist.prefix []
whitelist.exact map[]
No .envrc or .env loaded
Found RC path /home/<username>/Documents/personal/cactus/.envrc
Found watch: ".envrc" - 2024-04-04T02:38:03+11:00
Found watch: "../../../.local/share/direnv/allow/397d02ed251c07e9ad9c2da6cfa520e58da362fdc7539ea6acb24d71ff07d9f1" - 1970-01-01T10:00:00+10:00
Found watch: "../../../.local/share/direnv/deny/d0a738a36081bc2cdfce001c8e9829d6bffab5505c6e6f183001122f6897d66c" - 2024-04-04T02:38:29+11:00
Found RC allowed 2
Found RC allowPath /home/<username>/.local/share/direnv/allow/397d02ed251c07e9ad9c2da6cfa520e58da362fdc7539ea6acb24d71ff07d9f1

Thank you.

ylbeethoven commented 6 months ago

The reason is my .zshrc was corrupted hence eval "$(direnv hook zsh)" was not loaded properly.