nix-shell: Use bashInteractive from <nixpkgs>

This adds about 0.1s to nix-shell runtime in the case where
bashInteractive already exists.

See discussion at https://github.com/NixOS/nixpkgs/issues/27493.
This commit is contained in:
Eelco Dolstra 2017-07-20 13:32:01 +02:00
parent 57a30e101b
commit c94f3d5575
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 54 additions and 13 deletions

View file

@ -292,10 +292,10 @@ bool isVarName(const string & s)
Path NixRepl::getDerivationPath(Value & v) {
DrvInfo drvInfo(state);
if (!getDerivation(state, v, drvInfo, false))
auto drvInfo = getDerivation(state, v, false);
if (!drvInfo)
throw Error("expression does not evaluate to a derivation, so I can't build it");
Path drvPath = drvInfo.queryDrvPath();
Path drvPath = drvInfo->queryDrvPath();
if (drvPath == "" || !state.store->isValidPath(drvPath))
throw Error("expression did not evaluate to a valid derivation");
return drvPath;