aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/call-flake.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-02 19:04:33 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-02 19:04:33 +0200
commita6ff66b658b61aef80d936f0183447fe4cb46000 (patch)
tree4ffc21b36ff043f720fb5d00a8bde34f97f14cf9 /src/libexpr/flake/call-flake.nix
parent78ad5b3d91507427fa563f3474dc52da608ad224 (diff)
Respect the narHash attribute in more input types
call-flake.nix now passes node.info.narHash to fetchTree. This ensures that dirty Git trees work even in pure mode.
Diffstat (limited to 'src/libexpr/flake/call-flake.nix')
-rw-r--r--src/libexpr/flake/call-flake.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/flake/call-flake.nix b/src/libexpr/flake/call-flake.nix
index b9088e550..dc9ed357c 100644
--- a/src/libexpr/flake/call-flake.nix
+++ b/src/libexpr/flake/call-flake.nix
@@ -8,7 +8,10 @@ let
builtins.mapAttrs
(key: node:
let
- sourceInfo = if key == lockFile.root then rootSrc else fetchTree (removeAttrs node.locked ["dir"]);
+ sourceInfo =
+ if key == lockFile.root
+ then rootSrc
+ else fetchTree ({ inherit (node.info) narHash; } // removeAttrs node.locked ["dir"]);
subdir = if key == lockFile.root then rootSubdir else node.locked.dir or "";
flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
inputs = builtins.mapAttrs (inputName: key: allNodes.${key}) (node.inputs or {});