aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Bereknyei <tomberek@gmail.com>2022-03-11 13:52:08 -0500
committerTom Bereknyei <tomberek@gmail.com>2022-05-18 21:21:38 -0400
commit1ca3f6035da4e82647382405c774e43e02de3fa1 (patch)
tree94423882b0657ef9ca3a8c6ba4e2737e50a7ec87 /src
parent5640b528349c43717aa501797a4f337373ebf3e4 (diff)
repl: update docs with installables
Diffstat (limited to 'src')
-rw-r--r--src/nix/repl.cc16
-rw-r--r--src/nix/repl.md2
2 files changed, 4 insertions, 14 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index b5ecc8ad0..ac0f1f4d7 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -73,7 +73,6 @@ struct NixRepl
StorePath getDerivationPath(Value & v);
bool processLine(std::string line);
- void loadInstallable(Installable & installable);
void loadFile(const Path & path);
void loadFlake(const std::string & flakeRef);
void initEnv();
@@ -634,12 +633,6 @@ bool NixRepl::processLine(std::string line)
return true;
}
-void NixRepl::loadInstallable(Installable & installable)
-{
- auto [val, pos] = installable.toValue(*state);
- addAttrsToScope(*val);
-}
-
void NixRepl::loadFile(const Path & path)
{
loadedFiles.remove(path);
@@ -899,6 +892,9 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
struct CmdRepl : InstallablesCommand
{
+ CmdRepl(){
+ evalSettings.pureEval = false;
+ }
std::vector<std::string> files;
Strings getDefaultFlakeAttrPaths()
override {
@@ -908,10 +904,6 @@ struct CmdRepl : InstallablesCommand
return file.has_value() or expr.has_value();
}
- CmdRepl()
- {
- }
-
std::string description() override
{
return "start an interactive environment for evaluating Nix expressions";
@@ -926,8 +918,6 @@ struct CmdRepl : InstallablesCommand
void run(ref<Store> store) override
{
-
- evalSettings.pureEval = false;
auto state = getEvalState();
auto repl = std::make_unique<NixRepl>(searchPath, openStore(),state
,[&]()->NixRepl::AnnotatedValues{
diff --git a/src/nix/repl.md b/src/nix/repl.md
index be1498e5b..6a526f7d0 100644
--- a/src/nix/repl.md
+++ b/src/nix/repl.md
@@ -48,7 +48,7 @@ R""(
nix-repl> :q
- # nix repl --expr 'import <nixpkgs>{}' --impure
+ # nix repl --expr 'import <nixpkgs>{}'
Loading Installable ''...
Added 12439 variables.