From cc48e044747cef4e4f69897e20a100adf5b716a3 Mon Sep 17 00:00:00 2001 From: Sander Date: Tue, 7 Jan 2025 19:08:25 +0100 Subject: [PATCH] docs: add .envrc instructions for the current release --- docs/automatic-shell-activation.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/automatic-shell-activation.md b/docs/automatic-shell-activation.md index 2d8a74da1..3b4c968f4 100644 --- a/docs/automatic-shell-activation.md +++ b/docs/automatic-shell-activation.md @@ -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. @@ -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). + The `direnvrc` can be found at: