Add experimental-features setting

Experimental features are now opt-in. There are currently two
experimental features: "nix-command" (which enables the "nix"
command), and "flakes" (which enables support for flakes). This will
allow us to merge experimental features more quickly, without
committing to supporting them indefinitely.

Typical usage:

$ nix build --experimental-features 'nix-command flakes' nixpkgs#hello
This commit is contained in:
Eelco Dolstra
2019-10-16 17:49:01 +02:00
parent a56036fa87
commit 8e478c2341
5 changed files with 17 additions and 0 deletions
+2
View File
@@ -433,6 +433,8 @@ static std::pair<Flake, LockedInput> updateLocks(
and optionally write it to file, it the flake is writable. */
ResolvedFlake resolveFlake(EvalState & state, const FlakeRef & topRef, HandleLockFile handleLockFile)
{
settings.requireExperimentalFeature("flakes");
auto flake = getFlake(state, topRef,
allowedToUseRegistries(handleLockFile, true));