timbertson / opam2nix

Generate nix expressions from opam packages
MIT License
93 stars 28 forks source link

cross compiling for docker image #66

Closed joprice closed 3 years ago

joprice commented 3 years ago

Do you have any example using opam2nix to build a docker image? I tried passing system = "x86_64-linux"; when importing nixpkgs, but I get the error

error: a 'x86_64-linux' with features {} is required to build '/nix/store/jp7lw6n8yk7967zdixbzfkbpr3zy7a6v-setupHook.sh.drv', but I am a 'x86_64-darwin' with features {benchmark, big-parallel, nixos-test}

The error makes me think I'm not even on the right track, so I wanted to see if there was some existing pattern first.

joprice commented 3 years ago

I found some docs here https://nix.dev/tutorials/building-and-running-docker-images#build-your-first-container. I'm going to try that out and see how far I get.

joprice commented 3 years ago

It seems that cross compiling ocaml in general from mac to linux is difficult, so I'll close for now until I have a method for building a normal buildDunePackage first.