Merge pull request #6518 from edolstra/fix-nix-develop

nix develop: Find bin/bash in the bashInteractive outputs
This commit is contained in:
Eelco Dolstra 2022-05-10 17:10:13 +02:00 committed by GitHub
commit 73b9b008f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -512,9 +512,20 @@ struct CmdDevelop : Common, MixEnvironment
Strings{"legacyPackages." + settings.thisSystem.get() + "."},
nixpkgsLockFlags);
shell = store->printStorePath(
Installable::toStorePath(getEvalStore(), store, Realise::Outputs, OperateOn::Output, bashInstallable))
+ "/bin/bash";
bool found = false;
for (auto & path : Installable::toStorePaths(getEvalStore(), store, Realise::Outputs, OperateOn::Output, {bashInstallable})) {
auto s = store->printStorePath(path) + "/bin/bash";
if (pathExists(s)) {
shell = s;
found = true;
break;
}
}
if (!found)
throw Error("package 'nixpkgs#bashInteractive' does not provide a 'bin/bash'");
} catch (Error &) {
ignoreException();
}