docs: Update `direnv` docs for Nix and remove `.envrc` (#3790)

This commit is contained in:
Mathias Fredriksson 2022-09-01 13:24:08 +03:00 committed by GitHub
parent 567e750659
commit f4a78c976f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

1
.envrc
View File

@ -1 +0,0 @@
use nix

View File

@ -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