Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
repl.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/expr/eval.hh"
6
7namespace nix {
8
9struct AbstractNixRepl
10{
11 ref<EvalState> state;
12 const Bindings * autoArgs;
13
14 AbstractNixRepl(ref<EvalState> state)
15 : state(state)
16 {
17 }
18
19 virtual ~AbstractNixRepl() {}
20
21 typedef std::vector<std::pair<Value *, std::string>> AnnotatedValues;
22
31 using RunNix = void(const std::string & programName, OsStrings args);
32
38 static std::unique_ptr<AbstractNixRepl> create(
39 const LookupPath & lookupPath,
40 ref<EvalState> state,
41 fun<AnnotatedValues()> getValues,
42 RunNix * runNix = nullptr);
43
44 static ReplExitStatus runSimple(ref<EvalState> evalState, const ValMap & extraEnv);
45
46 virtual void initEnv() = 0;
47
48 virtual ReplExitStatus mainLoop() = 0;
49};
50
51} // namespace nix
Definition attr-set.hh:67
Definition fun.hh:19
Definition ref.hh:58
std::list< OsString > OsStrings
Definition os-string.hh:51
void(const std::string &programName, OsStrings args) RunNix
Definition repl.hh:31
static std::unique_ptr< AbstractNixRepl > create(const LookupPath &lookupPath, ref< EvalState > state, fun< AnnotatedValues()> getValues, RunNix *runNix=nullptr)
Definition repl.cc:962
Definition search-path.hh:16