Skip to content

Commit a220b6b

Browse files
committed
Fix non-fetchTree pure-eval use of builtins.path
This is a rare combination, and it would have been more relevant before #67, but it is a tested fix nonetheless. (Specifically, for issues like hercules-ci/flake-parts#252) builtins.path had `sha256` since its introduction, so no problem there. This also catches accidental path-based impurities. Flakes are meant to be pure. "path" inputs do ask for trouble, but that doesn't mean we should violate purity. Also note that `fetchTree` will happily use the `narHash` anyway, so this change makes the behavior more consistent between configurations with and without `fetchTree`.
1 parent 9ed2ac1 commit a220b6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let
4545
} else {
4646
})
4747
else if info.type == "path" then
48-
{ outPath = builtins.path { path = info.path; };
48+
{ outPath = builtins.path { path = info.path; sha256 = info.narHash; };
4949
narHash = info.narHash;
5050
}
5151
else if info.type == "tarball" then

0 commit comments

Comments
 (0)