Merge pull request #15046 from juhp/patch-3

nix config check: improve error when no nix-env in PATH
This commit is contained in:
John Ericson
2026-01-22 05:31:05 +00:00
committed by GitHub

View File

@@ -95,7 +95,9 @@ struct CmdConfigCheck : StoreCommand
dirs.insert(std::filesystem::canonical(candidate).parent_path());
}
if (dirs.size() != 1) {
if (dirs.empty()) {
return checkFail("No nix-env found in PATH.");
} else if (dirs.size() > 1) {
std::ostringstream ss;
ss << "Multiple versions of nix found in PATH:\n";
for (auto & dir : dirs)