aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-19 18:41:33 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-19 19:32:29 +0000
commit20799a5151cbb185c1772b8e5160493b2dc2d0e8 (patch)
tree9eeec94504608c40e9ca77ad396b44bec77224a4 /src/nix
parent984e521392b3f41f7cdab203e5c00f3e00e27a28 (diff)
WIP: Make Hash always store a valid hash type
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/add-to-store.cc4
-rw-r--r--src/nix/develop.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index f43f774c1..0dda2af38 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -46,9 +46,9 @@ struct CmdAddToStore : MixDryRun, StoreCommand
auto narHash = hashString(htSHA256, *sink.s);
ValidPathInfo info(store->makeFixedOutputPath(FileIngestionMethod::Recursive, narHash, *namePart));
- info.narHash = narHash;
+ *info.narHash = narHash;
info.narSize = sink.s->size();
- info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, info.narHash);
+ info.ca = makeFixedOutputCA(FileIngestionMethod::Recursive, *info.narHash);
if (!dryRun) {
auto source = StringSource { *sink.s };
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index 8b85caf82..4aee9f202 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -139,7 +139,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
.path = shellOutPath,
.hash = DerivationOutputHash {
.method = FileIngestionMethod::Flat,
- .hash = Hash { },
+ .hash = Hash { htSHA256 },
},
});
drv.env["out"] = store->printStorePath(shellOutPath);