Skip to content

Commit

Permalink
docs: add .envrc instructions for the current release
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jan 7, 2025
1 parent d52ca36 commit cc48e04
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions docs/automatic-shell-activation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ This feature relies on a separate tool called [direnv](https://direnv.net) (not

To enable automatic shell activation, create an `.envrc` file in your project directory with the following content:

```bash
eval "$(devenv direnvrc)"
=== "v1.3 and older"

use devenv
```
``` bash title=".envrc"
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="

use devenv
```

=== "v1.4+"

``` bash title=".envrc"
eval "$(devenv direnvrc)"

use devenv
```

This file configures direnv to use devenv for shell activation.

Expand Down Expand Up @@ -60,13 +70,14 @@ echo ".direnv" >> .gitignore
## Manually managing updates to direnvrc

We occasionally make updates to our direnv integration script, also known as the `direnvrc`.
Devenv will use the latest compatible version if set up using the method described above in [Configure Shell Activation](#configure-shell-activation).

Alternatively, you can pin the `direnvrc` to a specific version from the source repository.
This approach allows you audit the `direnvrc` script and have full control over when it is updated.
From v1.4 and onwards, devenv will use the latest compatible version if set up using the latest method described above in [Configure Shell Activation](#configure-shell-activation).
For older versions, the pinned script has to be updated manually.

Pinning the `direnvrc` to a specific version from the source repository allows you audit the `direnvrc` script and have full control over when it is updated.
The downside is that you will have to manually update the URL and content hash of the script for every single project individually.

We strongly recommend using the approach that supports automated upgrades described in [Configure Shell Activation](#configure-shell-activation).
<!-- We strongly recommend using the approach that supports automated upgrades described in [Configure Shell Activation](#configure-shell-activation). -->

The `direnvrc` can be found at:

Expand Down

0 comments on commit cc48e04

Please sign in to comment.