-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shellHook caching inconsistency with and without flakes #90
Comments
Do you have in your project both a flake.nix and a shell.nix? |
Yes, |
Ok. I would accept patches to fix this. Ideally with a test. |
I just pushed another README section to the demo demonstrating that while However having taken a second look this inconsistency doesn't bother me. Caching is more of a feature of the new nix cli than the develop subcommand specifically and |
This makes the behavior of `use flake` consistent with that of `use nix`. Resolve nix-community#90.
This makes the behavior of `use flake` consistent with that of `use nix`. Resolve nix-community#90.
In cached shells, the shellHook does not execute with
use nix
but does withuse flake
.It would be easy to achieve consistency by piping the
nix print-dev-env
output throughsed
to remove the finaleval "$shellHook"
, but I'm not sure this is the right direction. It seems thatnix develop
runs the shellHook even when cached so perhaps it's better not to fight the pattern flakes is currently implementing.I'm not sure if this is a bug or just a (documentation-worthy?) distinction but it does complicate the creation of environments compatible with or without flakes. For example, I was planning to use an .envrc like:
but heavy shellHooks will need to be rewritten to check whether their expensive processes have been run already.
The text was updated successfully, but these errors were encountered: