Nix 2.26.3
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 "eval.hh"
5
6namespace nix {
7
8struct AbstractNixRepl
9{
10 ref<EvalState> state;
11 Bindings * autoArgs;
12
13 AbstractNixRepl(ref<EvalState> state)
14 : state(state)
15 { }
16
17 virtual ~AbstractNixRepl()
18 { }
19
20 typedef std::vector<std::pair<Value*,std::string>> AnnotatedValues;
21
22 using RunNix = void(Path program, const Strings & args, const std::optional<std::string> & input);
23
29 static std::unique_ptr<AbstractNixRepl> create(
30 const LookupPath & lookupPath,
32 ref<EvalState> state,
33 std::function<AnnotatedValues()> getValues,
34 RunNix * runNix = nullptr);
35
36 static ReplExitStatus runSimple(
37 ref<EvalState> evalState,
38 const ValMap & extraEnv);
39
40 virtual void initEnv() = 0;
41
42 virtual ReplExitStatus mainLoop() = 0;
43};
44
45}
Definition attr-set.hh:48
Definition ref.hh:15
ChunkedVector< std::string, 8192 > store
Definition lexer.l:1011
std::vector< Expr * > args
Definition lexer.l:6126
static std::unique_ptr< AbstractNixRepl > create(const LookupPath &lookupPath, nix::ref< Store > store, ref< EvalState > state, std::function< AnnotatedValues()> getValues, RunNix *runNix=nullptr)
Definition repl.cc:833
Definition search-path.hh:16
std::string Path
Definition types.hh:22