mirror of
https://github.com/NixOS/nix.git
synced 2025-12-01 06:31:00 +01:00
Add infra for InputSchemes to be experimental
This commit is contained in:
parent
c816c67eed
commit
bfe1308d3f
3 changed files with 13 additions and 1 deletions
|
|
@ -36,6 +36,7 @@ Input Input::fromURL(const ParsedURL & url, bool requireTree)
|
|||
for (auto & inputScheme : *inputSchemes) {
|
||||
auto res = inputScheme->inputFromURL(url, requireTree);
|
||||
if (res) {
|
||||
experimentalFeatureSettings.require(inputScheme->experimentalFeature());
|
||||
res->scheme = inputScheme;
|
||||
fixupInput(*res);
|
||||
return std::move(*res);
|
||||
|
|
@ -50,6 +51,7 @@ Input Input::fromAttrs(Attrs && attrs)
|
|||
for (auto & inputScheme : *inputSchemes) {
|
||||
auto res = inputScheme->inputFromAttrs(attrs);
|
||||
if (res) {
|
||||
experimentalFeatureSettings.require(inputScheme->experimentalFeature());
|
||||
res->scheme = inputScheme;
|
||||
fixupInput(*res);
|
||||
return std::move(*res);
|
||||
|
|
@ -309,4 +311,9 @@ void InputScheme::clone(const Input & input, const Path & destDir) const
|
|||
throw Error("do not know how to clone input '%s'", input.to_string());
|
||||
}
|
||||
|
||||
std::optional<ExperimentalFeature> InputScheme::experimentalFeature()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue