1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Merge branch 'make-flake-show-more-lenient-on-apps' of https://github.com/flox/nix

This commit is contained in:
Eelco Dolstra 2022-04-19 13:41:24 +02:00
commit b529a41814
4 changed files with 43 additions and 0 deletions

View file

@ -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();