-
Notifications
You must be signed in to change notification settings - Fork 85
Description
I maintain a package that uses a fixed-output derivation submodule which stores platform-specific hashes as an attribute set in outputHash (example: https://github.com/NixOS/nixpkgs/blob/029b4824cbfc2007f1c5834fc717d4ff3b1d6636/pkgs/by-name/op/opencode/package.nix#L106-L113).
Currently, to update a hash I have to run nix-build <package>.<submodule> --system <platform> and then replace the hashes manually. I saw that many other packages with system-dependent hashes provide a custom update script.
Wouldn't it be possible to detect when the output hash is an attribute set. If so, read the attribute keys (the systems) and update the hashes for all defined systems automatically.
Questions / notes:
- I looked through the code but didn’t find an obvious way to add this. Any pointers on how you’d implement it?
- Is this a niche problem, or something others encounter often?
Thanks for considering — happy to help prototype if you point me to the right place in the code.