Progress towards REUSE compliance. Change-Id: I0f9d13cb2ceaedab4a1695bd90f57d86ee8cb3e5 Signed-off-by: Raito Bezarius <raito@lix.systems>
40 lines
800 B
C++
40 lines
800 B
C++
// SPDX-FileCopyrightText: 2024 Nix and Lix Authors
|
|
//
|
|
// SPDX-License-Identifier: LGPL-2.1-only
|
|
|
|
#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;
|
|
|
|
static std::unique_ptr<AbstractNixRepl> create(
|
|
const SearchPath & searchPath, nix::ref<Store> store, ref<EvalState> state,
|
|
std::function<AnnotatedValues()> getValues);
|
|
|
|
static ReplExitStatus runSimple(
|
|
ref<EvalState> evalState,
|
|
const ValMap & extraEnv);
|
|
|
|
virtual void initEnv() = 0;
|
|
|
|
virtual ReplExitStatus mainLoop() = 0;
|
|
};
|
|
|
|
}
|