Skip to content
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

It's not good practice to commit .envrc #114

Open
stevenroose opened this issue Sep 23, 2024 · 2 comments
Open

It's not good practice to commit .envrc #114

stevenroose opened this issue Sep 23, 2024 · 2 comments

Comments

@stevenroose
Copy link

For anyone that has direnv installed, the .envrc files will automatically be attempted to be executed once you enter the directory it's in. This is pretty annoying and also quite invasive.

I think it's better practice to have a .envrc.example or .envrc.dist that the user can then cp .envrc.dist .envrc to his own, to opt-in to automatic nix-shell etc.

@RCasatta
Copy link
Collaborator

RCasatta commented Sep 24, 2024

I think your setup (which automatically run the .envrc) is risky because I have to opt-in for .envrc execution explicitly by doing direnv allow If I want it to be executed automatically (and it's required to do it every time the .envrc changes)

@shesek
Copy link
Collaborator

shesek commented Sep 29, 2024

I'm not using direnv so not affected by this (I just manually source with set -a if needed), but I'm also used to the practice of committing envrc files as .envrc.example.

Also its not quite a typical .envrc file, but something specific to nix. Its possible that we might want to have an envrc in the future that's unrelated to nix, which would conflict. So perhaps it would make sense to name this something like nix.envrc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants