New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/release.nix: Refactoring for better multi-system support #33749
Conversation
nixos/release.nix
Outdated
@@ -13,6 +13,8 @@ let | |||
|
|||
forAllSystems = genAttrs supportedSystems; | |||
|
|||
forSubsetOfSystems = systems: genAttrs (intersectLists supportedSystems systems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go in release-lib.nix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uff... There's apparently already an equivalent called forAllSupportedSystems
in release-lib.nix, but nixos/release.nix is not importing release-lib.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd a) import it, b) move forAllSystems
to release-lib c) use forAllSupportedSystems
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that seems the best (and forAllSystems
could be implemented in terms of forAllSupportedSystems
to reduce duplication).
I hate the name forAllSupportedSystems
though... given that we have forAllSystems
which does something for every system passed in supportedSystems
... and then forAllSupportedSystems
which does something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem with you renaming them. Maybe something like forAllSystems
and forTheseSystems
?
I'm going to move forAllSystems from nixos/release.nix, and these functions sound too similar while doing different things.
There's already a similar forTheseSystems in release-lib, so be more consistent.
Currently, even if you pass `supportedSystems = [ "aarch64-linux" ]` you end up with e.g. `nixos.iso_graphical.x86_64-linux` job. Using forTheseSystems from release-lib avoids that. This shouldn't affect the usual x86 trunk-combined jobset.
cdf3d7b
to
4ccf308
Compare
Implemented the above suggestions. |
Glad you liked them, and thanks for making them! |
Currently, even if you pass
supportedSystems = [ "aarch64-linux" ]
youend up with e.g.
nixos.iso_graphical.x86_64-linux
job. Using the newforSubsetOfSystems avoids that.
This shouldn't affect the usual x86 trunk-combined jobset.
https://hydra.nixos.org/eval/1425558#tabs-removed for the effect on an aarch64-only jobset.