diff --git a/src/nix/profile.cc b/src/nix/profile.cc index 6ea529f52..8ff0e4dd9 100644 --- a/src/nix/profile.cc +++ b/src/nix/profile.cc @@ -126,9 +126,11 @@ struct ProfileManifest StringSink sink; dumpPath(tempDir, sink); - ValidPathInfo info(store->makeFixedOutputPath(true, info.narHash, "profile", references)); + auto narHash = hashString(htSHA256, *sink.s); + + ValidPathInfo info(store->makeFixedOutputPath(true, narHash, "profile", references)); info.references = std::move(references); - info.narHash = hashString(htSHA256, *sink.s); + info.narHash = narHash; info.narSize = sink.s->size(); info.ca = makeFixedOutputCA(true, info.narHash);