From 37f96399387a264e0d6de17c904ca9b8f0eafff9 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 4 May 2023 22:12:54 +0200 Subject: [PATCH] libcmd: fix activatable attrpath rewriting --- src/libcmd/activatables.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) {