use flake: allow optional flake expression

This allows using flake.nix out of tree, which is very appreciable
if you develop in a big repository as flake evaluation will copy the
whole git archive to store everytime it changes.
This commit is contained in:
Dominique Martinet 2021-05-26 13:44:26 +09:00
parent 1134713112
commit fd12ba39f3
2 changed files with 14 additions and 6 deletions

View file

@ -185,6 +185,12 @@ $ echo "use flake" >> .envrc
$ direnv allow
```
Optionally if you do not want flake.nix to be part of the current directory repo,
you can specify an arbitrary flake expression as parameter such as:
```console
use flake ~/myflakes#project
```
## Storing .direnv outside the project directory
A `.direnv` directory will be created in each `use_nix` project, which might