Update README.md with nix.conf changes needed for persistent derivations

It appears that the derivations produced by nix-direnv are removed when running nix's garbage collection. Troubleshooting this issue led me to a git issue in the NixOS/nix repo [1]. Enabling both `keep-derivations` and `keep-outputs` worked for me as recommended, and now nix-direnv is working.

[1]: https://github.com/NixOS/nix/issues/2208
This commit is contained in:
Matt Snider 2020-03-05 23:37:55 +01:00 committed by GitHub
parent 5a91446000
commit 796db38742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,3 +20,10 @@ Then source the direnvrc from this repository in your own `.direnvrc`
# put this in ~/.direnvrc # put this in ~/.direnvrc
source $HOME/.nix-direnv/direnvrc source $HOME/.nix-direnv/direnvrc
``` ```
For derivations to persist garbage collection, set the following in nix.conf:
```
keep-derivations = true
keep-outputs = true
```