nix flake check: Warn about deprecated flake outputs

This commit is contained in:
Eelco Dolstra 2022-02-22 14:19:39 +01:00
parent 162fbe31ff
commit d4428d00ae

View file

@ -501,6 +501,17 @@ struct CmdFlakeCheck : FlakeCommand
state->forceValue(vOutput, pos);
std::string_view replacement =
name == "defaultPackage" ? "packages.<system>.default" :
name == "defaultApps" ? "apps.<system>.default" :
name == "defaultTemplate" ? "templates.default" :
name == "defaultBundler" ? "bundlers.<system>.default" :
name == "overlay" ? "overlays.default" :
name == "devShell" ? "devShells.<system>.default" :
"";
if (replacement != "")
warn("flake output attribute '%s' is deprecated; use '%s' instead", name, replacement);
if (name == "checks") {
state->forceAttrs(vOutput, pos);
for (auto & attr : *vOutput.attrs) {