diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-04-19 13:41:24 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-04-19 13:41:24 +0200 |
commit | b529a4181444e0c52234b3900b89dc7994d5268f (patch) | |
tree | b97ff44efde20da9d74a04569fbaf0808762d1b8 /src/nix | |
parent | 1b43d646484a1d18d12fcc8912eda4a01d5d3eb6 (diff) | |
parent | 9b41239d8fdcc3fe50febe718c15833ebc224354 (diff) |
Merge branch 'make-flake-show-more-lenient-on-apps' of https://github.com/flox/nix
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/app.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nix/app.cc b/src/nix/app.cc index 55efccdee..bd6988066 100644 --- a/src/nix/app.cc +++ b/src/nix/app.cc @@ -65,6 +65,15 @@ UnresolvedApp Installable::toApp(EvalState & state) auto type = cursor->getAttr("type")->getString(); + std::string expected; + if (hasPrefix(attrPath,"apps.")) { + expected = "app"; + } else { + expected = "derivation"; + } + if (type != expected) { + throw Error("Attribute '%s' should have type '%s'.", attrPath, expected); + } if (type == "app") { auto [program, context] = cursor->getAttr("program")->getStringWithContext(); |