!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
@emilazy:matrix.orgemilyso I thought it was worth raising again because it seemed to have been bikeshedded into a radix conversion function that wouldn't work to implement the built-in and stalled out16:17:07
@k900:0upti.meK900Man this is so cursed16:17:36
@emilazy:matrix.orgemilyI guess there is no other way to produce an SRI or Base32 hash of a string in Nix currently, e.g.16:17:40
@k900:0upti.meK900Literally none of those uses of convertHash are valid16:17:45
@emilazy:matrix.orgemilyor if you want to convert an SRI hash into a Base16 one for generating a specific lock file format or something16:18:19
@raitobezarius:matrix.orgraitobezariusI mean I get it if you store your lockfile in a certain format and you want to feed it to Nix FODs16:18:27
@emilazy:matrix.orgemily especially if sha256 etc. are deprecated in favour of hash for fetchers 16:18:37
@k900:0upti.meK900 You can just do sha256:<foo> 16:18:38
@raitobezarius:matrix.orgraitobezariusBut making this a primitive in builtins is… well… :)16:18:41
@emilazy:matrix.orgemilywhich people have wanted to do for a while16:18:43
@k900:0upti.meK900 Which is a valid outputHash 16:18:48
@k900:0upti.meK900As in it works everywhere SRI works16:18:53
@emilazy:matrix.orgemilyI think there is a desire to standardize on SRI exclusively in Nixpkgs16:19:03
@k900:0upti.meK900I think this is a non-issue _for generated code-16:19:16
@k900:0upti.meK900 I think this is a non-issue for generated code 16:19:18
@k900:0upti.meK900Or generated drvs16:19:21
@raitobezarius:matrix.orgraitobezarius From what I see, it's doubly problematic that people have already started doing builtins.convertHash instead of lib.convertHash 16:19:35
@emilazy:matrix.orgemily https://github.com/NixOS/nixpkgs/commit/1cf3103bcaf3b45aed2e8e0801f96207d2e98745 seems like a legitimate use case since it is required to match the filename format for passAsFile? 16:20:24
@emilazy:matrix.orgemilythough admittedly I don't know if there are stability guarantees on that format16:20:31
@raitobezarius:matrix.orgraitobezariusOf an absolutely undocumented thing16:20:34
@raitobezarius:matrix.orgraitobezarius Now, we made public and visible the mechanism for .attr- filenames 16:20:48
@emilazy:matrix.orgemilyright. but it still does not seem that weird to want to compute it16:20:59
@raitobezarius:matrix.orgraitobezariusYeah, but we are mixing up multiple concerns16:21:24
@raitobezarius:matrix.orgraitobezariusThere's the overall desire of doing what the OP of that change is doing16:21:32
@raitobezarius:matrix.orgraitobezariusAnd what convertHash should be and how should it serve16:21:39
@emilazy:matrix.orgemily the brew-nix use was admittedly pretty trivial https://github.com/BatteredBunny/brew-nix/commit/88a94a007fc212a04784a3dc0aab6692f405251a 16:21:44
@emilazy:matrix.orgemily 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:matrix.orgraitobezarius

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:matrix.orgraitobezarius It's going to be crucial that convertHash exist in nixpkgs 16:22:10
@emilazy:matrix.orgemilygiven it is another quirky non-standard format vs. SRI16:22:11

Show newer messages


Back to Room ListRoom Version: 10