3 ms·
This reminds me on some weird linux/mac/unix tool people used in a project. It changed the PATH (or more generally the ENV) based on the current working directo
by ktpsns 4y ago
This reminds me on some weird linux/mac/unix tool people used in a project. It changed the PATH (or more generally the ENV) based on the current working directory, so they could easily manipulate the developers shell from the project git repo. I found this terrible and fascinating at the same time. I don't remember the name of this tool. Who does?
- mark_round 4y agohttps://direnv.net/ https://direnv.net/ possibly ?
- razemio 4y agoDirenv is such a great tool. I use it in all of my projects.
- rgoulter 4y agoOn its own, it's nice for development for setting stuff like DB URIs, activating Python virtual environments, etc. But I find direnv indispensable for how it combines with nix (probably asdf would be good enough too) for "project specific tools". -- The convenience here is not having to remember to install tools system wide in order to work on some repository.
- Smaug123 4y agoDoes direnv have an advantage over `nix develop` in that regard?
- rgoulter 4y agoYup: direnv hooks into the shell, so that it adjusts the environment variables / PATH when you `cd` into the directory. (Well, you do need to run `direnv allow` to indicate you trust the `.envrc` file). (Also, `nix develop` drops you into a bash shell, which is annoying coming from fish).
- e3bc54b2 4y agodirenv has integration with old nix shell as well as new nix develop. It also happens to have lot more editor integration that can utilize nix indirectly instead of not having access to nix at all.
- sph 4y agoSeconded, I love it and I honestly don't know how people deal with configuration without it. The applications I develop all run in Docker or Podman, with configuration passed as environment variables. Direnv is excellent in dev mode to configure local env vars such as database credentials that only apply to a specific project, and you will have to approve any change before they take effect, in case you made the mistake of committing it. To avoid that, I just have `.envrc` listed in my ~/.gitignore
- Squarex 4y agodotenv? https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dotenv https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/doten...