@@ -131,7 +131,10 @@ MixFlakeOptions::MixFlakeOptions()
131131 lockFlags.writeLockFile = false ;
132132 lockFlags.inputOverrides .insert_or_assign (
133133 flake::parseInputAttrPath (inputAttrPath),
134- parseFlakeRef (fetchSettings, flakeRef, absPath (getCommandBaseDir ()), true ));
134+ parseFlakeRef (
135+ fetchSettings,
136+ flakeRef,
137+ std::filesystem::weakly_canonical (getCommandBaseDir ()).string ()));
135138 }},
136139 .completer = {[&](AddCompletions & completions, size_t n, std::string_view prefix) {
137140 if (n == 0 ) {
@@ -174,7 +177,7 @@ MixFlakeOptions::MixFlakeOptions()
174177 auto flake = flake::lockFlake (
175178 flakeSettings,
176179 *evalState,
177- parseFlakeRef (fetchSettings, flakeRef, absPath (getCommandBaseDir ())),
180+ parseFlakeRef (fetchSettings, flakeRef, std::filesystem::weakly_canonical (getCommandBaseDir ()). string ( )),
178181 { .writeLockFile = false });
179182 for (auto & [inputName, input] : flake.lockFile .root ->inputs ) {
180183 auto input2 = flake.lockFile .findInput ({inputName}); // resolve 'follows' nodes
@@ -266,7 +269,7 @@ void SourceExprCommand::completeInstallable(AddCompletions & completions, std::s
266269 auto e =
267270 state->parseExprFromFile (
268271 resolveExprPath (
269- lookupFileArg (*state, * file)));
272+ lookupFileArg (*state, file-> string () )));
270273
271274 Value root;
272275 state->eval (e, root);
@@ -503,12 +506,12 @@ Installables SourceExprCommand::parseInstallables(
503506 state->eval (e, *vFile);
504507 }
505508 else if (file) {
506- auto dir = absPath (getCommandBaseDir ());
507- state->evalFile (lookupFileArg (*state, * file, &dir), *vFile);
509+ auto dir = std::filesystem::weakly_canonical (getCommandBaseDir ());
510+ state->evalFile (lookupFileArg (*state, file-> string () , &dir), *vFile);
508511 }
509512 else {
510- Path dir = absPath (getCommandBaseDir ());
511- auto e = state->parseExprFromString (*expr, state->rootPath (dir));
513+ auto dir = std::filesystem::weakly_canonical (getCommandBaseDir ());
514+ auto e = state->parseExprFromString (*expr, state->rootPath (dir. string () ));
512515 state->eval (e, *vFile);
513516 }
514517
@@ -544,7 +547,9 @@ Installables SourceExprCommand::parseInstallables(
544547
545548 try {
546549 auto [flakeRef, fragment] = parseFlakeRefWithFragment (
547- fetchSettings, std::string { prefix }, absPath (getCommandBaseDir ()));
550+ fetchSettings,
551+ std::string { prefix },
552+ std::filesystem::weakly_canonical (getCommandBaseDir ()).string ());
548553 result.push_back (make_ref<InstallableFlake>(
549554 this ,
550555 getEvalState (),
@@ -864,7 +869,7 @@ std::vector<FlakeRef> RawInstallablesCommand::getFlakeRefsForCompletion()
864869 res.push_back (parseFlakeRefWithFragment (
865870 fetchSettings,
866871 expandTilde (i),
867- absPath (getCommandBaseDir ())).first );
872+ std::filesystem::weakly_canonical (getCommandBaseDir ()). string ( )).first );
868873 return res;
869874}
870875
@@ -887,7 +892,7 @@ std::vector<FlakeRef> InstallableCommand::getFlakeRefsForCompletion()
887892 parseFlakeRefWithFragment (
888893 fetchSettings,
889894 expandTilde (_installable),
890- absPath (getCommandBaseDir ())).first
895+ std::filesystem::weakly_canonical (getCommandBaseDir ()). string ( )).first
891896 };
892897}
893898
0 commit comments