# Using direnv with flox

**URL:** <https://discourse.flox.dev/t/using-direnv-with-flox/510>\
**Category:** Developing with flox\
**Created:** [November 22, 2022, 9:16am UTC](https://discourse.flox.dev/t/using-direnv-with-flox/510 "2022-11-22T09:16:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [November 22, 2022, 9:16am UTC](https://discourse.flox.dev/t/using-direnv-with-flox/510/1 "2022-11-22T09:16:40Z")

</div>

This is a quick tip which seems to be working well.

If you work on a project which always needs some tools present in a specific environment you can use [direnv](https://direnv.net) to automatically load the right environment:

- install `direnv` in your default profile (so that it’s available whenever you open a shell session)
- create a `.envrc` file containing `. <(flox activate -e work)` where `work` is the environment you need
- allow that file to be used with `direnv allow`

Then every time you cd into your work directory the `work` environment will be active.

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [November 22, 2022, 11:21am UTC](https://discourse.flox.dev/t/using-direnv-with-flox/510/2 "2022-11-22T11:21:44Z")

</div>

cool tip! 💫 I’ve passed this on internally so we can incorporate it in our docs for others to utilise. thanks!!!
