1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Only provide builtin.{getFlake,fetchClosure} is the corresponding experimental feature is enabled

This allows writing fallback code like

  if builtins ? fetchClosure then
    builtins.fetchClose { ... }
  else
    builtins.storePath ...
This commit is contained in:
Eelco Dolstra 2022-03-25 14:04:18 +01:00
parent 55bc524019
commit 86b05ccd54
8 changed files with 31 additions and 39 deletions

View file

@ -7,8 +7,6 @@ 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;
@ -145,8 +143,12 @@ static RegisterPrimOp primop_fetchClosure({
specifying a binary cache from which the path can be fetched.
Also, requiring a content-addressed final store path avoids the
need for users to configure binary cache public keys.
This function is only available if you enable the experimental
feature `fetch-closure`.
)",
.fun = prim_fetchClosure,
.experimentalFeature = Xp::FetchClosure,
});
}