-
-
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
Execute shellHook on cached runs #109
Comments
Well, it seems like direnv blocks this anyway. |
Potentially you could source the cache after
or just use |
It seems to me as if #91 broke https://github.com/numtide/devshell which is unfortunate. Personally I have a simpler take on devshell that works in a similar fashion and that is now broken too. I believe the relevant part of devshell is this: It could be something with my setup that's wrong but it seems I started having problems after ugrading to 1.5.0. @zimbatm could perhaps comment on this as he's the author of devshell. |
At least I can confirm that deleting this line: Line 155 in d26fc52
|
In my case I was able to avoid the issues I experienced by not doing anything "important" in the shellHook so for me this is not a problem anymore. |
@ryneeverett @Mic92 I believe departing from the behavior of nix develop has made nix-direnv unusable with https://github.com/numtide/devshell. I don't think nix-direnv is doing the right thing here. |
This PR enables shellHook for both use_nix and use_flake, even in cached runs #125 |
I keep running into this too. I have my own equivalent of numtide/devshell (I didn't know about devshell until now, it sounds like it's a much more comprehensive solution) and the fact that @Mic92 I haven't tried the PR, since I don't want to try and shift my config over to pulling patches from GitHub. Given that Nix 2.4 is the stable nix in nixpkgs now, is there a reason not to go ahead and publish a release with this new change? By default a new release won't end up on any existing release channels, so there shouldn't be any concerns there. |
The PR is not ready quite yet. |
Is there a quickfix for that in the meanwhile? |
I am using it by sourcing it manually but atm the caching does not work: https://github.com/Mic92/dotfiles/blob/0e30755334eb53e4cbcfe49453b6bf18e3d581c2/home/.direnvrc#L3 |
I've added an extra line to my
It seems to do the right thing but I've only looked at it superficially and moved on (so I can't comment on whether this is the "right" workaround and what the cons might be). |
Thanks for both solutions! |
But don't enable until nix-community/nix-direnv#109 is fixed
See nix-community/nix-direnv#109 for more info.
2.0 should handle this case nicely. Please open a new issue if you find some problem with that line. Thank you! |
I set PS1 in the shellHook of my
flake.nix
(which I think isn't terrible).However, after #91 is merged, I think this is ineffective because my shell is basically always cached...
Is there anyway to run
shellHook
in cached hit cases? Or if not, could there be another attribute that is always read out and executed?The text was updated successfully, but these errors were encountered: