!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

402 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.135 Servers

Load older messages


SenderMessageTime
14 Oct 2025
@raitobezarius:matrix.orgraitobezarius And not in builtins 16:22:13
@raitobezarius:matrix.orgraitobezarius And that users prefer lib.convertHash as we usually recommend to everyone writing code in general 16:22:37
@raitobezarius:matrix.orgraitobezarius I think that having lib.convertHash = if builtins?convertHash then builtins.convertHash else (throw "convertHash is not available yet on all platforms, see <DOC LINK> about caveats and plans."); would be useful now 16:23:25
@emilazy:matrix.orgemily fwiw it seems like Nix is calling the format nix32 these days 16:23:41
@raitobezarius:matrix.orgraitobezariuslet's call it nix3216:23:48
@emilazy:matrix.orgemily I guess it would be something like builtins.fromNixBase32 { payload = …; size = 160; }? 16:23:49
@raitobezarius:matrix.orgraitobezariusI'm not yet totally fixed on the byte sizes stuff, but I am keeping this open16:24:11
@emilazy:matrix.orgemilywell it needs solving to convert hashes properly :)16:24:21
@raitobezarius:matrix.orgraitobezarius builtins.conversions.fromNixBase32 btw 16:24:24
@emilazy:matrix.orgemilyone way or another16:24:25
@raitobezarius:matrix.orgraitobezariusWe are aligned on the goal, I am doing something on the side, so I don't have all the context loaded16:24:42
@raitobezarius:matrix.orgraitobezariusIf sizes are crucial to that goal, np16:24:50
@k900:0upti.meK900tbh I still don't see the value, because like, we can't remove the <algo>:<hex> formats16:24:52
@k900:0upti.meK900And literally everything relevant uses those16:24:57
@k900:0upti.meK900Or SRI16:25:02
@k900:0upti.meK900And we can just keep things using those forever probably16:25:11
@raitobezarius:matrix.orgraitobezariusThe only value I see goes beyond hashes personally16:25:12
@k900:0upti.meK900 convertHash is a massive hammer for a tiny nail 16:25:19
@raitobezarius:matrix.orgraitobezariusI see people who wants to use base32 data inside non-hashes16:25:19
@raitobezarius:matrix.orgraitobezariusFor valid reasons16:25:23
@raitobezarius:matrix.orgraitobezariusIf it ends up constructing convertHash, fine16:25:33
@raitobezarius:matrix.orgraitobezariusBut that's not my sole motive for spawning these primops16:25:49
@emilazy:matrix.orgemily

so Nixpkgs would need

  1. parsing and serialization for SRI and <algo>:<digest> that matches the implementation
  2. a lookup table between hashes and byte sizes

and the code would be Lix-specific (because Nix has chosen that strings cannot contain NUL bytes so the intermediate values would not be valid)

that may be fine

16:26:06
@raitobezarius:matrix.orgraitobezarius I'd say that the code is specific to those who have !(builtins?convertHash) true but idk 16:26:48
@emilazy:matrix.orgemilyif you're going to allow NUL bytes in strings you surely want to be able to handle Base64 etc. in general16:26:52
@raitobezarius:matrix.orgraitobezariusI mean you're right16:26:53
@raitobezarius:matrix.orgraitobezariusPerhaps, we should advertise NUL in our bytes lol16:27:01
@emilazy:matrix.orgemilyNix32 on the other hand is cursed16:27:02
@k900:0upti.meK900 That's a much later problem tbh 16:27:02
@raitobezarius:matrix.orgraitobezarius builtins.features.canContainNULInStrings 16:27:06

Show newer messages


Back to Room ListRoom Version: 10