Open kolloch opened 6 months ago
I also like this idea. This goes a step further than my initial implementation (image.copyTo*
) which i implemented for testing purposes... it seems people are no longer using it only for testing purposes :sweat_smile:
Do you know if this pattern is used elsewhere in the Nix community?
I don’t know of other similar patterns in the nix community.
I asked in a chat and there are some concerns using passthrough methods of derivations. The evaluation time accessing these methods apparently is significant (not verified).
in a flake module it is probably wiser to create a “do”sibling attribute next to the derivation of the image. For your API, you could do something similar but it would be a breaking change and in some contexts not feel as convenient, I think,
If you keep the pass through methods, collecting them under a do
super attribute is still a good idea, I think
I really like the idea of defining "convenience actions" on an image. Right now, though, they are mixed on the same level as unrelated attributes of a derivation.
n2c.aarch64-darwin.images.bash.result
is an image produced withbuildImage
:I propose to bundle the actions under a
passthrough
sub attributedo
, maybe further subdivided into categories:and then
Compatibility: I'd keep aliases at the old locations for now. Potentially with a deprecation warning.
What do you think?