diff --git a/src/libcmd/activatables.cc b/src/libcmd/activatables.cc index 4cf95e99b..e30487d66 100644 --- a/src/libcmd/activatables.cc +++ b/src/libcmd/activatables.cc @@ -9,11 +9,10 @@ ActivatableCommand::ActivatableCommand(std::string activationPackageAttrPath) { } void ActivatableCommand::run(ref store, ref installable) { - auto _installable = installable; auto installableFlake = installable.dynamic_pointer_cast();; if (installableFlake) { auto fragment = *installableFlake->attrPaths.begin(); - auto _installable = std::make_shared( + auto _installable = make_ref( this, getEvalState(), std::move(installableFlake->flakeRef), @@ -23,8 +22,10 @@ void ActivatableCommand::run(ref store, ref installable) { getDefaultFlakeAttrPathPrefixes(), installableFlake->lockFlags ); + runActivatable(store, _installable); + } else { + runActivatable(store, installable); } - runActivatable(store, _installable); } StorePath ActivatableCommand::buildActivatable(nix::ref store, ref installable, bool dryRun) {