nix-direnv/README.md
Matt Snider 796db38742
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
2020-03-05 23:37:55 +01:00

782 B

nix-direnv

A fast, persistent use_nix implementation for direnv. Prominent features:

  • significantly faster after the first run by caching the nix-shell environment
  • prevents garbage collection of build dependencies by symlinking the resulting shell derivation in the user's gcroots (Life is too short to loose your build cache of your project if you are in a plane without internet connection)

USAGE

$ git clone https://github.com/nix-community/nix-direnv $HOME/.nix-direnv

Then source the direnvrc from this repository in your own .direnvrc

# put this in ~/.direnvrc
source $HOME/.nix-direnv/direnvrc

For derivations to persist garbage collection, set the following in nix.conf:

keep-derivations = true
keep-outputs = true