mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Mark experimental features on settings
We hide them in various ways if the experimental feature isn't enabled. To do this, we had to move the experimental features list out of libnixstore, because the setting machinary itself depends on it. To do that, we made a new `ExperimentalFeatureSettings`.
This commit is contained in:
parent
296831f641
commit
aa663b7e89
3 changed files with 35 additions and 17 deletions
|
@ -195,12 +195,15 @@ public:
|
|||
|
||||
bool overridden = false;
|
||||
|
||||
std::optional<ExperimentalFeature> experimentalFeature;
|
||||
|
||||
protected:
|
||||
|
||||
AbstractSetting(
|
||||
const std::string & name,
|
||||
const std::string & description,
|
||||
const std::set<std::string> & aliases);
|
||||
const std::set<std::string> & aliases,
|
||||
std::optional<ExperimentalFeature> experimentalFeature = std::nullopt);
|
||||
|
||||
virtual ~AbstractSetting()
|
||||
{
|
||||
|
@ -241,8 +244,9 @@ public:
|
|||
const bool documentDefault,
|
||||
const std::string & name,
|
||||
const std::string & description,
|
||||
const std::set<std::string> & aliases = {})
|
||||
: AbstractSetting(name, description, aliases)
|
||||
const std::set<std::string> & aliases = {},
|
||||
std::optional<ExperimentalFeature> experimentalFeature = std::nullopt)
|
||||
: AbstractSetting(name, description, aliases, experimentalFeature)
|
||||
, value(def)
|
||||
, defaultValue(def)
|
||||
, documentDefault(documentDefault)
|
||||
|
@ -297,8 +301,9 @@ public:
|
|||
const std::string & name,
|
||||
const std::string & description,
|
||||
const std::set<std::string> & aliases = {},
|
||||
const bool documentDefault = true)
|
||||
: BaseSetting<T>(def, documentDefault, name, description, aliases)
|
||||
const bool documentDefault = true,
|
||||
std::optional<ExperimentalFeature> experimentalFeature = std::nullopt)
|
||||
: BaseSetting<T>(def, documentDefault, name, description, aliases, experimentalFeature)
|
||||
{
|
||||
options->addSetting(this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue