Howto cross-compile a qt application with mingw

I try to create a development envrionment for my qt application. As an example I use the following shell.nix file:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  nativeBuildInputs = with pkgs; [

  buildInputs = with pkgs; [

This works as long as I compile for my own architecture. I can do nix-shell then qmake && make.

When I change the line pkgs.mkShell to pkgs.pkgsCross.mingwW64.mkShell and do nix-shell all seems to work well. But when I call qmake I get the following error message:

Project ERROR: Cannot run compiler 'g++'. Output:
Maybe you forgot to setup the environment?

What am I doing wrong? I thought pkgsCross.mingwW64 would take care off configuring the environment correctly. It does set $CC and $CXX to x86_64-w64-mingw32-gcc/g++ and those binaries are in $PATH but still something seems to be missing to satisfy qmake.

Any ideas?
Thanks in advance

Hosted by Flying Circus.