1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00

Pluggable fetchers

Flakes are now fetched using an extensible mechanism. Also lots of
other flake cleanups.
This commit is contained in:
Eelco Dolstra 2020-01-21 16:27:53 +01:00
parent 1bf9eb21b7
commit 9f4d8c6170
34 changed files with 1613 additions and 1298 deletions

View file

@ -20,10 +20,6 @@ class EvalState;
struct StorePath;
enum RepairFlag : bool;
namespace flake {
struct FlakeRegistry;
}
typedef void (* PrimOpFun) (EvalState & state, const Pos & pos, Value * * args, Value & v);
@ -67,8 +63,6 @@ typedef std::list<SearchPathElem> SearchPath;
/* Initialise the Boehm GC, if applicable. */
void initGC();
typedef std::vector<std::pair<std::string, std::string>> RegistryOverrides;
class EvalState
{
@ -95,8 +89,6 @@ public:
const ref<Store> store;
RegistryOverrides registryOverrides;
private:
SrcToStore srcToStore;
@ -224,8 +216,6 @@ public:
path. Nothing is copied to the store. */
Path coerceToPath(const Pos & pos, Value & v, PathSet & context);
void addRegistryOverrides(RegistryOverrides overrides) { registryOverrides = overrides; }
public:
/* The base environment, containing the builtin functions and
@ -328,16 +318,6 @@ private:
friend struct ExprOpConcatLists;
friend struct ExprSelect;
friend void prim_getAttr(EvalState & state, const Pos & pos, Value * * args, Value & v);
public:
const std::vector<std::shared_ptr<flake::FlakeRegistry>> getFlakeRegistries();
std::shared_ptr<flake::FlakeRegistry> getGlobalFlakeRegistry();
private:
std::shared_ptr<flake::FlakeRegistry> _globalFlakeRegistry;
std::once_flag _globalFlakeRegistryInit;
};
@ -388,15 +368,6 @@ struct EvalSettings : Config
Setting<bool> traceFunctionCalls{this, false, "trace-function-calls",
"Emit log messages for each function entry and exit at the 'vomit' log level (-vvvv)."};
Setting<std::string> flakeRegistry{this, "https://github.com/NixOS/flake-registry/raw/master/flake-registry.json", "flake-registry",
"Path or URI of the global flake registry."};
Setting<bool> allowDirty{this, true, "allow-dirty",
"Whether to allow dirty Git/Mercurial trees."};
Setting<bool> warnDirty{this, true, "warn-dirty",
"Whether to warn about dirty Git/Mercurial trees."};
};
extern EvalSettings evalSettings;