aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-04-19 20:48:13 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-04-19 20:48:13 +0200
commitc9e58aa5ff75351a5bb5af1258e019beef13721a (patch)
treee4e34b38c2f26edef98b3ad24c9b62105277e0e6 /src/nix
parent48a467f2b960623d133978f4f5546882cd37523c (diff)
Require formatters to be packages
Because of 9b41239d8fdcc3fe50febe718c15833ebc224354, a formatter can no longer be a package *or* an app. So let's require it to be a package for now.
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/app.cc4
-rw-r--r--src/nix/flake.cc3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/nix/app.cc b/src/nix/app.cc
index 6b6b31a12..df7303e15 100644
--- a/src/nix/app.cc
+++ b/src/nix/app.cc
@@ -35,7 +35,7 @@ struct InstallableDerivedPath : Installable
/**
* Return the rewrites that are needed to resolve a string whose context is
- * included in `dependencies`
+ * included in `dependencies`.
*/
StringPairs resolveRewrites(Store & store, const BuiltPaths dependencies)
{
@@ -51,7 +51,7 @@ StringPairs resolveRewrites(Store & store, const BuiltPaths dependencies)
}
/**
- * Resolve the given string assuming the given context
+ * Resolve the given string assuming the given context.
*/
std::string resolveString(Store & store, const std::string & toResolve, const BuiltPaths dependencies)
{
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index dbd157248..04b23ed0f 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -1038,7 +1038,7 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
}
else if (
- (attrPath.size() == 2 && (attrPath[0] == "defaultPackage" || attrPath[0] == "devShell"))
+ (attrPath.size() == 2 && (attrPath[0] == "defaultPackage" || attrPath[0] == "devShell" || attrPath[0] == "formatter"))
|| (attrPath.size() == 3 && (attrPath[0] == "checks" || attrPath[0] == "packages" || attrPath[0] == "devShells"))
)
{
@@ -1071,7 +1071,6 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
else if (
(attrPath.size() == 2 && attrPath[0] == "defaultApp") ||
- (attrPath.size() == 2 && attrPath[0] == "formatter") ||
(attrPath.size() == 3 && attrPath[0] == "apps"))
{
auto aType = visitor.maybeGetAttr("type");