/
ne1ghost
/
nix
Обзор
Документация
Войти
/
ne1ghost
/
nix
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/libcmd/repl.hh
45 строк
1 KB
John Ericson
Move `NIX_BIN_DIR` and all logic using it to the Nix executable itself
12 авг 2024, 19:29
12 авг 2024, 19:29
58b03ef
Код
Авторство
О чём код?
#pragma once ///@file #include "eval.hh" namespace nix { struct AbstractNixRepl { ref<EvalState> state; Bindings * autoArgs; AbstractNixRepl(ref<EvalState> state) : state(state) { } virtual ~AbstractNixRepl() { } typedef std::vector<std::pair<Value*,std::string>> AnnotatedValues; using RunNix = void(Path program, const Strings & args, const std::optional<std::string> & input); /** * @param runNix Function to run the nix CLI to support various * `:<something>` commands. Optional; if not provided, * everything else will still work fine, but those commands won't. */ static std::unique_ptr<AbstractNixRepl> create( const LookupPath & lookupPath, nix::ref<Store> store, ref<EvalState> state, std::function<AnnotatedValues()> getValues, RunNix * runNix = nullptr); static ReplExitStatus runSimple( ref<EvalState> evalState, const ValMap & extraEnv); virtual void initEnv() = 0; virtual ReplExitStatus mainLoop() = 0; }; }