How to override the Qt version inside nix-shell

Found the solution,

  qt_srcs = import ./scripts/nix/qt/6.2.4/srcs.nix {
          fetchurl = builtins.fetchurl;
          mirror = "https://download.qt.io/";
   };
   myqt6 = pkgs.qt6.overrideScope' (final : prev:  {
      qtModule = prev.qtModule.override( old : {
        srcs = qt_srcs;
      });
      qtbase = prev.qtbase.overrideAttrs ( old : {
        inherit (qt_srcs.qtbase) src version;
      });
    });

Need to use ovverrideScope' and inside it override qtModule and qtbase attributes. The local file srcs.nix can be generated for any Qt version with ./maintainers/scripts/fetch-kde-qt.sh