1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Suggest fix

This commit is contained in:
Eelco Dolstra 2025-04-25 16:05:17 +02:00
parent 17a40e5195
commit 797c716f74

View file

@ -85,12 +85,15 @@ bool EvalSettings::isPseudoUrl(std::string_view s)
std::string EvalSettings::resolvePseudoUrl(std::string_view url)
{
if (hasPrefix(url, "channel:")) {
auto realUrl = "https://nixos.org/channels/" + std::string(url.substr(8)) + "/nixexprs.tar.xz";
static bool haveWarned = false;
warnOnce(haveWarned,
"Channels are deprecated in favor of flakes in Determinate Nix. "
"Instead of '%s', use '%s'. "
"For a guide on Nix flakes, see: https://zero-to-nix.com/. "
"For details and to offer feedback on the deprecation process, see: https://github.com/DeterminateSystems/nix-src/issues/34.");
return "https://nixos.org/channels/" + std::string(url.substr(8)) + "/nixexprs.tar.xz";
"For details and to offer feedback on the deprecation process, see: https://github.com/DeterminateSystems/nix-src/issues/34.",
url, realUrl);
return realUrl;
} else
return std::string(url);
}