Skip to content

Commit

Permalink
Add experimental feature 'fetch-closure'
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Mar 24, 2022
1 parent e5f7029 commit f902f3c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/libexpr/primops/fetchClosure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace nix {

static void prim_fetchClosure(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
settings.requireExperimentalFeature(Xp::FetchClosure);

state.forceAttrs(*args[0], pos);

std::optional<std::string> fromStoreUrl;
Expand Down
1 change: 1 addition & 0 deletions src/libutil/experimental-features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ std::map<ExperimentalFeature, std::string> stringifiedXpFeatures = {
{ Xp::NixCommand, "nix-command" },
{ Xp::RecursiveNix, "recursive-nix" },
{ Xp::NoUrlLiterals, "no-url-literals" },
{ Xp::FetchClosure, "fetch-closure" },
};

const std::optional<ExperimentalFeature> parseExperimentalFeature(const std::string_view & name)
Expand Down
3 changes: 2 additions & 1 deletion src/libutil/experimental-features.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ enum struct ExperimentalFeature
Flakes,
NixCommand,
RecursiveNix,
NoUrlLiterals
NoUrlLiterals,
FetchClosure,
};

/**
Expand Down
1 change: 1 addition & 0 deletions tests/fetchClosure.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source common.sh

enableFeatures "fetch-closure"
needLocalStore "'--no-require-sigs' can’t be used with the daemon"

clearStore
Expand Down

0 comments on commit f902f3c

Please sign in to comment.