Revert nixFlake / nixExperimental (#120141)

Usage of the nixFlakes attribute obscures the fact that it's an
experimental feature. Providing a nixExperimental attribute (which
people will inevitably start using on their production machines) makes
it too easy to enable all experimental features, when you should
explicitly opt in to the features that you want to try out.

Also, upstream Nix doesn't provide an "enable all experimental
features" patch so neither should Nixpkgs.
This commit is contained in:
Eelco Dolstra 2021-05-21 15:16:35 +02:00
parent 224df6940f
commit 21bfd3bbce
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE
4 changed files with 2 additions and 37 deletions

View File

@ -227,12 +227,6 @@ in rec {
];
});
nixExperimental = nixUnstable.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ ./enable-all-experimental.patch ];
});
nixFlakes = nixUnstable.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ ./enable-flakes.patch ];
});
nixFlakes = nixUnstable;
}

View File

@ -1,14 +0,0 @@
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index d3b27d7be..e7d002e1d 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -172,8 +172,7 @@ MissingExperimentalFeature::MissingExperimentalFeature(std::string feature)
void Settings::requireExperimentalFeature(const std::string & name)
{
- if (!isExperimentalFeatureEnabled(name))
- throw MissingExperimentalFeature(name);
+ return;
}
bool Settings::isWSL1()

View File

@ -1,14 +0,0 @@
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 3e4ead76c..81d407236 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -923,7 +923,8 @@ public:
value.
)"};
- Setting<Strings> experimentalFeatures{this, {}, "experimental-features",
+ Setting<Strings> experimentalFeatures{
+ this, {"flakes", "nix-command"}, "experimental-features",
"Experimental Nix features to enable."};
bool isExperimentalFeatureEnabled(const std::string & name);

View File

@ -30322,8 +30322,7 @@ in
nix
nixStable
nixUnstable
nixFlakes
nixExperimental;
nixFlakes;
nixStatic = pkgsStatic.nix;