| 14 Oct 2025 |
raitobezarius | Yeah, but we are mixing up multiple concerns | 16:21:24 |
raitobezarius | There's the overall desire of doing what the OP of that change is doing | 16:21:32 |
raitobezarius | And what convertHash should be and how should it serve | 16:21:39 |
emily | the brew-nix use was admittedly pretty trivial https://github.com/BatteredBunny/brew-nix/commit/88a94a007fc212a04784a3dc0aab6692f405251a | 16:21:44 |
emily | but I am not sure if hash = "sha256:" + …; is going to be considered desirable long-term once sha256 = …; is deprecated in fetchers | 16:21:58 |
raitobezarius | To get progress on convertHash, I can free some time to do:
- {from,to}{NixBase32,Base64,Base16} and see what a
convertHash based on that looks like
| 16:21:59 |
raitobezarius | It's going to be crucial that convertHash exist in nixpkgs | 16:22:10 |
emily | given it is another quirky non-standard format vs. SRI | 16:22:11 |
raitobezarius | And not in builtins | 16:22:13 |
raitobezarius | And that users prefer lib.convertHash as we usually recommend to everyone writing code in general | 16:22:37 |
raitobezarius | 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 |
emily | fwiw it seems like Nix is calling the format nix32 these days | 16:23:41 |
raitobezarius | let's call it nix32 | 16:23:48 |
emily | I guess it would be something like builtins.fromNixBase32 { payload = …; size = 160; }? | 16:23:49 |
raitobezarius | I'm not yet totally fixed on the byte sizes stuff, but I am keeping this open | 16:24:11 |
emily | well it needs solving to convert hashes properly :) | 16:24:21 |
raitobezarius | builtins.conversions.fromNixBase32 btw | 16:24:24 |
emily | one way or another | 16:24:25 |
raitobezarius | We are aligned on the goal, I am doing something on the side, so I don't have all the context loaded | 16:24:42 |
raitobezarius | If sizes are crucial to that goal, np | 16:24:50 |
K900 | tbh I still don't see the value, because like, we can't remove the <algo>:<hex> formats | 16:24:52 |
K900 | And literally everything relevant uses those | 16:24:57 |
K900 | Or SRI | 16:25:02 |
K900 | And we can just keep things using those forever probably | 16:25:11 |
raitobezarius | The only value I see goes beyond hashes personally | 16:25:12 |
K900 | convertHash is a massive hammer for a tiny nail | 16:25:19 |
raitobezarius | I see people who wants to use base32 data inside non-hashes | 16:25:19 |
raitobezarius | For valid reasons | 16:25:23 |
raitobezarius | If it ends up constructing convertHash, fine | 16:25:33 |
raitobezarius | But that's not my sole motive for spawning these primops | 16:25:49 |