mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
parent
5fcf7f04a9
commit
05081bedc1
4 changed files with 30 additions and 26 deletions
|
@ -359,6 +359,7 @@ static void main_nix_build(int argc, char * * argv)
|
|||
is not set, then build bashInteractive from
|
||||
<nixpkgs>. */
|
||||
auto shell = getEnv("NIX_BUILD_SHELL");
|
||||
std::optional<StorePath> shellDrv;
|
||||
|
||||
if (!shell) {
|
||||
|
||||
|
@ -375,8 +376,7 @@ static void main_nix_build(int argc, char * * argv)
|
|||
auto bashDrv = store->parseStorePath(drv->queryDrvPath());
|
||||
pathsToBuild.push_back({bashDrv});
|
||||
pathsToCopy.insert(bashDrv);
|
||||
|
||||
shell = drv->queryOutPath() + "/bin/bash";
|
||||
shellDrv = bashDrv;
|
||||
|
||||
} catch (Error & e) {
|
||||
logError(e.info());
|
||||
|
@ -402,6 +402,11 @@ static void main_nix_build(int argc, char * * argv)
|
|||
|
||||
if (dryRun) return;
|
||||
|
||||
if (shellDrv) {
|
||||
auto shellDrvOutputs = store->queryPartialDerivationOutputMap(shellDrv.value());
|
||||
shell = store->printStorePath(shellDrvOutputs.at("out").value()) + "/bin/bash";
|
||||
}
|
||||
|
||||
if (settings.isExperimentalFeatureEnabled(Xp::CaDerivations)) {
|
||||
auto resolvedDrv = drv.tryResolve(*store);
|
||||
assert(resolvedDrv && "Successfully resolved the derivation");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue