mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Merge pull request #36 from DeterminateSystems/deprecate-channel-urls
Warn about the use of channel URLs
This commit is contained in:
commit
97487c58a1
1 changed files with 12 additions and 4 deletions
|
@ -84,9 +84,17 @@ bool EvalSettings::isPseudoUrl(std::string_view s)
|
|||
|
||||
std::string EvalSettings::resolvePseudoUrl(std::string_view url)
|
||||
{
|
||||
if (hasPrefix(url, "channel:"))
|
||||
return "https://nixos.org/channels/" + std::string(url.substr(8)) + "/nixexprs.tar.xz";
|
||||
else
|
||||
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.",
|
||||
url, realUrl);
|
||||
return realUrl;
|
||||
} else
|
||||
return std::string(url);
|
||||
}
|
||||
|
||||
|
@ -103,4 +111,4 @@ Path getNixDefExpr()
|
|||
: getHome() + "/.nix-defexpr";
|
||||
}
|
||||
|
||||
} // namespace nix
|
||||
} // namespace nix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue