Check out IOHK/IOG’s Cardano node. AFAIR they created a cross platform build in Nix for Haskell to compile their Daedalus wallet for Windows. IIRC they made the interface in electron but the back end was compiled natively to Windows.
Nix / NixOS
Main links
Videos
Multiple options:
- Use flake-utils: https://github.com/numtide/flake-utils#example
- Create a helper function: https://ayats.org/blog/no-flake-utils (what I do, the blogposte
- flake-parts: https://ayats.org/blog/no-flake-utils#option-a-flake-just-for-yourself , https://github.com/hercules-ci/flake-parts
But this is one of the things I find annoying af about nix flakes. Reproducibility is a spectrum, and I think focusing on "purity" over being able to easily ship it to multiple architectures, or not being able to use the GPU is a step too far on that spectrum for the vast majority of usecases. I can understand why scientific computing or anything that needs absolute precision might want it, but most people only just want the same versions of packages installed in their development environment.
My goal is to cross-compile from nix to windows. I need to have this program running on windows (or at least provide binaries for it haha), but I really don't want to dual-boot again (I just got rid of windows a couple of months ago, and I'm not too keen on looking at it again in the near future). Maybe I phrased my question the wrong way.
So I don't need the environment to run on windows, it just needs to be able to compile for windows.