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

Change request: about .envrc #328

Open
hellwolf opened this issue Jul 26, 2023 · 4 comments
Open

Change request: about .envrc #328

hellwolf opened this issue Jul 26, 2023 · 4 comments

Comments

@hellwolf
Copy link
Contributor

.envrc is used by direnv, a tool to allow you to have a distinct development environment for each directory.

Since this project uses nix flake, conveniently, nix-direnv is an extension to direnv. This allows a simple use flake one liner for setting up a reproduciable development environment to any contributor.

Note that a developer might also want to customize their own .envrc for the project, e.g. I might want to override my nixpkgs inputs in order to reduce disk space usage use flake . --override-input nixpkgs /var/lib/nixpkgs/hellwolf-unstable. Further more additional shell environment might also be added here as the developer wishes.

However as it stands, hevm project commits a .envrc to the repository, and uses an different form of use_flake which according to my experience and maybe somewhere in the docs creating a cluster of nix gcroots.

I am proposing simply removing .envrc from the repo, add it to the .gitignore list, and let the developer choose their own way of doing it. An .envrc.example may still be supplied for reference purpose.

@d-xo
Copy link
Collaborator

d-xo commented Jul 26, 2023

hm, this would be pretty annoying for me, I use worktrees a lot for hevm, and tend to have 10s of repos lying around my filesystem at any time. I would not want to have to recreate my .envrc every time I create a new worktree. Perhaps we could make it something like the following, and you could set HEVM_NIX_DIRENV_ARGS in your shell profile?

use flake . ${HEVM_NIX_DIRENV_ARGS}

@arcz are you using direnv with hevm? do you have any thoughts here?

@hellwolf
Copy link
Contributor Author

Perhaps we could make it something like the following, and you could set HEVM_NIX_DIRENV_ARGS in your shell profile?

Unfortunately, not in this case, since I'd use use flake not use_flake, for some reason I don't fully know, they are different. And it's a rather an ad-hoc fix that doesn't address the fundamental reason.

Though I hear you about the worktree workflow. I am not a worktree user myself, I don't have anything to suggest for now.

Happy to hear from others' thoughts.

@arcz
Copy link
Collaborator

arcz commented Jul 26, 2023

I don't use anything extra, when I work on hevm I just do nix develop

@hellwolf
Copy link
Contributor Author

hellwolf commented Jul 26, 2023

:) Yea, I could always not allow the default .envrc, and run the command manually indeed.

Fwiw, this is the relevant discussion happening in the direnv: direnv/direnv#556. If we can't settle to anything, I will watch the upstream thread and come back with a new suggestion.

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

No branches or pull requests

4 participants