@@ -133,7 +133,10 @@ MixFlakeOptions::MixFlakeOptions()
133133 lockFlags.writeLockFile = false ;
134134 lockFlags.inputOverrides .insert_or_assign (
135135 flake::parseInputAttrPath (inputAttrPath),
136- parseFlakeRef (fetchSettings, flakeRef, absPath (getCommandBaseDir ()), true ));
136+ parseFlakeRef (
137+ fetchSettings,
138+ flakeRef,
139+ fs::weakly_canonical (getCommandBaseDir ()).string ()));
137140 }},
138141 .completer = {[&](AddCompletions & completions, size_t n, std::string_view prefix) {
139142 if (n == 0 ) {
@@ -176,7 +179,7 @@ MixFlakeOptions::MixFlakeOptions()
176179 auto flake = flake::lockFlake (
177180 flakeSettings,
178181 *evalState,
179- parseFlakeRef (fetchSettings, flakeRef, absPath (getCommandBaseDir ())),
182+ parseFlakeRef (fetchSettings, flakeRef, fs::weakly_canonical (getCommandBaseDir ()). string ( )),
180183 { .writeLockFile = false });
181184 for (auto & [inputName, input] : flake.lockFile .root ->inputs ) {
182185 auto input2 = flake.lockFile .findInput ({inputName}); // resolve 'follows' nodes
@@ -268,7 +271,7 @@ void SourceExprCommand::completeInstallable(AddCompletions & completions, std::s
268271 auto e =
269272 state->parseExprFromFile (
270273 resolveExprPath (
271- lookupFileArg (*state, * file)));
274+ lookupFileArg (*state, file-> string () )));
272275
273276 Value root;
274277 state->eval (e, root);
@@ -501,12 +504,12 @@ Installables SourceExprCommand::parseInstallables(
501504 state->eval (e, *vFile);
502505 }
503506 else if (file) {
504- auto dir = absPath (getCommandBaseDir ());
505- state->evalFile (lookupFileArg (*state, * file, &dir), *vFile);
507+ auto dir = fs::weakly_canonical (getCommandBaseDir ());
508+ state->evalFile (lookupFileArg (*state, file-> string () , &dir), *vFile);
506509 }
507510 else {
508- Path dir = absPath (getCommandBaseDir ());
509- auto e = state->parseExprFromString (*expr, state->rootPath (dir));
511+ auto dir = fs::weakly_canonical (getCommandBaseDir ());
512+ auto e = state->parseExprFromString (*expr, state->rootPath (dir. string () ));
510513 state->eval (e, *vFile);
511514 }
512515
@@ -542,7 +545,9 @@ Installables SourceExprCommand::parseInstallables(
542545
543546 try {
544547 auto [flakeRef, fragment] = parseFlakeRefWithFragment (
545- fetchSettings, std::string { prefix }, absPath (getCommandBaseDir ()));
548+ fetchSettings,
549+ std::string { prefix },
550+ fs::weakly_canonical (getCommandBaseDir ()).string ());
546551 result.push_back (make_ref<InstallableFlake>(
547552 this ,
548553 getEvalState (),
@@ -862,7 +867,7 @@ std::vector<FlakeRef> RawInstallablesCommand::getFlakeRefsForCompletion()
862867 res.push_back (parseFlakeRefWithFragment (
863868 fetchSettings,
864869 expandTilde (i),
865- absPath (getCommandBaseDir ())).first );
870+ fs::weakly_canonical (getCommandBaseDir ()). string ( )).first );
866871 return res;
867872}
868873
@@ -885,7 +890,7 @@ std::vector<FlakeRef> InstallableCommand::getFlakeRefsForCompletion()
885890 parseFlakeRefWithFragment (
886891 fetchSettings,
887892 expandTilde (_installable),
888- absPath (getCommandBaseDir ())).first
893+ fs::weakly_canonical (getCommandBaseDir ()). string ( )).first
889894 };
890895}
891896
0 commit comments