aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/installables.cc
diff options
context:
space:
mode:
authorEli Kogan-Wang <elikowa@gmail.com>2022-05-13 22:02:28 +0200
committerEli Kogan-Wang <elikowa@gmail.com>2022-05-13 22:02:28 +0200
commitbe2b19041eeec53fba24f7c2494f3f700a4ec595 (patch)
tree81aae651f6e300c5deb97feb68c8d1695b3fef3d /src/libcmd/installables.cc
parentaefc6c4f41bfac0c76807c234fd0a786dd40f140 (diff)
Integrate review changes
Diffstat (limited to 'src/libcmd/installables.cc')
-rw-r--r--src/libcmd/installables.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index a94e60aca..3f6dfd592 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -609,7 +609,7 @@ InstallableFlake::InstallableFlake(
throw UsageError("'--arg' and '--argstr' are incompatible with flakes");
}
-std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo> InstallableFlake::toDerivation()
+std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo, std::optional<NixInt>> InstallableFlake::toDerivation()
{
auto attr = getCursor(*state);
@@ -621,11 +621,15 @@ std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo> InstallableF
auto drvPath = attr->forceDerivation();
std::set<std::string> outputsToInstall;
+ std::optional<NixInt> priority;
- if (auto aMeta = attr->maybeGetAttr(state->sMeta))
+ if (auto aMeta = attr->maybeGetAttr(state->sMeta)) {
if (auto aOutputsToInstall = aMeta->maybeGetAttr("outputsToInstall"))
for (auto & s : aOutputsToInstall->getListOfStrings())
outputsToInstall.insert(s);
+ if (auto aPriority = aMeta->maybeGetAttr("priority"))
+ priority = aPriority->getInt();
+ }
if (outputsToInstall.empty() || std::get_if<AllOutputs>(&outputsSpec)) {
outputsToInstall.clear();
@@ -643,9 +647,10 @@ std::tuple<std::string, FlakeRef, InstallableValue::DerivationInfo> InstallableF
auto drvInfo = DerivationInfo {
.drvPath = std::move(drvPath),
.outputsToInstall = std::move(outputsToInstall),
+ .priority = priority,
};
- return {attrPath, getLockedFlake()->flake.lockedRef, std::move(drvInfo)};
+ return {attrPath, getLockedFlake()->flake.lockedRef, std::move(drvInfo), priority};
}
std::vector<InstallableValue::DerivationInfo> InstallableFlake::toDerivations()