1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Add docs/rl-notes for nix hash convert / builtins.convertHash

https://github.com/NixOS/nix/issues/8876
This commit is contained in:
Peter Kolloch 2023-11-28 19:02:15 +01:00
parent 7ff876b92b
commit 8afeaf05c4
4 changed files with 74 additions and 5 deletions

View file

@ -1339,7 +1339,7 @@ drvName, Bindings * attrs, Value & v)
.errPos = state.positions[noPos]
});
auto ht = parseHashAlgoOpt(outputHashAlgo).value_or(HashAlgorithm::SHA256);
auto ha = parseHashAlgoOpt(outputHashAlgo).value_or(HashAlgorithm::SHA256);
auto method = ingestionMethod.value_or(FileIngestionMethod::Recursive);
for (auto & i : outputs) {
@ -1348,13 +1348,13 @@ drvName, Bindings * attrs, Value & v)
drv.outputs.insert_or_assign(i,
DerivationOutput::Impure {
.method = method,
.hashAlgo = ht,
.hashAlgo = ha,
});
else
drv.outputs.insert_or_assign(i,
DerivationOutput::CAFloating {
.method = method,
.hashAlgo = ht,
.hashAlgo = ha,
});
}
}
@ -3837,7 +3837,7 @@ static RegisterPrimOp primop_convertHash({
The format of the resulting hash. Must be one of
- `"base16"`
- `"base32"`
- `"nix32"`
- `"base64"`
- `"sri"`

View file

@ -118,7 +118,7 @@ struct CmdToBase : Command
std::string description() override
{
return fmt("convert a hash to %s representation",
return fmt("convert a hash to %s representation (deprecated, use `nix hash convert` instead)",
hashFormat == HashFormat::Base16 ? "base-16" :
hashFormat == HashFormat::Nix32 ? "base-32" :
hashFormat == HashFormat::Base64 ? "base-64" :