First you need to separate your nix file in two files, one that does callPackage on the other:
default.nix:
{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ./myapp.nix {}
and ./myapp.nix:
{ stdenv, SDL2 }: mkDerivation { ... }
Then check that it still builds. Then to cross compile, replace usage of pkgs.callPackage by pkgs.pkgsCross.mingw64.callPackage.
Good luck ![]()