`nix-direnv` depends on `nixUnstable` for flakes support, but that
causes it to print a warning unless your user is trusted or the
`experimental-features` setting is enabled. Neither of these are
desirable (note that setting `experimental-features` in nix.conf causes
warnings on `nixStable`).
Since flakes are experimental, this commit makes `nixStable` the default
and optionally allows `nixUnstable` with a new flag `enableFlakes`,
prioritising a good experience for users not using experimental
features.
* Reason: statically set `${NIX_BIN_PREFIX}` within generated
`direnvrc`.
* Before it only replaced the `-z ${NIX_BIN_PREFIX:-}` check
which therefore never was `true`. So, also `NIX_BIN_PREFIX` never got
set such that its usage later always failed execution with
`NIX_BIN_PREFIX: unbound variable`. With the fix, the line containing
the check will no longer be replaced.
* Solves https://github.com/nix-community/nix-direnv/issues/70
* See also discussion on #114622
Signed-off-by: Andreas Schmid <service@aaschmid.de>