nix icon indicating copy to clipboard operation
nix copied to clipboard

Split out a new `Base` from `HashFormat`

Open Ericson2314 opened this issue 1 month ago • 3 comments

Motivation

This allows for better separation of concerns, and will allow better modeling of some things.

Context

Depends on #14720

I am not sure whether the *Display functions, to preserve existing behavior, are worth it!


Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Ericson2314 avatar Dec 05 '25 22:12 Ericson2314

This allows for better separation of concerns, and will allow better modeling of some things.

Sorry but the motivation has to be stronger than "better separation of concerns" (what concerns? what things do we want to model better?). This isn't Haskell, we don't need to model everything in the type system.

I can't really see how writing std::holds_alternative<HashFormatSRI>(hf->raw) is in any way preferable to hf == nix::HashFormat::SRI.

"Base encoding" doesn't feel like a correct term. We're not encoding a base here, we're encoding a hash.

edolstra avatar Dec 08 '25 11:12 edolstra

:tada: All dependencies have been resolved !

dpulls[bot] avatar Dec 08 '25 12:12 dpulls[bot]

If we're not doing structured JSON formats for hash, that removes one of the immediate needs I had for this. Drafting, accordingly.

Ericson2314 avatar Dec 09 '25 18:12 Ericson2314