aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/add-to-store.cc14
-rw-r--r--src/nix/prefetch.cc8
-rw-r--r--src/nix/profile.cc15
3 files changed, 28 insertions, 9 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index 5168413d2..81dbc09a6 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -42,14 +42,18 @@ struct CmdAddToStore : MixDryRun, StoreCommand
}
ValidPathInfo info {
- store->makeFixedOutputPath(ingestionMethod, hash, *namePart),
+ *store,
+ std::move(*namePart),
+ FixedOutputInfo {
+ {
+ .method = std::move(ingestionMethod),
+ .hash = std::move(hash),
+ },
+ .references = {},
+ },
narHash,
};
info.narSize = sink.s.size();
- info.ca = std::optional { FixedOutputHash {
- .method = ingestionMethod,
- .hash = hash,
- } };
if (!dryRun) {
auto source = StringSource(sink.s);
diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc
index fc3823406..df9933d29 100644
--- a/src/nix/prefetch.cc
+++ b/src/nix/prefetch.cc
@@ -67,7 +67,13 @@ std::tuple<StorePath, Hash> prefetchFile(
the store. */
if (expectedHash) {
hashType = expectedHash->type;
- storePath = store->makeFixedOutputPath(ingestionMethod, *expectedHash, *name);
+ storePath = store->makeFixedOutputPath(*name, FixedOutputInfo {
+ {
+ .method = ingestionMethod,
+ .hash = *expectedHash,
+ },
+ .references = {},
+ });
if (store->isValidPath(*storePath))
hash = expectedHash;
else
diff --git a/src/nix/profile.cc b/src/nix/profile.cc
index 32364e720..345505532 100644
--- a/src/nix/profile.cc
+++ b/src/nix/profile.cc
@@ -199,12 +199,21 @@ struct ProfileManifest
auto narHash = hashString(htSHA256, sink.s);
ValidPathInfo info {
- store->makeFixedOutputPath(FileIngestionMethod::Recursive, narHash, "profile", references),
+ *store,
+ "profile",
+ FixedOutputInfo {
+ {
+ .method = FileIngestionMethod::Recursive,
+ .hash = narHash,
+ },
+ .references = {
+ .others = std::move(references),
+ .self = false,
+ },
+ },
narHash,
};
- info.references = std::move(references);
info.narSize = sink.s.size();
- info.ca = FixedOutputHash { .method = FileIngestionMethod::Recursive, .hash = info.narHash };
StringSource source(sink.s);
store->addToStore(info, source);