This is no longer working as of Nixos 22,
somehow the QT styles are now hardcoded into the module:
building Nix...
building the system configuration...
error: The option `environment.variables.QT_QPA_PLATFORMTHEME' has conflicting definition values:
- In `/etc/nixos/configuration.nix': "qt5ct"
- In `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/config/qt5.nix': "gnome"
(use '--show-trace' to show detailed location information)
environment.variables = {
QT_QPA_PLATFORMTHEME = "qt5ct";
};