aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-05-28 12:13:13 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-05-28 12:13:13 +0200
commit6286272371434dc597da793417787ecd3cb14cc9 (patch)
treeb3a8414fd6ad4ae7a082214bbae735150767fae1
parent04fb4e8a0fb5bae0d70838b08e70c3cdbb233bb2 (diff)
nixpkgsFlakeRef(): Use locked nixpkgs
-rw-r--r--src/nix/installables.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 21fd54f64..fde1ca7aa 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -503,9 +503,12 @@ FlakeRef InstallableFlake::nixpkgsFlakeRef() const
{
auto lockedFlake = getLockedFlake();
- auto nixpkgsInput = lockedFlake->flake.inputs.find("nixpkgs");
- if (nixpkgsInput != lockedFlake->flake.inputs.end()) {
- return std::move(nixpkgsInput->second.ref);
+ auto nixpkgsInput = lockedFlake->lockFile.root->inputs.find("nixpkgs");
+ if (nixpkgsInput != lockedFlake->lockFile.root->inputs.end()) {
+ if (auto lockedNode = std::dynamic_pointer_cast<const flake::LockedNode>(nixpkgsInput->second)) {
+ debug("using nixpkgs flake '%s'", lockedNode->lockedRef);
+ return std::move(lockedNode->lockedRef);
+ }
}
return Installable::nixpkgsFlakeRef();