From 38663fb4345d8029b18a4eda10945aac02eb2795 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 8 Sep 2025 08:24:26 +0200 Subject: [PATCH] Pass `dir` in extraAttrs when overriding the registry This is handled similarly in the handler for `--override-flake` in `MixEvalArgs`. --- src/libcmd/installables.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 0e6a204a7..96ff06ad3 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -178,10 +178,16 @@ MixFlakeOptions::MixFlakeOptions() for (auto & [inputName, input] : flake.lockFile.root->inputs) { auto input2 = flake.lockFile.findInput({inputName}); // resolve 'follows' nodes if (auto input3 = std::dynamic_pointer_cast(input2)) { + fetchers::Attrs extraAttrs; + + if (!input3->lockedRef.subdir.empty()) { + extraAttrs["dir"] = input3->lockedRef.subdir; + } + overrideRegistry( fetchers::Input::fromAttrs(fetchSettings, {{"type", "indirect"}, {"id", inputName}}), input3->lockedRef.input, - {}); + extraAttrs); } } }},