-
Notifications
You must be signed in to change notification settings - Fork 307
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
Add direnv #669
base: main
Are you sure you want to change the base?
Add direnv #669
Conversation
Committing this sort of locks out anyone from doing anything else with direnv though (which |
@thisismiller, I addressed this in 453571e. Take a look :) |
I don't use Flake or nix so... does this look better now, @thisismiller? |
@penberg, this can be safely merged. The configuration checks if nix is present. Example on another repo: https://github.com/ghostty-org/ghostty/blob/6ef757a8f85db7a124d370378850339a899c9e65/.envrc |
Sorry for making unconstructive complaints. I'm already a direnv user, but not a nix user. So committing a .envrc file means I'd just have to carry around a conflict permanently, or figure out that one line of git magic to ignore conflicts from a specific file name. I don't oppose committing a file with the direnv script for flake if that's helpful for folk, but I'd suggest maybe adding .envrc to .gitignore and offering the current script as .envrc_flake. We can then append to the README setup instructions a "if you're a direnv and flake user, then do If most people are flake users already and I'm the odd one out, then appending a |
@thisismiller, don't be sorry, your input is very much valid. I said it was safe to merge because it wouldn't just break for users that don't use nix. Can we just add |
Unfortunately, the |
Wouldn't it make sense to keep this out of the repo? It seems very specific to individual preferences. I don't think commiting tools configs to the repo is a good idea unless usage of that tools is mandatory to all contributors. How are direnv and nix more special than thousands other tools? |
@haaawk, I understand that this looks very specific, but the direnv and nix flakes are very project specific. Having this tools available is just nice to have. We can accommodate the needs of other developers that use, in this case, Having I've added it to the top level |
|
||
# Direnv | ||
.direnv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is no longer needed now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direnv generates this folder for me. Seems to be a cache of some sort.
If To haaawk's point, I'm still not sure that it's good to specify one canonical .envrc that should work for everyone, as someone might show up in the future complaining that they can't override some cargo env var for limbo or something similar, but we can also figure out what to do when we reach that point. |
It works for me :) Thanks for showing that feature, I didn't knew about it. |
Add
use flake
configuration for direnv. For Nix users, being able to hop into a directory and loading the environment automatically is very convenient.