lorri icon indicating copy to clipboard operation
lorri copied to clipboard

Ignores `watch_file` and `watch_dir` from direnv

Open yajo opened this issue 5 months ago • 3 comments

Describe the bug

Lorri doesn't find the correct files to watch, and I have no way to force it to reload.

To Reproduce Steps to reproduce the behavior:

I have a Devshell+Blueprint-based flake where the devshell depends on various files, as per their standard.

Lorri seems to fail to find what files to watch.

I added some of them to the .envrc, which now looks like this:

dotenv_if_exists .data/credentials.env
watch_dir devshells modules/devshell

if type -P lorri &>/dev/null; then
    eval "$(lorri direnv --flake ${DIRENV_USE_FLAKE_ARGS:-.})"
else
    echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]'
    use flake ${DIRENV_USE_FLAKE_ARGS:-.} --impure --accept-flake-config
fi

Expected behavior

Lorri should respect the watch_dir and watch_file directives expressed in .envrc.

In any case, Lorri should provide a command to force reloading the devshell. Something like lorri reload. Or, even better, force reloading when I execute direnv reload.

Metadata

$ lorri info
Project Shell File: /home/yajo/prodevel/example/flake.nix
Project Garbage Collector Root: /home/yajo/.cache/lorri/gc_roots/671ed3f4d2327747ed356a8f73dd0ad0/gc_root/shell_gc_root

General:
Lorri User GC Root Dir: /home/yajo/.cache/lorri/gc_roots
Lorri Daemon Socket: /run/user/1000/lorri/daemon.socket
Lorri Daemon Status: `lorri daemon` is running
$ uname -a
Linux iceland 6.15.6-zen1 #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980 x86_64 GNU/Linux

Additional context

@moduon MT-10900

yajo avatar Aug 05 '25 09:08 yajo