diff --git a/src/nix/repl.cc b/src/nix/repl.cc index a992d873250..0a452864de7 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -415,6 +415,7 @@ bool NixRepl::processLine(string line) << " :e Open the derivation in $EDITOR\n" << " :i Build derivation, then install result into current profile\n" << " :l Load Nix expression and add it to scope\n" + << " :lh Download and load Nixpkgs commit from GitHub\n" << " :p Evaluate and print expression recursively\n" << " :q Exit nix-repl\n" << " :r Reload all files\n" @@ -435,6 +436,12 @@ bool NixRepl::processLine(string line) loadFile(arg); } + else if (command == ":lh" || command == ":loadhash") { + state->resetFileCache(); + std::string url = "https://github.com/NixOS/nixpkgs/tarball/" + arg; + loadFile(url); + } + else if (command == ":r" || command == ":reload") { state->resetFileCache(); reloadFiles();