1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 12:37:59 +02:00

Actually remove the "flakes" experimental feature

To avoid annoying warnings, this is now a "stabilized" feature.
This commit is contained in:
Eelco Dolstra 2024-07-10 16:49:46 +02:00
parent 16c8f9016b
commit 50d7ce6c6a
3 changed files with 12 additions and 13 deletions

View file

@ -341,8 +341,10 @@ template<> std::set<ExperimentalFeature> BaseSetting<std::set<ExperimentalFeatur
{
std::set<ExperimentalFeature> res;
for (auto & s : tokenizeString<StringSet>(str)) {
if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature)
if (auto thisXpFeature = parseExperimentalFeature(s))
res.insert(thisXpFeature.value());
else if (stabilizedFeatures.count(s))
debug("experimental feature '%s' is now stable", s);
else
warn("unknown experimental feature '%s'", s);
}

View file

@ -70,16 +70,6 @@ constexpr std::array<ExperimentalFeatureDetails, numXpFeatures> xpFeatureDetails
)",
.trackingUrl = "https://github.com/NixOS/nix/milestone/42",
},
{
.tag = Xp::Flakes,
.name = "flakes",
.description = R"(
*Enabled for Determinate Nix Installer users since 2.19*
See the manual entry for [`nix flake`](@docroot@/command-ref/new-cli/nix3-flake.md) for details.
)",
.trackingUrl = "https://github.com/NixOS/nix/milestone/27",
},
{
.tag = Xp::FetchTree,
.name = "fetch-tree",
@ -302,12 +292,18 @@ constexpr std::array<ExperimentalFeatureDetails, numXpFeatures> xpFeatureDetails
static_assert(
[]() constexpr {
for (auto [index, feature] : enumerate(xpFeatureDetails))
if (index != (size_t)feature.tag)
if (index != (size_t) feature.tag)
return false;
return true;
}(),
"array order does not match enum tag order");
/**
* A set of previously experimental features that are now considered
* stable. We don't warn if users have these in `experimental-features`.
*/
std::set<std::string> stabilizedFeatures{"flakes"};
const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name)
{
using ReverseXpMap = std::map<std::string_view, ExperimentalFeature>;

View file

@ -19,7 +19,6 @@ enum struct ExperimentalFeature
{
CaDerivations,
ImpureDerivations,
Flakes,
FetchTree,
NixCommand,
GitHashing,
@ -38,6 +37,8 @@ enum struct ExperimentalFeature
VerifiedFetches,
};
extern std::set<std::string> stabilizedFeatures;
/**
* Just because writing `ExperimentalFeature::CaDerivations` is way too long
*/