Is your feature request related to a problem? Please describe.
Currently, I use rules_nixpkgs to bring in binaries that I end up consuming in different ways. For example, you can imagine me consuming a binary to create an OCI image. However, this falls for multi-arch builds.
Describe the solution you'd like
I'd like rules_nixpkgs_core to understand the --platforms flag and bring appropriate packages for me. For example, imagine I have:
nix_pkg.attr(
attr = "mysql84",
)
If I'm on a macOS system, but provide a platform for linux x86_64, I'd like the mysql84 binary that comes in to be for linux x86_64.
Describe alternatives you've considered
Manually define the platform in nixopts. However, this comes with its own gotchas, namely that I'd have to define these packages multiple times, for each target platform I'd want to build for. This gets a bit messy.
nix_pkg.attr(
attr = "mysql84",
nixopts = [
"--system", "x86_64-linux",
"--option", "system", "x86_64-linux",
],
)