mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
nix-env: Load files in ~/.nix-defexpr on demand
So if you do "nix-env -qa -A nixos", then other channels won't be parsed/evaluated at all.
This commit is contained in:
parent
c57ed84e28
commit
07a08bddf0
3 changed files with 18 additions and 3 deletions
|
@ -222,6 +222,12 @@ void EvalState::addPrimOp(const string & name,
|
|||
}
|
||||
|
||||
|
||||
void EvalState::getBuiltin(const string & name, Value & v)
|
||||
{
|
||||
v = *baseEnv.values[0]->attrs->find(symbols.create(name))->value;
|
||||
}
|
||||
|
||||
|
||||
/* Every "format" object (even temporary) takes up a few hundred bytes
|
||||
of stack space, which is a real killer in the recursive
|
||||
evaluator. So here are some helper functions for throwing
|
||||
|
|
|
@ -203,6 +203,12 @@ private:
|
|||
void addPrimOp(const string & name,
|
||||
unsigned int arity, PrimOpFun primOp);
|
||||
|
||||
public:
|
||||
|
||||
void getBuiltin(const string & name, Value & v);
|
||||
|
||||
private:
|
||||
|
||||
inline Value * lookupVar(Env * env, const VarRef & var, bool noEval);
|
||||
|
||||
friend class ExprVar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue