nix2container
nix2container copied to clipboard
establish stable output api using lazy derivations
This looks interesting. Any potential drawback of using this?
@blaggacao Could you explain more in detail what issue it fixes? (maybe with an example)
@blaggacao Could you explain more in detail what issue it fixes? (maybe with an example)
It's the different between a clean backyard and a dumpster, sort of.
If you ever had your grievances with about 20 mkDerivation attributes that mostly make no sense of all and you never actually find (e.g. in the repl or during command completion) what you're looking for. If you once had that sort of experience when using Nix, then this is a fix.
The output becomes as clean as it can get, e.g.: (I deliberately remove same-system task scripts such as copyTo* from passthru in divnix/std)
nix-repl> x86_64-linux.cardano-services.oci-images.cardano-services.
x86_64-linux.cardano-services.oci-images.cardano-services.drvPath x86_64-linux.cardano-services.oci-images.cardano-services.outputName
x86_64-linux.cardano-services.oci-images.cardano-services.image x86_64-linux.cardano-services.oci-images.cardano-services.outputs
x86_64-linux.cardano-services.oci-images.cardano-services.meta x86_64-linux.cardano-services.oci-images.cardano-services.system
x86_64-linux.cardano-services.oci-images.cardano-services.name x86_64-linux.cardano-services.oci-images.cardano-services.type
x86_64-linux.cardano-services.oci-images.cardano-services.out
x86_64-linux.cardano-services.oci-images.cardano-services.outPath
What a relieve for the eye, fresh and veteran, alike!
QED.
But there's more. meta is still evaluated lazily but without triggering evaluation of the now lazy derivation. So, suppose you want to make an inventory of a really big project and you want to collect all meta.description and render them into the second column. This is now cheap. Before, it was expensive. :smile:
Think of this now costing negligible compute:
nix-repl> x86_64-linux.cardano-services.oci-images.cardano-services.meta.description
"Minimal Cardano Services OCI Image"
2 QED.
A much, much better rundown can be found at the source.