From 16fe86dc496732974f73e524a4fd384e3f8bfd17 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 1 Sep 2022 12:26:02 +0300 Subject: [PATCH 1/2] fix: Remove .envrc in favor of keeping a local .envrc --- .envrc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .envrc diff --git a/.envrc b/.envrc deleted file mode 100644 index 1d953f4bd7359..0000000000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use nix From 4ca2c7abe0047453d90023d538f164f9ef3f1c5a Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 1 Sep 2022 12:26:56 +0300 Subject: [PATCH 2/2] docs: Update `direnv` docs to enable Nix --- docs/CONTRIBUTING.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 32b6307fb939d..ea599b8bd73bf 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