mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
fix: ensure apps are apps and packages are packages
This commit is contained in:
parent
646af7325d
commit
9b41239d8f
4 changed files with 43 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue