From f4a78c976f59a1bcf118252d6163aeabb55934bf Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 1 Sep 2022 13:24:08 +0300 Subject: [PATCH] docs: Update `direnv` docs for Nix and remove `.envrc` (#3790) --- .envrc | 1 - docs/CONTRIBUTING.md | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 .envrc diff --git a/.envrc b/.envrc deleted file mode 100644 index 1d953f4bd7..0000000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use nix diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 32b6307fb9..ea599b8bd7 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -17,7 +17,15 @@ copying path '/nix/store/v2gvj8whv241nj4lzha3flq8pnllcmvv-ignore-5.2.0.tgz' from ... ``` -If [direnv](https://direnv.net/) is installed and the [hooks are configured](https://direnv.net/docs/hook.html) then the development environment can be _automatically instantiated_ thus removing the need to run `nix-shell` by hand! +If [direnv](https://direnv.net/) is installed and the [hooks are configured](https://direnv.net/docs/hook.html) then the development environment can be _automatically instantiated_ by creating the following `.envrc`, thus removing the need to run `nix-shell` by hand! + +``` +$ cd ~/code/coder +$ echo "use nix" >.envrc +$ direnv allow +``` + +Now, whenever you enter the project folder, `direnv` will prepare the environment for you: ``` $ cd ~/code/coder