aboutsummaryrefslogtreecommitdiff
path: root/src/nix/installables.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-31 20:53:23 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-31 21:42:23 +0200
commitccb1bad612e060fc4397d340edc64d18231744b6 (patch)
tree50ae07f56ec9ea653ce5522473c4ec3b474ca684 /src/nix/installables.cc
parent7adb10d29b0041a93d1afeec197bf9af6e8b25b5 (diff)
Allow bare flakerefs as installables
So now $ nix build blender-bin works and builds the default package from that flake. You don't need to add a colon at the end anymore.
Diffstat (limited to 'src/nix/installables.cc')
-rw-r--r--src/nix/installables.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index fe89a6bb4..40248eb5d 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -332,6 +332,10 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
getDefaultFlakeAttrPaths()));
}
+ else if (auto flakeRef = parseFlakeRef(s, true))
+ result.push_back(std::make_shared<InstallableFlake>(*this, s,
+ getDefaultFlakeAttrPaths()));
+
else
result.push_back(std::make_shared<InstallableFlake>(*this, FlakeRef("nixpkgs"), s));
}