From d4428d00ae05cd21c256f9490c7f089ec04fd962 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 22 Feb 2022 14:19:39 +0100 Subject: [PATCH] nix flake check: Warn about deprecated flake outputs --- src/nix/flake.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 303edb9fe..14a235501 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -501,6 +501,17 @@ struct CmdFlakeCheck : FlakeCommand state->forceValue(vOutput, pos); + std::string_view replacement = + name == "defaultPackage" ? "packages..default" : + name == "defaultApps" ? "apps..default" : + name == "defaultTemplate" ? "templates.default" : + name == "defaultBundler" ? "bundlers..default" : + name == "overlay" ? "overlays.default" : + name == "devShell" ? "devShells..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) {