@@ -1209,17 +1209,17 @@ static void derivationStrictInternal(
1209
1209
auto handleHashMode = [&](const std::string_view s) {
1210
1210
if (s == " recursive" ) {
1211
1211
// back compat, new name is "nar"
1212
- ingestionMethod = FileIngestionMethod ::NixArchive;
1212
+ ingestionMethod = ContentAddressMethod::Raw ::NixArchive;
1213
1213
} else try {
1214
1214
ingestionMethod = ContentAddressMethod::parse (s);
1215
1215
} catch (UsageError &) {
1216
1216
state.error <EvalError>(
1217
1217
" invalid value '%s' for 'outputHashMode' attribute" , s
1218
1218
).atPos (v).debugThrow ();
1219
1219
}
1220
- if (ingestionMethod == TextIngestionMethod {} )
1220
+ if (ingestionMethod == ContentAddressMethod::Raw::Text )
1221
1221
experimentalFeatureSettings.require (Xp::DynamicDerivations);
1222
- if (ingestionMethod == FileIngestionMethod ::Git)
1222
+ if (ingestionMethod == ContentAddressMethod::Raw ::Git)
1223
1223
experimentalFeatureSettings.require (Xp::GitHashing);
1224
1224
};
1225
1225
@@ -1391,7 +1391,7 @@ static void derivationStrictInternal(
1391
1391
1392
1392
/* Check whether the derivation name is valid. */
1393
1393
if (isDerivation (drvName) &&
1394
- !(ingestionMethod == ContentAddressMethod { TextIngestionMethod { } } &&
1394
+ !(ingestionMethod == ContentAddressMethod::Raw::Text &&
1395
1395
outputs.size () == 1 &&
1396
1396
*(outputs.begin ()) == " out" ))
1397
1397
{
@@ -1413,7 +1413,7 @@ static void derivationStrictInternal(
1413
1413
1414
1414
auto h = newHashAllowEmpty (*outputHash, outputHashAlgo);
1415
1415
1416
- auto method = ingestionMethod.value_or (FileIngestionMethod ::Flat);
1416
+ auto method = ingestionMethod.value_or (ContentAddressMethod::Raw ::Flat);
1417
1417
1418
1418
DerivationOutput::CAFixed dof {
1419
1419
.ca = ContentAddress {
@@ -1432,7 +1432,7 @@ static void derivationStrictInternal(
1432
1432
.atPos (v).debugThrow ();
1433
1433
1434
1434
auto ha = outputHashAlgo.value_or (HashAlgorithm::SHA256);
1435
- auto method = ingestionMethod.value_or (FileIngestionMethod ::NixArchive);
1435
+ auto method = ingestionMethod.value_or (ContentAddressMethod::Raw ::NixArchive);
1436
1436
1437
1437
for (auto & i : outputs) {
1438
1438
drv.env [i] = hashPlaceholder (i);
@@ -2208,7 +2208,7 @@ static void prim_toFile(EvalState & state, const PosIdx pos, Value * * args, Val
2208
2208
})
2209
2209
: ({
2210
2210
StringSource s { contents };
2211
- state.store ->addToStoreFromDump (s, name, FileSerialisationMethod::Flat, TextIngestionMethod {} , HashAlgorithm::SHA256, refs, state.repair );
2211
+ state.store ->addToStoreFromDump (s, name, FileSerialisationMethod::Flat, ContentAddressMethod::Raw::Text , HashAlgorithm::SHA256, refs, state.repair );
2212
2212
});
2213
2213
2214
2214
/* Note: we don't need to add `context' to the context of the
@@ -2391,7 +2391,7 @@ static void prim_filterSource(EvalState & state, const PosIdx pos, Value * * arg
2391
2391
" while evaluating the second argument (the path to filter) passed to 'builtins.filterSource'" );
2392
2392
state.forceFunction (*args[0 ], pos, " while evaluating the first argument passed to builtins.filterSource" );
2393
2393
2394
- addPath (state, pos, path.baseName (), path, args[0 ], FileIngestionMethod ::NixArchive, std::nullopt, v, context);
2394
+ addPath (state, pos, path.baseName (), path, args[0 ], ContentAddressMethod::Raw ::NixArchive, std::nullopt, v, context);
2395
2395
}
2396
2396
2397
2397
static RegisterPrimOp primop_filterSource ({
@@ -2454,7 +2454,7 @@ static void prim_path(EvalState & state, const PosIdx pos, Value * * args, Value
2454
2454
std::optional<SourcePath> path;
2455
2455
std::string name;
2456
2456
Value * filterFun = nullptr ;
2457
- ContentAddressMethod method = FileIngestionMethod ::NixArchive;
2457
+ auto method = ContentAddressMethod::Raw ::NixArchive;
2458
2458
std::optional<Hash> expectedHash;
2459
2459
NixStringContext context;
2460
2460
@@ -2470,8 +2470,8 @@ static void prim_path(EvalState & state, const PosIdx pos, Value * * args, Value
2470
2470
state.forceFunction (*(filterFun = attr.value ), attr.pos , " while evaluating the `filter` parameter passed to builtins.path" );
2471
2471
else if (n == " recursive" )
2472
2472
method = state.forceBool (*attr.value , attr.pos , " while evaluating the `recursive` attribute passed to builtins.path" )
2473
- ? FileIngestionMethod ::NixArchive
2474
- : FileIngestionMethod ::Flat;
2473
+ ? ContentAddressMethod::Raw ::NixArchive
2474
+ : ContentAddressMethod::Raw ::Flat;
2475
2475
else if (n == " sha256" )
2476
2476
expectedHash = newHashAllowEmpty (state.forceStringNoCtx (*attr.value , attr.pos , " while evaluating the `sha256` attribute passed to builtins.path" ), HashAlgorithm::SHA256);
2477
2477
else
0 commit comments