Wrap nix2container with makeScopeWithSplicing'. This gives us a way to express different platform variants of our builders/derivations (e.g. buildHost, hostTarget, etc).
Wrap all builders/derivations into the callPackage pattern. This enables package splicing so nativeBuildInputs/buildInputs automatically pick the correct platform variants of our derivations when cross-compiling.
(Optional) Since the callPackage pattern can be pretty noisy, I would suggest extracting individual builders/derivations to their own nix files where it makes sense. Similar to how crane does it here: https://github.com/ipetkov/crane/tree/master/lib
Happy to revert 3. if you feel this is going too far, but using callPackage in a single file is gonna add a lot of noise and additional indentation.
WIP PoC for https://github.com/nlewo/nix2container/issues/138. This is not ready for review, just a starting point. Though all the tests on my machine do seem to pass.
Happy to revert
3.
if you feel this is going too far, but usingcallPackage
in a single file is gonna add a lot of noise and additional indentation.