Remove the nixpkgs.<attr> compatibility hack

Since we've changed a lot of things in the 'nix' command (e.g. rename
'nix run') there is not much point in keeping this around.
This commit is contained in:
Eelco Dolstra 2020-05-06 17:20:23 +02:00
parent 80f4b7b6f8
commit ff394ff206

View file

@ -417,10 +417,6 @@ InstallableFlake::getCursor(EvalState & state, bool useEvalCache)
return res;
}
// FIXME: extend
std::string attrRegex = R"([A-Za-z_][A-Za-z0-9-_+]*)";
static std::regex attrPathRegex(fmt(R"(%1%(\.%1%)*)", attrRegex));
std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
ref<Store> store, std::vector<std::string> ss)
{
@ -449,15 +445,6 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
} else {
for (auto & s : ss) {
if (hasPrefix(s, "nixpkgs.")) {
bool static warned;
warnOnce(warned, "the syntax 'nixpkgs.<attr>' is deprecated; use 'nixpkgs#<attr>' instead");
result.push_back(std::make_shared<InstallableFlake>(*this,
FlakeRef::fromAttrs({{"type", "indirect"}, {"id", "nixpkgs"}}),
Strings{"legacyPackages." + settings.thisSystem.get() + "." + std::string(s, 8)}, Strings{}));
}
else {
std::exception_ptr ex;
try {
@ -492,7 +479,6 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
*/
}
}
}
return result;
}