Blockstream / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
321 stars 131 forks source link

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

Open stevenroose opened 2 months ago

stevenroose commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

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?