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:
commit
b529a41814
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