#pragma once #include "installables.hh" namespace nix { struct App { std::vector context; Path program; // FIXME: add args, sandbox settings, metadata, ... }; struct UnresolvedApp { App unresolved; App resolve(ref evalStore, ref store); }; struct InstallableValue : Installable { ref state; InstallableValue(ref state) : state(state) {} virtual std::pair toValue(EvalState & state) = 0; /* Get a cursor to each value this Installable could refer to. However if none exists, throw exception instead of returning empty vector. */ virtual std::vector> getCursors(EvalState & state); /* Get the first and most preferred cursor this Installable could refer to, or throw an exception if none exists. */ virtual ref getCursor(EvalState & state); UnresolvedApp toApp(EvalState & state); static InstallableValue & require(Installable & installable); static ref require(ref installable); }; }