aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/flake.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 3c75befb9..52c8a122b 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -1065,10 +1065,12 @@ struct CmdFlakeShow : FlakeCommand
attrPath[0] == "defaultPackage"
|| attrPath[0] == "devShell"
|| attrPath[0] == "nixosConfigurations"
- || attrPath[0] == "nixosModules"))
+ || attrPath[0] == "nixosModules"
+ || attrPath[0] == "defaultApp"))
|| ((attrPath.size() == 1 || attrPath.size() == 2)
&& (attrPath[0] == "checks"
- || attrPath[0] == "packages"))
+ || attrPath[0] == "packages"
+ || attrPath[0] == "apps"))
)
{
recurse();
@@ -1106,6 +1108,16 @@ struct CmdFlakeShow : FlakeCommand
}
}
+ else if (
+ (attrPath.size() == 2 && attrPath[0] == "defaultApp") ||
+ (attrPath.size() == 3 && attrPath[0] == "apps"))
+ {
+ auto aType = visitor.maybeGetAttr("type");
+ if (!aType || aType->getString() != "app")
+ throw EvalError("not an app definition");
+ logger->stdout("%s: app", headerPrefix);
+ }
+
else {
logger->stdout("%s: %s",
headerPrefix,