Getting older nixpkgs in nix-shell, if system uses nix flakes

Hi everyone.
I currently have the issue that I’m getting older nixpkgs in nix-shell, when my system uses nix flakes.

I use nix flakes for all my systems (GitHub - pbek/nixcfg: NixOS config).
To develop for example Qt apps and open IDEs like Qt Creator and Clion with the Qt dev tools I use nix-shells, like https://github.com/pbek/nixcfg/blob/21abc165faeafbe51796c3dfba4c26244641974e/files/shells/qt5.nix.

My issue is that my desktop (KDE Plasma) uses a newer Qt version than I get in the nix-shell, which causes errors like: Fatal: Cannot mix incompatible Qt library (5.15.10) with this library (5.15.9)

How can I use the same nixpkgs in the nix-shell with import <nixpkgs> than I use in my flake?

I think I did it with https://github.com/pbek/nixcfg/commit/7cddcb47054b351a484c4959dcf162f9c5c6a2fe!