about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-6
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-6')
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/default.nix214
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/fetch.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qmake-libtool.sh25
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh63
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh27
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/qmake-hook.sh53
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh105
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh99
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qt3d.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qt5compat.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix265
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtcharts.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtdoc.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtgraphs.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtgrpc.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qthttpserver.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtimageformats.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtlocation.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtlottie.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtmqtt.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtpositioning.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3d.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtquickeffectmaker.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtscxml.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtsensors.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialbus.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialport.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtshadertools.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtspeech.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtsvg.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qttools.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qttranslations.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtwayland.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebengine.nix323
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebview.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch485
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch36
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qttools-paths.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-copy-certificate-chain.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-low-latency-flag.patch61
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch41
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/qt-env.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/qtModule.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-6/srcs.nix318
69 files changed, 3106 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/default.nix b/nixpkgs/pkgs/development/libraries/qt-6/default.nix
new file mode 100644
index 000000000000..3f1cf19c29ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/default.nix
@@ -0,0 +1,214 @@
+{ newScope
+, lib
+, stdenv
+, generateSplicesForMkScope
+, makeScopeWithSplicing'
+, fetchurl
+, fetchpatch
+, fetchpatch2
+, makeSetupHook
+, makeWrapper
+, gst_all_1
+, libglvnd
+, darwin
+, overrideSDK
+, buildPackages
+, python3
+, config
+
+  # options
+, developerBuild ? false
+, debug ? false
+}:
+
+let
+  srcs = import ./srcs.nix {
+    inherit fetchurl;
+    mirror = "mirror://qt";
+  };
+
+  addPackages = self:
+    let
+      callPackage = self.newScope ({
+        inherit (self) qtModule;
+        inherit srcs python3;
+        stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
+      });
+    in
+    {
+
+      inherit callPackage srcs;
+
+      qtModule = callPackage ./qtModule.nix { };
+
+      qtbase = callPackage ./modules/qtbase.nix {
+        withGtk3 = true;
+        inherit (srcs.qtbase) src version;
+        inherit developerBuild;
+        inherit (darwin.apple_sdk_11_0.frameworks)
+          AGL AVFoundation AppKit Contacts CoreBluetooth EventKit GSS MetalKit;
+        patches = [
+          ./patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch
+          ./patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch
+          ./patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch
+          ./patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
+          ./patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch
+          ./patches/0006-qtbase-find-tools-in-PATH.patch
+          ./patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
+          ./patches/0008-qtbase-allow-translations-outside-prefix.patch
+          ./patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
+          ./patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
+          ./patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch
+          # Revert "macOS: Silence warning about supporting secure state restoration"
+          # fix build with macOS sdk < 12.0
+          (fetchpatch2 {
+            url = "https://github.com/qt/qtbase/commit/fc1549c01445bb9c99d3ba6de8fa9da230614e72.patch";
+            revert = true;
+            hash = "sha256-cjB2sC4cvZn0UEc+sm6ZpjyC78ssqB1Kb5nlZQ15M4A=";
+          })
+        ];
+      };
+      env = callPackage ./qt-env.nix { };
+      full = callPackage ({ env, qtbase }: env "qt-full-${qtbase.version}"
+      # `with self` is ok to use here because having these spliced is unnecessary
+      ( with self;[
+        qt3d
+        qt5compat
+        qtcharts
+        qtconnectivity
+        qtdatavis3d
+        qtdeclarative
+        qtdoc
+        qtgraphs
+        qtgrpc
+        qthttpserver
+        qtimageformats
+        qtlanguageserver
+        qtlocation
+        qtlottie
+        qtmultimedia
+        qtmqtt
+        qtnetworkauth
+        qtpositioning
+        qtsensors
+        qtserialbus
+        qtserialport
+        qtshadertools
+        qtspeech
+        qtquick3d
+        qtquick3dphysics
+        qtquickeffectmaker
+        qtquicktimeline
+        qtremoteobjects
+        qtsvg
+        qtscxml
+        qttools
+        qttranslations
+        qtvirtualkeyboard
+        qtwebchannel
+        qtwebengine
+        qtwebsockets
+        qtwebview
+      ] ++ lib.optionals (!stdenv.isDarwin) [ qtwayland libglvnd ])) { };
+
+      qt3d = callPackage ./modules/qt3d.nix { };
+      qt5compat = callPackage ./modules/qt5compat.nix { };
+      qtcharts = callPackage ./modules/qtcharts.nix { };
+      qtconnectivity = callPackage ./modules/qtconnectivity.nix {
+        inherit (darwin.apple_sdk_11_0.frameworks) IOBluetooth PCSC;
+      };
+      qtdatavis3d = callPackage ./modules/qtdatavis3d.nix { };
+      qtdeclarative = callPackage ./modules/qtdeclarative.nix { };
+      qtdoc = callPackage ./modules/qtdoc.nix { };
+      qtgraphs = callPackage ./modules/qtgraphs.nix { };
+      qtgrpc = callPackage ./modules/qtgrpc.nix { };
+      qthttpserver = callPackage ./modules/qthttpserver.nix { };
+      qtimageformats = callPackage ./modules/qtimageformats.nix { };
+      qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
+      qtlocation = callPackage ./modules/qtlocation.nix { };
+      qtlottie = callPackage ./modules/qtlottie.nix { };
+      qtmultimedia = callPackage ./modules/qtmultimedia.nix {
+        inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi;
+        inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox;
+      };
+      qtmqtt = callPackage ./modules/qtmqtt.nix { };
+      qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { };
+      qtpositioning = callPackage ./modules/qtpositioning.nix { };
+      qtsensors = callPackage ./modules/qtsensors.nix { };
+      qtserialbus = callPackage ./modules/qtserialbus.nix { };
+      qtserialport = callPackage ./modules/qtserialport.nix { };
+      qtshadertools = callPackage ./modules/qtshadertools.nix { };
+      qtspeech = callPackage ./modules/qtspeech.nix {
+        inherit (darwin.apple_sdk_11_0.frameworks) Cocoa;
+      };
+      qtquick3d = callPackage ./modules/qtquick3d.nix { };
+      qtquick3dphysics = callPackage ./modules/qtquick3dphysics.nix { };
+      qtquickeffectmaker = callPackage ./modules/qtquickeffectmaker.nix { };
+      qtquicktimeline = callPackage ./modules/qtquicktimeline.nix { };
+      qtremoteobjects = callPackage ./modules/qtremoteobjects.nix { };
+      qtsvg = callPackage ./modules/qtsvg.nix { };
+      qtscxml = callPackage ./modules/qtscxml.nix { };
+      qttools = callPackage ./modules/qttools.nix { };
+      qttranslations = callPackage ./modules/qttranslations.nix { };
+      qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { };
+      qtwayland = callPackage ./modules/qtwayland.nix { };
+      qtwebchannel = callPackage ./modules/qtwebchannel.nix { };
+      qtwebengine = callPackage ./modules/qtwebengine.nix {
+        inherit (darwin) autoSignDarwinBinariesHook bootstrap_cmds cctools xnu;
+        inherit (darwin.apple_sdk_11_0) libpm libunwind;
+        inherit (darwin.apple_sdk_11_0.libs) sandbox;
+        inherit (darwin.apple_sdk_11_0.frameworks)
+          AGL AVFoundation Accelerate Cocoa CoreLocation CoreML ForceFeedback
+          GameController ImageCaptureCore LocalAuthentication
+          MediaAccessibility MediaPlayer MetalKit Network OpenDirectory Quartz
+          ReplayKit SecurityInterface Vision;
+        qtModule = callPackage ({ qtModule }: qtModule.override {
+          stdenv = if stdenv.isDarwin
+            then overrideSDK stdenv { darwinMinVersion = "10.13"; darwinSdkVersion = "11.0"; }
+            else stdenv;
+        }) { };
+        xcbuild = buildPackages.xcbuild.override {
+          productBuildVer = "20A2408";
+        };
+      };
+      qtwebsockets = callPackage ./modules/qtwebsockets.nix { };
+      qtwebview = callPackage ./modules/qtwebview.nix {
+        inherit (darwin.apple_sdk_11_0.frameworks) WebKit;
+      };
+
+      wrapQtAppsHook = callPackage ({ makeBinaryWrapper }: makeSetupHook
+        {
+          name = "wrap-qt6-apps-hook";
+          propagatedBuildInputs = [ makeBinaryWrapper ];
+        } ./hooks/wrap-qt-apps-hook.sh) { };
+
+      qmake = callPackage ({ qtbase }: makeSetupHook
+        {
+          name = "qmake6-hook";
+          propagatedBuildInputs = [ qtbase.dev ];
+          substitutions = {
+            inherit debug;
+            fix_qmake_libtool = ./hooks/fix-qmake-libtool.sh;
+          };
+        } ./hooks/qmake-hook.sh) { };
+    } // lib.optionalAttrs config.allowAliases {
+      # Convert to a throw on 03-01-2023 and backport the change.
+      # Warnings show up in various cli tool outputs, throws do not.
+      # Remove completely before 24.05
+      overrideScope' = lib.warnIf (lib.isInOldestRelease 2311) "qt6 now uses makeScopeWithSplicing which does not have \"overrideScope'\", use \"overrideScope\"." self.overrideScope;
+    };
+
+  baseScope = makeScopeWithSplicing' {
+    otherSplices = generateSplicesForMkScope "qt6";
+    f = addPackages;
+  };
+
+  bootstrapScope = baseScope.overrideScope(final: prev: {
+    qtbase = prev.qtbase.override { qttranslations = null; };
+    qtdeclarative = null;
+  });
+
+  finalScope = baseScope.overrideScope(final: prev: {
+    qttranslations = bootstrapScope.qttranslations;
+  });
+in finalScope
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-6/fetch.sh
new file mode 100644
index 000000000000..d7ef146a1957
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/fetch.sh
@@ -0,0 +1 @@
+WGET_ARGS=( https://download.qt.io/official_releases/qt/6.6/6.6.2/submodules/ -A '*.tar.xz' )
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qmake-libtool.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qmake-libtool.sh
new file mode 100644
index 000000000000..44bf10a0db06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qmake-libtool.sh
@@ -0,0 +1,25 @@
+# Fix libtool libraries generated by qmake.
+# qmake started inserting filenames of shared objects instead of the appropriate
+# linker flags. fixQmakeLibtool searches for broken libtool libraries and
+# replaces the filenames with the linker flags that should have been there.
+fixQmakeLibtool() {
+    if [ -d "$1" ]; then
+        find "$1" -name '*.la' | while read la; do
+            set +e
+            framework_libs=$(grep '^dependency_libs' "$la" | grep -Eo -- '-framework +\w+' | tr '\n' ' ')
+            set -e
+            sed -i "$la" \
+                -e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g' \
+                -e '/^dependency_libs/ s,-framework \+\w\+,,g'
+            if [ ! -z "$framework_libs" ]; then
+                if grep '^inherited_linker_flags=' $la >/dev/null; then
+                    sed -i "$la" -e "s/^\(inherited_linker_flags='[^']*\)/\1 $framework_libs/"
+                else
+                    echo "inherited_linker_flags='$framework_libs'" >>"$la"
+                fi
+            fi
+        done
+    fi
+}
+
+fixupOutputHooks+=('fixQmakeLibtool $prefix')
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh
new file mode 100644
index 000000000000..d6f8ab32f799
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh
@@ -0,0 +1,63 @@
+# fixQtBuiltinPaths
+#
+# Usage: fixQtBuiltinPaths _dir_ _pattern_
+#
+# Fix Qt builtin paths in files matching _pattern_ under _dir_.
+#
+fixQtBuiltinPaths() {
+    local dir="$1"
+    local pattern="$2"
+    local lib="${!outputLib}"
+
+    if [ -d "$dir" ]; then
+        find "$dir" -name "$pattern" | while read pr_; do
+            if grep -q '\$\$\[QT_' "${pr_:?}"; then
+                echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${pr_:?}'..."
+                sed -i "${pr_:?}" \
+                    -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$lib/bin|g" \
+                    -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                    -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$lib/mkspecs|g" \
+                    -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$lib/bin|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$lib/share/doc|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$lib/examples|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$lib/include|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$lib/$qtPluginPrefix|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$lib/tests|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$lib/$qtQmlPrefix|g"
+            fi
+        done
+    elif [ -e "$dir" ]; then
+        if grep -q '\$\$\[QT_' "${dir:?}"; then
+            echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${dir:?}'..."
+            sed -i "${dir:?}" \
+                -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$lib/bin|g" \
+                -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$lib/mkspecs|g" \
+                -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$lib/bin|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$lib/share/doc|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$lib/examples|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$lib/include|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$lib/$qtPluginPrefix|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$lib/tests|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$lib/$qtQmlPrefix|g"
+        fi
+    else
+        echo "fixQtBuiltinPaths: Warning: \`$dir' does not exist"
+    fi
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh
new file mode 100644
index 000000000000..4884f45b9930
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh
@@ -0,0 +1,27 @@
+# fixQtModulePaths
+#
+# Usage: fixQtModulePaths _dir_
+#
+# Find Qt module definitions in directory _dir_ and patch the module paths.
+#
+fixQtModulePaths() {
+    local dir="$1"
+    local lib="${!outputLib}"
+
+    if [ -d "$dir" ]; then
+        find "$dir" -name 'qt_*.pri' | while read pr; do
+            if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
+                echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
+                sed -i "${pr:?}" \
+                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$lib/include|g" \
+                    -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$lib/bin|g"
+            fi
+        done
+    elif [ -e "$dir" ]; then
+        echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
+    else
+        echo "fixQtModulePaths: Warning: \`$dir' does not exist"
+    fi
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/qmake-hook.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/qmake-hook.sh
new file mode 100644
index 000000000000..8c4ce096443f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/qmake-hook.sh
@@ -0,0 +1,53 @@
+. @fix_qmake_libtool@
+
+qmakeFlags=(${qmakeFlags-})
+
+qmakePrePhase() {
+    qmakeFlags_orig=("${qmakeFlags[@]}")
+
+    # These flags must be added _before_ the flags specified in the derivation.
+    # TODO: these flags also need a patch which isn't applied
+    # can we either remove these flags or update the qt5 patch?
+    # "NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
+    qmakeFlags=(
+        "PREFIX=$out"
+        "NIX_OUTPUT_OUT=$out"
+        "NIX_OUTPUT_DEV=${!outputDev}"
+        "NIX_OUTPUT_BIN=${!outputBin}"
+        "NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}"
+        "NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}"
+    )
+
+    if [ -n "@debug@" ]; then
+        qmakeFlags+=("CONFIG+=debug")
+    else
+        qmakeFlags+=("CONFIG+=release")
+    fi
+
+    qmakeFlags+=("${qmakeFlags_orig[@]}")
+}
+prePhases+=" qmakePrePhase"
+
+qmakeConfigurePhase() {
+    runHook preConfigure
+
+    echo "QMAKEPATH=$QMAKEPATH"
+    echo qmake "${qmakeFlags[@]}"
+    qmake "${qmakeFlags[@]}"
+
+    if ! [[ -v enableParallelBuilding ]]; then
+        enableParallelBuilding=1
+        echo "qmake: enabled parallel building"
+    fi
+
+    if ! [[ -v enableParallelInstalling ]]; then
+        enableParallelInstalling=1
+        echo "qmake: enabled parallel installing"
+    fi
+
+    runHook postConfigure
+}
+
+if [ -z "${dontUseQmakeConfigure-}" -a -z "${configurePhase-}" ]; then
+    configurePhase=qmakeConfigurePhase
+fi
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh
new file mode 100644
index 000000000000..9bc68e6cd3d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh
@@ -0,0 +1,105 @@
+if [[ -n "${__nix_qtbase-}" ]]; then
+    # Throw an error if a different version of Qt was already set up.
+    if [[ "$__nix_qtbase" != "@out@" ]]; then
+        echo >&2 "Error: detected mismatched Qt dependencies:"
+        echo >&2 "    @out@"
+        echo >&2 "    $__nix_qtbase"
+        exit 1
+    fi
+else # Only set up Qt once.
+    __nix_qtbase="@out@"
+
+    qtPluginPrefix=@qtPluginPrefix@
+    qtQmlPrefix=@qtQmlPrefix@
+
+    . @fix_qt_builtin_paths@
+    . @fix_qt_module_paths@
+
+    # Disable debug symbols if qtbase was built without debugging.
+    # This stops -dev paths from leaking into other outputs.
+    if [ -z "@debug@" ]; then
+        NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-DQT_NO_DEBUG"
+    fi
+
+    # Integration with CMake:
+    # Set the CMake build type corresponding to how qtbase was built.
+    if [ -n "@debug@" ]; then
+        cmakeBuildType="Debug"
+    else
+        cmakeBuildType="Release"
+    fi
+
+    # Build tools are often confused if QMAKE is unset.
+    export QMAKE=@out@/bin/qmake
+
+    export QMAKEPATH=
+
+    export QMAKEMODULES=
+
+    declare -Ag qmakePathSeen=()
+    qmakePathHook() {
+        # Skip this path if we have seen it before.
+        # MUST use 'if' because 'qmakePathSeen[$]' may be unset.
+        if [ -n "${qmakePathSeen[$1]-}" ]; then return; fi
+        qmakePathSeen[$1]=1
+        if [ -d "$1/mkspecs" ]; then
+            QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs"
+            QMAKEPATH="${QMAKEPATH}${QMAKEPATH:+:}$1"
+        fi
+    }
+    envBuildHostHooks+=(qmakePathHook)
+
+    export QTTOOLSPATH=
+
+    declare -Ag qttoolsPathSeen=()
+    qtToolsHook() {
+        # Skip this path if we have seen it before.
+        # MUST use 'if' because 'qttoolsPathSeen[$]' may be unset.
+        if [ -n "${qttoolsPathSeen[$1]-}" ]; then return; fi
+        qttoolsPathSeen[$1]=1
+        if [ -d "$1/libexec" ]; then
+            QTTOOLSPATH="${QTTOOLSPATH}${QTTOOLSPATH:+:}$1/libexec"
+        fi
+    }
+    addEnvHooks "$hostOffset" qtToolsHook
+
+    postPatchMkspecs() {
+        # Prevent this hook from running multiple times
+        dontPatchMkspecs=1
+
+        local lib="${!outputLib}"
+        local dev="${!outputDev}"
+
+        moveToOutput "mkspecs/modules" "$dev"
+
+        if [ -d "$dev/mkspecs/modules" ]; then
+            fixQtModulePaths "$dev/mkspecs/modules"
+        fi
+
+        if [ -d "$lib/mkspecs" ]; then
+            fixQtBuiltinPaths "$lib/mkspecs" '*.pr?'
+        fi
+
+        if [ -d "$lib/lib" ]; then
+            fixQtBuiltinPaths "$lib/lib" '*.pr?'
+        fi
+    }
+    if [ -z "${dontPatchMkspecs-}" ]; then
+        postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs"
+    fi
+
+    qtPreHook() {
+        # Check that wrapQtAppsHook is used, or it is explicitly disabled.
+        if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then
+            echo >&2 "Error: wrapQtAppsHook is not used, and dontWrapQtApps is not set."
+            exit 1
+        fi
+    }
+    prePhases+=" qtPreHook"
+
+    addQtModulePrefix() {
+        addToSearchPath QT_ADDITIONAL_PACKAGES_PREFIX_PATH $1
+    }
+    addEnvHooks "$hostOffset" addQtModulePrefix
+
+fi
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh b/nixpkgs/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh
new file mode 100644
index 000000000000..2d858055693c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh
@@ -0,0 +1,99 @@
+if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then
+    __nix_wrapQtAppsHook=1 # Don't run this hook more than once.
+
+    # Inherit arguments given in mkDerivation
+    qtWrapperArgs=(${qtWrapperArgs-})
+
+    qtHostPathSeen=()
+
+    qtUnseenHostPath() {
+        for pkg in "${qtHostPathSeen[@]}"; do
+            if [ "${pkg:?}" == "$1" ]; then
+                return 1
+            fi
+        done
+
+        qtHostPathSeen+=("$1")
+        return 0
+    }
+
+    qtHostPathHook() {
+        qtUnseenHostPath "$1" || return 0
+
+        if ! [ -v qtPluginPrefix ]; then
+            echo "wrapQtAppsHook qtHostPathHook: qtPluginPrefix is unset. hint: add qt6.qtbase to buildInputs"
+        fi
+
+        local pluginDir="$1/${qtPluginPrefix:?}"
+        if [ -d "$pluginDir" ]; then
+            qtWrapperArgs+=(--prefix QT_PLUGIN_PATH : "$pluginDir")
+        fi
+
+        local qmlDir="$1/${qtQmlPrefix:?}"
+        if [ -d "$qmlDir" ]; then
+            qtWrapperArgs+=(--prefix NIXPKGS_QT6_QML_IMPORT_PATH : "$qmlDir")
+        fi
+    }
+    addEnvHooks "$targetOffset" qtHostPathHook
+
+    makeQtWrapper() {
+        local original="$1"
+        local wrapper="$2"
+        shift 2
+        makeWrapper "$original" "$wrapper" "${qtWrapperArgs[@]}" "$@"
+    }
+
+    wrapQtApp() {
+        local program="$1"
+        shift 1
+        wrapProgram "$program" "${qtWrapperArgs[@]}" "$@"
+    }
+
+    qtOwnPathsHook() {
+        local xdgDataDir="${!outputBin}/share"
+        if [ -d "$xdgDataDir" ]; then
+            qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$xdgDataDir")
+        fi
+
+        local xdgConfigDir="${!outputBin}/etc/xdg"
+        if [ -d "$xdgConfigDir" ]; then
+            qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
+        fi
+
+        qtHostPathHook "${!outputBin}"
+    }
+
+    preFixupPhases+=" qtOwnPathsHook"
+
+    # Note: $qtWrapperArgs still gets defined even if ${dontWrapQtApps-} is set.
+    wrapQtAppsHook() {
+        # skip this hook when requested
+        [ -z "${dontWrapQtApps-}" ] || return 0
+
+        # guard against running multiple times (e.g. due to propagation)
+        [ -z "$wrapQtAppsHookHasRun" ] || return 0
+        wrapQtAppsHookHasRun=1
+
+        local targetDirs=("$prefix/bin" "$prefix/sbin" "$prefix/libexec" "$prefix/Applications" "$prefix/"*.app)
+        echo "wrapping Qt applications in ${targetDirs[@]}"
+
+        for targetDir in "${targetDirs[@]}"; do
+            [ -d "$targetDir" ] || continue
+
+            find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file; do
+                if [ -f "$file" ]; then
+                    echo "wrapping $file"
+                    wrapQtApp "$file"
+                elif [ -h "$file" ]; then
+                    target="$(readlink -e "$file")"
+                    echo "wrapping $file -> $target"
+                    rm "$file"
+                    makeQtWrapper "$target" "$file"
+                fi
+            done
+        done
+    }
+
+    fixupOutputHooks+=(wrapQtAppsHook)
+
+fi
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qt3d.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qt3d.nix
new file mode 100644
index 000000000000..f1df7f6fc254
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qt3d.nix
@@ -0,0 +1,11 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtmultimedia
+, assimp
+}:
+
+qtModule {
+  pname = "qt3d";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtmultimedia assimp ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qt5compat.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qt5compat.nix
new file mode 100644
index 000000000000..d2049d7fc3e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qt5compat.nix
@@ -0,0 +1,13 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, libiconv
+, icu
+, openssl
+}:
+
+qtModule {
+  pname = "qt5compat";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ libiconv icu openssl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix
new file mode 100644
index 000000000000..4b541ca6fec2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtbase.nix
@@ -0,0 +1,265 @@
+{ stdenv
+, lib
+, src
+, patches ? [ ]
+, version
+, coreutils
+, bison
+, flex
+, gdb
+, gperf
+, lndir
+, perl
+, pkg-config
+, which
+, cmake
+, ninja
+, xmlstarlet
+, libproxy
+, xorg
+, zstd
+, double-conversion
+, util-linux
+, systemd
+, systemdSupport ? stdenv.isLinux
+, libb2
+, md4c
+, mtdev
+, lksctp-tools
+, libselinux
+, libsepol
+, vulkan-headers
+, vulkan-loader
+, libthai
+, libdrm
+, libdatrie
+, lttng-ust
+, libepoxy
+, libiconv
+, dbus
+, fontconfig
+, freetype
+, glib
+, harfbuzz
+, icu
+, libX11
+, libXcomposite
+, libXext
+, libXi
+, libXrender
+, libinput
+, libjpeg
+, libpng
+, libxcb
+, libxkbcommon
+, libxml2
+, libxslt
+, openssl
+, pcre
+, pcre2
+, sqlite
+, udev
+, xcbutil
+, xcbutilimage
+, xcbutilkeysyms
+, xcbutilrenderutil
+, xcbutilwm
+, zlib
+, at-spi2-core
+, unixODBC
+, unixODBCDrivers
+  # darwin
+, moveBuildTree
+, xcbuild
+, AGL
+, AVFoundation
+, AppKit
+, Contacts
+, CoreBluetooth
+, EventKit
+, GSS
+, MetalKit
+  # optional dependencies
+, cups
+, libmysqlclient
+, postgresql
+, withGtk3 ? false
+, dconf
+, gtk3
+  # options
+, libGLSupported ? stdenv.isLinux
+, libGL
+, debug ? false
+, developerBuild ? false
+, qttranslations ? null
+}:
+
+let
+  debugSymbols = debug || developerBuild;
+in
+stdenv.mkDerivation rec {
+  pname = "qtbase";
+
+  inherit src version;
+
+  debug = debugSymbols;
+
+  propagatedBuildInputs = [
+    libxml2
+    libxslt
+    openssl
+    sqlite
+    zlib
+    unixODBC
+    # Text rendering
+    harfbuzz
+    icu
+    # Image formats
+    libjpeg
+    libpng
+    pcre2
+    pcre
+    libproxy
+    zstd
+    double-conversion
+    libb2
+    md4c
+    dbus
+    glib
+    # unixODBC drivers
+    unixODBCDrivers.psql
+    unixODBCDrivers.sqlite
+    unixODBCDrivers.mariadb
+  ] ++ lib.optionals systemdSupport [
+    systemd
+  ] ++ lib.optionals stdenv.isLinux [
+    util-linux
+    mtdev
+    lksctp-tools
+    libselinux
+    libsepol
+    lttng-ust
+    vulkan-headers
+    vulkan-loader
+    libthai
+    libdrm
+    libdatrie
+    udev
+    # Text rendering
+    fontconfig
+    freetype
+    # X11 libs
+    libX11
+    libXcomposite
+    libXext
+    libXi
+    libXrender
+    libxcb
+    libxkbcommon
+    xcbutil
+    xcbutilimage
+    xcbutilkeysyms
+    xcbutilrenderutil
+    xcbutilwm
+    xorg.libXdmcp
+    xorg.libXtst
+    xorg.xcbutilcursor
+    libepoxy
+  ] ++ lib.optionals stdenv.isDarwin [
+    AGL
+    AVFoundation
+    AppKit
+    Contacts
+    CoreBluetooth
+    EventKit
+    GSS
+    MetalKit
+  ] ++ lib.optional libGLSupported libGL;
+
+  buildInputs = [
+    at-spi2-core
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    libinput
+  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
+    AppKit
+    CoreBluetooth
+  ]
+  ++ lib.optional withGtk3 gtk3
+  ++ lib.optional developerBuild gdb
+  ++ lib.optional (cups != null) cups
+  ++ lib.optional (libmysqlclient != null) libmysqlclient
+  ++ lib.optional (postgresql != null) postgresql;
+
+  nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ]
+    ++ lib.optionals stdenv.isDarwin [ moveBuildTree ];
+
+  propagatedNativeBuildInputs = [ lndir ];
+
+  strictDeps = true;
+
+  enableParallelBuilding = true;
+
+  inherit patches;
+
+  # https://bugreports.qt.io/browse/QTBUG-97568
+  postPatch = ''
+    substituteInPlace src/corelib/CMakeLists.txt --replace-fail "/bin/ls" "${coreutils}/bin/ls"
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace cmake/QtPublicAppleHelpers.cmake --replace-fail "/usr/bin/xcrun" "${xcbuild}/bin/xcrun"
+  '';
+
+  fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+  fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
+  preHook = ''
+    . "$fix_qt_builtin_paths"
+    . "$fix_qt_module_paths"
+  '';
+
+  qtPluginPrefix = "lib/qt-6/plugins";
+  qtQmlPrefix = "lib/qt-6/qml";
+
+  cmakeFlags = [
+    "-DQT_EMBED_TOOLCHAIN_COMPILER=OFF"
+    "-DINSTALL_PLUGINSDIR=${qtPluginPrefix}"
+    "-DINSTALL_QMLDIR=${qtQmlPrefix}"
+    "-DQT_FEATURE_libproxy=ON"
+    "-DQT_FEATURE_system_sqlite=ON"
+    "-DQT_FEATURE_openssl_linked=ON"
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    "-DQT_FEATURE_sctp=ON"
+    "-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}"
+    "-DQT_FEATURE_vulkan=ON"
+  ] ++ lib.optionals stdenv.isDarwin [
+    # error: 'path' is unavailable: introduced in macOS 10.15
+    "-DQT_FEATURE_cxx17_filesystem=OFF"
+  ] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations";
+
+  env.NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [
+    # Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc"
+    "-framework GSS"
+  ]);
+
+  env.NIX_CFLAGS_COMPILE = "-DNIXPKGS_QT_PLUGIN_PREFIX=\"${qtPluginPrefix}\"";
+
+  outputs = [ "out" "dev" ];
+
+  moveToDev = false;
+
+  postFixup = ''
+    moveToOutput      "mkspecs/modules" "$dev"
+    fixQtModulePaths  "$dev/mkspecs/modules"
+    fixQtBuiltinPaths "$out" '*.pr?'
+  '';
+
+  dontStrip = debugSymbols;
+
+  setupHook = ../hooks/qtbase-setup-hook.sh;
+
+  meta = with lib; {
+    homepage = "https://www.qt.io/";
+    description = "A cross-platform application framework for C++";
+    license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
+    maintainers = with maintainers; [ milahu nickcao LunNova ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtcharts.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtcharts.nix
new file mode 100644
index 000000000000..e9b6c8d6b33f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtcharts.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+}:
+
+qtModule {
+  pname = "qtcharts";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix
new file mode 100644
index 000000000000..46d8f925beb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix
@@ -0,0 +1,23 @@
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtdeclarative
+, bluez
+, pkg-config
+, IOBluetooth
+, PCSC
+}:
+
+qtModule {
+  pname = "qtconnectivity";
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optionals stdenv.isLinux [ bluez ];
+  propagatedBuildInputs = [
+    qtbase
+    qtdeclarative
+  ] ++ lib.optionals stdenv.isDarwin [
+    IOBluetooth
+    PCSC
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix
new file mode 100644
index 000000000000..e6c12508c9d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdatavis3d.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+}:
+
+qtModule {
+  pname = "qtdatavis3d";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix
new file mode 100644
index 000000000000..697556e30edc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix
@@ -0,0 +1,18 @@
+{ qtModule
+, qtbase
+, qtlanguageserver
+, qtshadertools
+, openssl
+, python3
+}:
+
+qtModule {
+  pname = "qtdeclarative";
+  propagatedBuildInputs = [ qtbase qtlanguageserver qtshadertools openssl python3 ];
+  patches = [
+    # prevent headaches from stale qmlcache data
+    ../patches/qtdeclarative-default-disable-qmlcache.patch
+    # add version specific QML import path
+    ../patches/qtdeclarative-qml-paths.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdoc.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdoc.nix
new file mode 100644
index 000000000000..555108caa01a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtdoc.nix
@@ -0,0 +1,26 @@
+{ qtModule
+, qtdeclarative
+, qtbase
+, qttools
+}:
+
+qtModule {
+  pname = "qtdoc";
+  # avoid fix-qt-builtin-paths hook substitute QT_INSTALL_DOCS to qtdoc's path
+  postPatch = ''
+    for file in $(grep -rl '$QT_INSTALL_DOCS'); do
+      substituteInPlace $file \
+          --replace '$QT_INSTALL_DOCS' "${qtbase}/share/doc"
+    done
+  '';
+  nativeBuildInputs = [ (qttools.override { withClang = true; }) ];
+  propagatedBuildInputs = [ qtdeclarative ];
+  cmakeFlags = [
+    "-DCMAKE_MESSAGE_LOG_LEVEL=STATUS"
+  ];
+  dontUseNinjaBuild = true;
+  buildFlags = [ "docs" ];
+  dontUseNinjaInstall = true;
+  installFlags = [ "install_docs" ];
+  outputs = [ "out" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgraphs.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgraphs.nix
new file mode 100644
index 000000000000..5cafb8d8d7fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgraphs.nix
@@ -0,0 +1,16 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtquick3d
+, qtquicktimeline
+}:
+
+qtModule {
+  pname = "qtgraphs";
+  propagatedBuildInputs = [
+    qtbase
+    qtdeclarative
+    qtquick3d
+    qtquicktimeline
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgrpc.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgrpc.nix
new file mode 100644
index 000000000000..09ff7ee89196
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtgrpc.nix
@@ -0,0 +1,12 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, protobuf
+, grpc
+}:
+
+qtModule {
+  pname = "qtgrpc";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ protobuf grpc ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qthttpserver.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qthttpserver.nix
new file mode 100644
index 000000000000..cf32c8a7ea76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qthttpserver.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtwebsockets
+}:
+
+qtModule {
+  pname = "qthttpserver";
+  propagatedBuildInputs = [ qtbase qtwebsockets ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtimageformats.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtimageformats.nix
new file mode 100644
index 000000000000..50420aaa7e45
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtimageformats.nix
@@ -0,0 +1,13 @@
+{ qtModule
+, qtbase
+, libwebp
+, jasper
+, libmng
+, libtiff
+}:
+
+qtModule {
+  pname = "qtimageformats";
+  propagatedBuildInputs = [ qtbase ];
+  buildInputs = [ libwebp jasper libmng libtiff ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix
new file mode 100644
index 000000000000..b45ab11fc3ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlanguageserver.nix
@@ -0,0 +1,11 @@
+{ qtModule
+, qtbase
+}:
+
+qtModule {
+  pname = "qtlanguageserver";
+  propagatedBuildInputs = [ qtbase ];
+
+  # Doesn't have version set
+  dontCheckQtModuleVersion = true;
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlocation.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlocation.nix
new file mode 100644
index 000000000000..12fa89b9aaea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlocation.nix
@@ -0,0 +1,10 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtpositioning
+}:
+
+qtModule {
+  pname = "qtlocation";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtpositioning ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlottie.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlottie.nix
new file mode 100644
index 000000000000..4231fcb26b1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtlottie.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+}:
+
+qtModule {
+  pname = "qtlottie";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmqtt.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmqtt.nix
new file mode 100644
index 000000000000..a9660b73710b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmqtt.nix
@@ -0,0 +1,18 @@
+{ qtModule
+, fetchFromGitHub
+, qtbase
+}:
+
+qtModule rec {
+  pname = "qtmqtt";
+  version = "6.6.2";
+
+  src = fetchFromGitHub {
+    owner = "qt";
+    repo = "qtmqtt";
+    rev = "v${version}";
+    hash = "sha256-R8B7Vt/XzI7+17DDZ+TVbqfGKdEfUMiLa1BqzIbo4OM=";
+  };
+
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix
new file mode 100644
index 000000000000..f77fdac059ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix
@@ -0,0 +1,42 @@
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtdeclarative
+, qtquick3d
+, qtshadertools
+, qtsvg
+, pkg-config
+, alsa-lib
+, gstreamer
+, gst-plugins-base
+, gst-plugins-good
+, gst-libav
+, gst-vaapi
+, ffmpeg_6
+, libva
+, libpulseaudio
+, wayland
+, libXrandr
+, elfutils
+, libunwind
+, orc
+, VideoToolbox
+}:
+
+qtModule {
+  pname = "qtmultimedia";
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libunwind orc ffmpeg_6 ]
+    ++ lib.optionals stdenv.isLinux [ libpulseaudio elfutils alsa-lib wayland libXrandr libva ];
+  propagatedBuildInputs = [ qtbase qtdeclarative qtsvg qtshadertools qtquick3d ]
+    ++ lib.optionals stdenv.isLinux [ gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi ]
+    ++ lib.optionals stdenv.isDarwin [ VideoToolbox ];
+
+  cmakeFlags = [ "-DENABLE_DYNAMIC_RESOLVE_VAAPI_SYMBOLS=0" ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
+    "-include AudioToolbox/AudioToolbox.h";
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin
+    "-framework AudioToolbox";
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix
new file mode 100644
index 000000000000..bec5f354a23a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtnetworkauth.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase }:
+
+qtModule {
+  pname = "qtnetworkauth";
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtpositioning.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtpositioning.nix
new file mode 100644
index 000000000000..20f059976323
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtpositioning.nix
@@ -0,0 +1,14 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtserialport
+, pkg-config
+, openssl
+}:
+
+qtModule {
+  pname = "qtpositioning";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtserialport ];
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openssl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3d.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3d.nix
new file mode 100644
index 000000000000..1c84856c0c12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3d.nix
@@ -0,0 +1,11 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, openssl
+}:
+
+qtModule {
+  pname = "qtquick3d";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ openssl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix
new file mode 100644
index 000000000000..05d121cd9b78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix
@@ -0,0 +1,13 @@
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtquick3d
+}:
+
+qtModule {
+  pname = "qtquick3dphysics";
+  propagatedBuildInputs = [ qtbase qtquick3d ];
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64)
+    "-faligned-allocation";
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquickeffectmaker.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquickeffectmaker.nix
new file mode 100644
index 000000000000..213814a017e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquickeffectmaker.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtquick3d
+}:
+
+qtModule {
+  pname = "qtquickeffectmaker";
+  propagatedBuildInputs = [ qtbase qtquick3d ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix
new file mode 100644
index 000000000000..9ac9c1f09393
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+}:
+
+qtModule {
+  pname = "qtquicktimeline";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix
new file mode 100644
index 000000000000..1fd3b1b7a253
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtremoteobjects.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+}:
+
+qtModule {
+  pname = "qtremoteobjects";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtscxml.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtscxml.nix
new file mode 100644
index 000000000000..ece975f59e8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtscxml.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtscxml";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsensors.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsensors.nix
new file mode 100644
index 000000000000..bc49c7a77f58
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsensors.nix
@@ -0,0 +1,10 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtsvg
+}:
+
+qtModule {
+  pname = "qtsensors";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtsvg ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialbus.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialbus.nix
new file mode 100644
index 000000000000..3a7285d0a8b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialbus.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtserialport }:
+
+qtModule {
+  pname = "qtserialbus";
+  propagatedBuildInputs = [ qtbase qtserialport ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialport.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialport.nix
new file mode 100644
index 000000000000..27b9eb9c1915
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtserialport.nix
@@ -0,0 +1,13 @@
+{ qtModule
+, stdenv
+, lib
+, qtbase
+, udev
+, pkg-config
+}:
+
+qtModule {
+  pname = "qtserialport";
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ qtbase ] ++ lib.optionals stdenv.isLinux [ udev ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtshadertools.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtshadertools.nix
new file mode 100644
index 000000000000..5a4b894b9abd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtshadertools.nix
@@ -0,0 +1,8 @@
+{ qtModule
+, qtbase
+}:
+
+qtModule {
+  pname = "qtshadertools";
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtspeech.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtspeech.nix
new file mode 100644
index 000000000000..77c08fa91951
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtspeech.nix
@@ -0,0 +1,19 @@
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtmultimedia
+, pkg-config
+, flite
+, alsa-lib
+, speechd
+, Cocoa
+}:
+
+qtModule {
+  pname = "qtspeech";
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optionals stdenv.isLinux [ flite alsa-lib speechd ];
+  propagatedBuildInputs = [ qtbase qtmultimedia ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsvg.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsvg.nix
new file mode 100644
index 000000000000..d81634d9ef1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtsvg.nix
@@ -0,0 +1,15 @@
+{ qtModule
+, qtbase
+, libwebp
+, jasper
+, libmng
+, zlib
+, pkg-config
+}:
+
+qtModule {
+  pname = "qtsvg";
+  propagatedBuildInputs = [ qtbase ];
+  buildInputs = [ libwebp jasper libmng zlib ];
+  nativeBuildInputs = [ pkg-config ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qttools.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qttools.nix
new file mode 100644
index 000000000000..a1aa1026e57b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qttools.nix
@@ -0,0 +1,37 @@
+{ qtModule
+, stdenv
+, lib
+, qtbase
+, qtdeclarative
+, cups
+, llvmPackages
+# clang-based c++ parser for qdoc and lupdate
+, withClang ? false
+}:
+
+qtModule {
+  pname = "qttools";
+  buildInputs = lib.optionals withClang [
+    llvmPackages.libclang
+    llvmPackages.llvm
+  ];
+  propagatedBuildInputs = [ qtbase qtdeclarative ]
+    ++ lib.optionals stdenv.isDarwin [ cups ];
+  patches = [
+    ../patches/qttools-paths.patch
+  ];
+  env.NIX_CFLAGS_COMPILE = toString [
+    "-DNIX_OUTPUT_OUT=\"${placeholder "out"}\""
+  ];
+  postPatch = ''
+    substituteInPlace \
+      src/qdoc/catch/CMakeLists.txt \
+      src/qdoc/catch_generators/CMakeLists.txt \
+      src/qdoc/catch_conversions/CMakeLists.txt \
+      --replace ''\'''${CMAKE_INSTALL_INCLUDEDIR}' "$out/include"
+  '';
+  postInstall = ''
+    mkdir -p "$dev"
+    ln -s "$out/bin" "$dev/bin"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qttranslations.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qttranslations.nix
new file mode 100644
index 000000000000..61c642de1085
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qttranslations.nix
@@ -0,0 +1,9 @@
+{ qtModule
+, qttools
+}:
+
+qtModule {
+  pname = "qttranslations";
+  nativeBuildInputs = [ qttools ];
+  outputs = [ "out" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix
new file mode 100644
index 000000000000..9f067900dc06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix
@@ -0,0 +1,13 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtsvg
+, hunspell
+, pkg-config
+}:
+
+qtModule {
+  pname = "qtvirtualkeyboard";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtsvg hunspell ];
+  nativeBuildInputs = [ pkg-config ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwayland.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwayland.nix
new file mode 100644
index 000000000000..b5f1c71fdd75
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwayland.nix
@@ -0,0 +1,14 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, wayland
+, pkg-config
+, libdrm
+}:
+
+qtModule {
+  pname = "qtwayland";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ wayland libdrm ];
+  nativeBuildInputs = [ pkg-config ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix
new file mode 100644
index 000000000000..bf0ba0f63385
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix
@@ -0,0 +1,12 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, qtwebsockets
+, openssl
+}:
+
+qtModule {
+  pname = "qtwebchannel";
+  propagatedBuildInputs = [ qtbase qtdeclarative qtwebsockets ];
+  buildInputs = [ openssl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebengine.nix
new file mode 100644
index 000000000000..64b5b9738caa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebengine.nix
@@ -0,0 +1,323 @@
+{ qtModule
+, qtdeclarative
+, qtwebchannel
+, qtpositioning
+, qtwebsockets
+, buildPackages
+, bison
+, coreutils
+, flex
+, git
+, gperf
+, ninja
+, pkg-config
+, python3
+, which
+, nodejs
+, xorg
+, libXcursor
+, libXScrnSaver
+, libXrandr
+, libXtst
+, libxshmfence
+, libXi
+, fontconfig
+, freetype
+, harfbuzz
+, icu
+, dbus
+, libdrm
+, zlib
+, minizip
+, libjpeg
+, libpng
+, libtiff
+, libwebp
+, libopus
+, jsoncpp
+, protobuf
+, libvpx
+, srtp
+, snappy
+, nss
+, libevent
+, openssl
+, alsa-lib
+, pulseaudio
+, libcap
+, pciutils
+, systemd
+, pipewire
+, gn
+, ffmpeg_4
+, lib
+, stdenv
+, glib
+, libxml2
+, libxslt
+, lcms2
+, libkrb5
+, mesa
+, enableProprietaryCodecs ? true
+  # darwin
+, autoSignDarwinBinariesHook
+, bootstrap_cmds
+, cctools
+, xcbuild
+, AGL
+, AVFoundation
+, Accelerate
+, Cocoa
+, CoreLocation
+, CoreML
+, ForceFeedback
+, GameController
+, ImageCaptureCore
+, LocalAuthentication
+, MediaAccessibility
+, MediaPlayer
+, MetalKit
+, Network
+, OpenDirectory
+, Quartz
+, ReplayKit
+, SecurityInterface
+, Vision
+, openbsm
+, libunwind
+, cups
+, libpm
+, sandbox
+, xnu
+}:
+
+qtModule {
+  pname = "qtwebengine";
+  nativeBuildInputs = [
+    bison
+    coreutils
+    flex
+    git
+    gperf
+    ninja
+    pkg-config
+    (python3.withPackages (ps: with ps; [ html5lib ]))
+    which
+    gn
+    nodejs
+  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
+    autoSignDarwinBinariesHook
+  ] ++ lib.optionals stdenv.isDarwin [
+    bootstrap_cmds
+    cctools
+    xcbuild
+  ];
+  doCheck = true;
+  outputs = [ "out" "dev" ];
+
+  dontUseGnConfigure = true;
+
+  # ninja builds some components with -Wno-format,
+  # which cannot be set at the same time as -Wformat-security
+  hardeningDisable = [ "format" ];
+
+  patches = [
+    # removes macOS 12+ dependencies
+    ../patches/qtwebengine-darwin-no-low-latency-flag.patch
+    ../patches/qtwebengine-darwin-no-copy-certificate-chain.patch
+    # Don't assume /usr/share/X11, and also respect the XKB_CONFIG_ROOT
+    # environment variable, since NixOS relies on it working.
+    # See https://github.com/NixOS/nixpkgs/issues/226484 for more context.
+    ../patches/qtwebengine-xkb-includes.patch
+
+    ../patches/qtwebengine-link-pulseaudio.patch
+
+    # Override locales install path so they go to QtWebEngine's $out
+    ../patches/qtwebengine-locales-path.patch
+  ];
+
+  postPatch = ''
+    # Patch Chromium build tools
+    (
+      cd src/3rdparty/chromium;
+
+      # Manually fix unsupported shebangs
+      substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
+        --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
+      substituteInPlace third_party/webgpu-cts/src/tools/run_deno \
+        --replace "/usr/bin/env -S deno" "/usr/bin/deno" || true
+      patchShebangs .
+    )
+
+    substituteInPlace cmake/Functions.cmake \
+      --replace "/bin/bash" "${buildPackages.bash}/bin/bash"
+
+    # Patch library paths in sources
+    substituteInPlace src/core/web_engine_library_info.cpp \
+      --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \
+      --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \
+      --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\""
+  ''
+  + lib.optionalString stdenv.isLinux ''
+    sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
+      src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
+
+    sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
+      src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
+  ''
+  + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure.cmake src/gn/CMakeLists.txt \
+      --replace "AppleClang" "Clang"
+    substituteInPlace cmake/Functions.cmake \
+      --replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun"
+    substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
+      --replace "\$sysroot/usr" "${xnu}"
+  '';
+
+  cmakeFlags = [
+    "-DQT_FEATURE_qtpdf_build=ON"
+    "-DQT_FEATURE_qtpdf_widgets_build=ON"
+    "-DQT_FEATURE_qtpdf_quick_build=ON"
+    "-DQT_FEATURE_pdf_v8=ON"
+    "-DQT_FEATURE_pdf_xfa=ON"
+    "-DQT_FEATURE_pdf_xfa_bmp=ON"
+    "-DQT_FEATURE_pdf_xfa_gif=ON"
+    "-DQT_FEATURE_pdf_xfa_png=ON"
+    "-DQT_FEATURE_pdf_xfa_tiff=ON"
+    "-DQT_FEATURE_webengine_system_libevent=ON"
+    "-DQT_FEATURE_webengine_system_ffmpeg=ON"
+    # android only. https://bugreports.qt.io/browse/QTBUG-100293
+    # "-DQT_FEATURE_webengine_native_spellchecker=ON"
+    "-DQT_FEATURE_webengine_sanitizer=ON"
+    "-DQT_FEATURE_webengine_kerberos=ON"
+  ] ++ lib.optionals stdenv.isLinux [
+    "-DQT_FEATURE_webengine_system_libxml=ON"
+    "-DQT_FEATURE_webengine_webrtc_pipewire=ON"
+
+    # Appears not to work on some platforms
+    # https://github.com/Homebrew/homebrew-core/issues/104008
+    "-DQT_FEATURE_webengine_system_icu=ON"
+  ] ++ lib.optionals enableProprietaryCodecs [
+    "-DQT_FEATURE_webengine_proprietary_codecs=ON"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinSdkVersion}"
+  ];
+
+  propagatedBuildInputs = [
+    qtdeclarative
+    qtwebchannel
+    qtwebsockets
+    qtpositioning
+
+    # Image formats
+    libjpeg
+    libpng
+    libtiff
+    libwebp
+
+    # Video formats
+    srtp
+    libvpx
+
+    # Audio formats
+    libopus
+
+    # Text rendering
+    harfbuzz
+
+    openssl
+    glib
+    libxslt
+    lcms2
+
+    libevent
+    ffmpeg_4
+  ] ++ lib.optionals stdenv.isLinux [
+    dbus
+    zlib
+    minizip
+    snappy
+    nss
+    protobuf
+    jsoncpp
+
+    icu
+    libxml2
+
+    # Audio formats
+    alsa-lib
+    pulseaudio
+
+    # Text rendering
+    fontconfig
+    freetype
+
+    libcap
+    pciutils
+
+    # X11 libs
+    xorg.xrandr
+    libXScrnSaver
+    libXcursor
+    libXrandr
+    xorg.libpciaccess
+    libXtst
+    xorg.libXcomposite
+    xorg.libXdamage
+    libdrm
+    xorg.libxkbfile
+    libxshmfence
+    libXi
+    xorg.libXext
+
+    # Pipewire
+    pipewire
+
+    libkrb5
+    mesa
+  ] ++ lib.optionals stdenv.isDarwin [
+    AGL
+    AVFoundation
+    Accelerate
+    Cocoa
+    CoreLocation
+    CoreML
+    ForceFeedback
+    GameController
+    ImageCaptureCore
+    LocalAuthentication
+    MediaAccessibility
+    MediaPlayer
+    MetalKit
+    Network
+    OpenDirectory
+    Quartz
+    ReplayKit
+    SecurityInterface
+    Vision
+
+    openbsm
+    libunwind
+  ];
+
+  buildInputs = [
+    cups
+  ] ++ lib.optionals stdenv.isDarwin [
+    libpm
+    sandbox
+  ];
+
+  requiredSystemFeatures = [ "big-parallel" ];
+
+  preConfigure = ''
+    export NINJAFLAGS="-j$NIX_BUILD_CORES"
+  '';
+
+  meta = with lib; {
+    description = "A web engine based on the Chromium web browser";
+    platforms = [ "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "armv7a-linux" "armv7l-linux" "x86_64-linux" ];
+    # This build takes a long time; particularly on slow architectures
+    # 1 hour on 32x3.6GHz -> maybe 12 hours on 4x2.4GHz
+    timeout = 24 * 3600;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix
new file mode 100644
index 000000000000..c3a346a8d78a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix
@@ -0,0 +1,11 @@
+{ qtModule
+, qtbase
+, qtdeclarative
+, openssl
+}:
+
+qtModule {
+  pname = "qtwebsockets";
+  propagatedBuildInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ openssl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebview.nix b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebview.nix
new file mode 100644
index 000000000000..e8ebea932f03
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/modules/qtwebview.nix
@@ -0,0 +1,14 @@
+{ lib
+, stdenv
+, qtModule
+, qtdeclarative
+, qtwebengine
+, WebKit
+}:
+
+qtModule {
+  pname = "qtwebview";
+  propagatedBuildInputs = [ qtdeclarative ]
+    ++ lib.optionals (!stdenv.isDarwin) [ qtwebengine ]
+    ++ lib.optionals stdenv.isDarwin [ WebKit ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch
new file mode 100644
index 000000000000..de35178f7929
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch
@@ -0,0 +1,50 @@
+From 90734859d2f9e6b9a1754c3e694ceb1a3c870bce Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Thu, 13 Apr 2023 23:42:29 +0800
+Subject: [PATCH 01/11] qtbase: qmake: always use libname instead of absolute
+ path in qmake files
+
+In generated qmake files, absolute paths to qt libraries are embedded
+and then used in linker flags. However as the libraries can be provided
+by qt modules other than the one currently being built, the ebedded
+paths can be incorrect.
+---
+ cmake/QtFinishPrlFile.cmake      | 7 ++++---
+ cmake/QtGenerateLibHelpers.cmake | 3 ---
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/cmake/QtFinishPrlFile.cmake b/cmake/QtFinishPrlFile.cmake
+index 1cf9377e6ce..ac4428bd7a1 100644
+--- a/cmake/QtFinishPrlFile.cmake
++++ b/cmake/QtFinishPrlFile.cmake
+@@ -64,9 +64,10 @@ foreach(line ${lines})
+                         endif()
+                         list(APPEND adjusted_libs "-framework" "${CMAKE_MATCH_1}")
+                     else()
+-                        # Not a framework, transform the Qt module into relocatable relative path.
+-                        qt_strip_library_version_suffix(relative_lib "${relative_lib}")
+-                        list(APPEND adjusted_libs "$$[QT_INSTALL_LIBS]/${relative_lib}")
++                        # Not a framework, extract the library name and prepend an -l to make
++                        # it relocatable.
++                        qt_transform_absolute_library_paths_to_link_flags(lib_with_link_flag "${lib}")
++                        list(APPEND adjusted_libs "${lib_with_link_flag}")
+                     endif()
+                 endif()
+             else()
+diff --git a/cmake/QtGenerateLibHelpers.cmake b/cmake/QtGenerateLibHelpers.cmake
+index 3ffe354fd8d..441332d4582 100644
+--- a/cmake/QtGenerateLibHelpers.cmake
++++ b/cmake/QtGenerateLibHelpers.cmake
+@@ -73,9 +73,6 @@ function(qt_transform_absolute_library_paths_to_link_flags out_var library_path_
+             string(TOLOWER "${dir}" dir_lower)
+             # If library_path isn't in default link directories, we should add it to link flags.
+             list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
+-            if(${index} EQUAL -1)
+-                list(APPEND out_list "-L\"${dir}\"")
+-            endif()
+             list(APPEND out_list "${lib_name_with_link_flag}")
+         else()
+             list(APPEND out_list "${library_path}")
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch
new file mode 100644
index 000000000000..6cdbec5abfc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch
@@ -0,0 +1,485 @@
+From a804a9b1efdab0a71b9947e5c2bf9f6f5e316e0e Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Fri, 14 Apr 2023 21:43:04 +0800
+Subject: [PATCH 02/11] qtbase: qmake: fix mkspecs for darwin
+
+---
+ mkspecs/common/mac.conf               |   2 +-
+ mkspecs/features/mac/default_post.prf | 263 --------------------------
+ mkspecs/features/mac/default_pre.prf  |  58 ------
+ mkspecs/features/mac/sdk.mk           |  27 ---
+ mkspecs/features/mac/sdk.prf          |  61 ------
+ mkspecs/features/mac/toolchain.prf    |   5 -
+ 6 files changed, 1 insertion(+), 415 deletions(-)
+
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index 61bea952b2..9909dae726 100644
+--- a/mkspecs/common/mac.conf
++++ b/mkspecs/common/mac.conf
+@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL     = \
+ 
+ QMAKE_FIX_RPATH         = install_name_tool -id
+ 
+-QMAKE_LFLAGS_RPATH      = -Wl,-rpath,
++QMAKE_LFLAGS_RPATH      =
+ QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
+ 
+ QMAKE_LFLAGS_REL_RPATH  =
+diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
+index 0b64a586b9..3b40328304 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -1,9 +1,5 @@
+ load(default_post)
+ 
+-# Recompute SDK version in case the user set it explicitly
+-sdk_version = $$QMAKE_MAC_SDK_VERSION
+-QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
+-
+ contains(TEMPLATE, .*app) {
+     !macx-xcode:if(isEmpty(BUILDS)|build_pass) {
+         # Detect changes to the platform SDK
+@@ -15,270 +11,10 @@ contains(TEMPLATE, .*app) {
+ 
+         QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
+     }
+-
+-    # Detect incompatible SDK versions
+-    # The CMake equivalent is in cmake/QtPublicAppleHelpers.cmake.
+-
+-    isEmpty(QT_MAC_SDK_VERSION_MIN): \
+-        QT_MAC_SDK_VERSION_MIN = $$QT_MAC_SDK_VERSION
+-
+-    !versionAtLeast(QMAKE_MAC_SDK_VERSION, $$QT_MAC_SDK_VERSION_MIN): \
+-        warning("Qt requires at least version $$QT_MAC_SDK_VERSION_MIN of the platform SDK," \
+-              "you're building against version $${QMAKE_MAC_SDK_VERSION}. Please upgrade.")
+-
+-    !isEmpty(QT_MAC_SDK_VERSION_MAX) {
+-        # For Qt developers only
+-        !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \
+-            CONFIG += sdk_no_version_check
+-
+-        QMAKE_MAC_SDK_MAJOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1)
+-
+-        !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
+-            warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
+-                    "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_VERSION}.")
+-            warning("This is an unsupported configuration. You may experience build issues," \
+-                    "and by using")
+-            warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
+-                    "that Qt has not been prepared for.")
+-
+-            warning("Please downgrade the SDK you use to build your app to version" \
+-                    "$$QT_MAC_SDK_VERSION_MAX, or configure")
+-            warning("with CONFIG+=sdk_no_version_check when running qmake" \
+-                    "to silence this warning.")
+-        }
+-    }
+ }
+ 
+ !no_objective_c:CONFIG += objective_c
+ 
+-# Add the same default rpaths as Xcode does for new projects.
+-# This is especially important for iOS/tvOS/watchOS where no other option is possible.
+-!no_default_rpath {
+-    uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
+-    else: QMAKE_RPATHDIR += @executable_path/../Frameworks
+-    equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
+-}
+-
+-# Don't pass -headerpad_max_install_names when using Bitcode.
+-# In that case the linker emits a warning stating that the flag is ignored when
+-# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
+-# Using this flag is also unnecessary in practice on UIKit platforms since they
+-# are sandboxed, and only UIKit platforms support bitcode to begin with.
+-!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
+-
+-app_extension_api_only {
+-    QMAKE_CFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS            += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_LFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-}
+-
+-macos {
+-    !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
+-        # If the user has requested a specific set of architectures,
+-        # build all of those by default, but limited to only those.
+-        CONFIG -= only_active_arch
+-    } else {
+-        # Otherwise allow building all of the architectures available
+-        # in Qt, but only build the active arch (unless the user has
+-        # manually overridden this via CONFIG -= only_active_arch).
+-        QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS
+-    }
+-}
+-
+-macx-xcode {
+-    qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
+-    !isEmpty(QMAKE_PKGINFO_TYPEINFO): \
+-        qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
+-    else: \
+-        qmake_pkginfo_typeinfo.value = "????"
+-    QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
+-
+-    bundle_version = $$VERSION
+-    isEmpty(bundle_version): bundle_version = 1.0.0
+-
+-    l = $$split(bundle_version, '.') 0 0  # make sure there are at least three
+-    VER_MAJ = $$member(l, 0, 0)
+-    VER_MIN = $$member(l, 1, 1)
+-    VER_PAT = $$member(l, 2, 2)
+-    unset(l)
+-
+-    qmake_full_version.name = QMAKE_FULL_VERSION
+-    qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
+-    QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
+-
+-    qmake_short_version.name = QMAKE_SHORT_VERSION
+-    qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
+-    QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
+-
+-    !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
+-        debug_information_format.name = DEBUG_INFORMATION_FORMAT
+-        debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
+-        debug_information_format.build = debug
+-        QMAKE_MAC_XCODE_SETTINGS += debug_information_format
+-    }
+-
+-    QMAKE_XCODE_ARCHS =
+-
+-    arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
+-    arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_MAC_XCODE_SETTINGS += arch_device
+-
+-    ios:simulator {
+-        arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
+-        arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_MAC_XCODE_SETTINGS += arch_simulator
+-    }
+-
+-    only_active_arch.name = ONLY_ACTIVE_ARCH
+-    only_active_arch.value = YES
+-    only_active_arch.build = debug
+-    QMAKE_MAC_XCODE_SETTINGS += only_active_arch
+-} else {
+-    device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
+-    ios:simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-    VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
+-
+-    single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
+-
+-    macos {
+-        only_active_arch: DEFAULT_ARCHS = $$system("uname -m")
+-        else: DEFAULT_ARCHS = $$VALID_ARCHS
+-    }
+-
+-    ARCHS = $(filter $(EXPORT_VALID_ARCHS), \
+-        $(if $(ARCHS), $(ARCHS), \
+-            $(if $(EXPORT_DEFAULT_ARCHS), $(EXPORT_DEFAULT_ARCHS), \
+-        $(EXPORT_VALID_ARCHS))))
+-    ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ARCHS), $(EXPORT_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
+-
+-    QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS
+-
+-    arch_flags = $(EXPORT_ARCH_ARGS)
+-
+-    QMAKE_CFLAGS += $$arch_flags
+-    QMAKE_CXXFLAGS += $$arch_flags
+-    QMAKE_LFLAGS += $$arch_flags
+-
+-    QMAKE_PCH_ARCHS = $$VALID_ARCHS
+-
+-    macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
+-    ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
+-    tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
+-    watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
+-
+-    # If we're doing a simulator and device build, device and simulator
+-    # architectures use different paths and flags for the sysroot and
+-    # deployment target switch, so we must multiplex them across multiple
+-    # architectures using -Xarch. Otherwise we fall back to the simple path.
+-    # This is not strictly necessary, but results in cleaner command lines
+-    # and makes it easier for people to override EXPORT_VALID_ARCHS to limit
+-    # individual rules to a different set of architecture(s) from the overall
+-    # build (such as machtest in QtCore).
+-    ios:simulator:device {
+-        QMAKE_XARCH_CFLAGS =
+-        QMAKE_XARCH_LFLAGS =
+-        QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
+-
+-        for (arch, VALID_ARCHS) {
+-            contains(VALID_SIMULATOR_ARCHS, $$arch) {
+-                sdk = $$simulator.sdk
+-                version_identifier = $$simulator.deployment_identifier
+-                platform_identifier = $$simulator.sdk
+-            } else {
+-                sdk = $$device.sdk
+-                version_identifier = $$device.deployment_identifier
+-                platform_identifier = $$device.sdk
+-            }
+-
+-            version_min_flags = \
+-                -Xarch_$${arch} \
+-                -m$${version_identifier}-version-min=$$deployment_target
+-            QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -isysroot$$xcodeSDKInfo(Path, $$sdk)
+-            QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -isysroot$$xcodeSDKInfo(Path, $$sdk)
+-
+-            QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
+-            QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
+-
+-            QMAKE_EXTRA_VARIABLES += \
+-                QMAKE_XARCH_CFLAGS_$${arch} \
+-                QMAKE_XARCH_LFLAGS_$${arch}
+-        }
+-
+-        QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
+-    } else {
+-        ios:simulator {
+-            version_identifier = $$simulator.deployment_identifier
+-            platform_identifier = $$simulator.sdk
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$simulator.sdk)
+-        } else {
+-            version_identifier = $$device.deployment_identifier
+-            platform_identifier = $$device.sdk
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$device.sdk)
+-        }
+-        version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+-        QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-    }
+-
+-    # Enable precompiled headers for multiple architectures
+-    QMAKE_CFLAGS_USE_PRECOMPILE =
+-    for (arch, VALID_ARCHS) {
+-        icc_pch_style: \
+-            use_flag = "-pch-use "
+-        else: \
+-            use_flag = -include
+-
+-        # Only use Xarch with multi-arch, as the option confuses ccache
+-        count(VALID_ARCHS, 1, greaterThan): \
+-            QMAKE_CFLAGS_USE_PRECOMPILE += \
+-                -Xarch_$${arch}
+-
+-        QMAKE_CFLAGS_USE_PRECOMPILE += \
+-            $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
+-    }
+-    icc_pch_style {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
+-        QMAKE_CFLAGS_USE_PRECOMPILE =
+-    } else {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-    }
+-
+-    QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
+-}
+-
+-!equals(sdk_version, $$QMAKE_MAC_SDK_VERSION) {
+-    # Explicit SDK version has been set, respect that
+-    QMAKE_LFLAGS += -Wl,-sdk_version -Wl,$$sdk_version
+-}
+-
+-cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+-!isEmpty(QMAKE_XCODE_VERSION): \
+-    cache(QMAKE_XCODE_VERSION, stash)
+-
+-QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
+-
+-xcode_product_bundle_identifier_setting.name = PRODUCT_BUNDLE_IDENTIFIER
+-xcode_product_bundle_identifier_setting.value = $$QMAKE_TARGET_BUNDLE_PREFIX
+-isEmpty(xcode_product_bundle_identifier_setting.value): \
+-    xcode_product_bundle_identifier_setting.value = "com.yourcompany"
+-xcode_product_bundle_target = $$QMAKE_BUNDLE
+-isEmpty(xcode_product_bundle_target): \
+-    xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
+-xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
+-QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
+-
+ !macx-xcode {
+     generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
+     generate_xcode_project.target = xcodeproj
+diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
+index e3534561a5..3b01424e67 100644
+--- a/mkspecs/features/mac/default_pre.prf
++++ b/mkspecs/features/mac/default_pre.prf
+@@ -1,60 +1,2 @@
+ CONFIG = asset_catalogs rez $$CONFIG
+ load(default_pre)
+-
+-isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
+-    # Get path of Xcode's Developer directory
+-    QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
+-    isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
+-
+-    # Make sure Xcode path is valid
+-    !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
+-}
+-
+-isEmpty(QMAKE_XCODEBUILD_PATH): \
+-    QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
+-
+-!isEmpty(QMAKE_XCODEBUILD_PATH) {
+-    # Make sure Xcode is set up properly
+-    !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
+-        error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
+-
+-    isEmpty(QMAKE_XCODE_VERSION) {
+-        # Extract Xcode version using xcodebuild
+-        xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
+-        QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+-        isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+-        unset(xcode_version)
+-    }
+-}
+-
+-isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
+-    QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
+-    exists($$QMAKE_XCODE_PREFERENCES_FILE): \
+-        QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
+-
+-    !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
+-        cache(QMAKE_TARGET_BUNDLE_PREFIX)
+-}
+-
+-QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
+-
+-# Make the default debug info format for static debug builds
+-# DWARF instead of DWARF with dSYM. This cuts down build times
+-# for application debug builds significantly, as Xcode doesn't
+-# have to pull out all the DWARF info from the Qt static libs
+-# and put it into a dSYM file. We don't need that dSYM file in
+-# the first place, since the information is available in the
+-# object files inside the archives (static libraries).
+-macx-xcode:qtConfig(static): \
+-    QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
+-
+-# This variable is used by the xcode_dynamic_library_suffix
+-# feature, which allows Xcode to choose the Qt libraries to link to
+-# at build time, depending on the current Xcode SDK and configuration.
+-QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
+-
+-xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
+-xcode_copy_phase_strip_setting.value = NO
+-QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
+diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
+index a32ceacb6c..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.mk
++++ b/mkspecs/features/mac/sdk.mk
+@@ -1,27 +0,0 @@
+-
+-ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
+-    CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>/dev/null
+-    CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
+-    ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
+-        # We don't want to complain about out of date SDK unless the target needs to be remade.
+-        # This covers use-cases such as running 'make check' after moving the build to a
+-        # computer without Xcode or with a different Xcode version.
+-        TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
+-        ifeq ($(TARGET_UP_TO_DATE),0)
+-            ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
+-                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
+-            else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
+-                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
+-            else ifneq ($(CURRENT_MAC_SDK_VERSION),)
+-                $(info The $(EXPORT_QMAKE_MAC_SDK) platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
+-            else
+-                $(info Unknown error resolving current platform SDK version.)
+-            endif
+-            $(info This requires a fresh build of your project. Please wipe the build directory)
+-            ifneq ($(EXPORT__QMAKE_STASH_),)
+-                $(info including the qmake cache in $(EXPORT__QMAKE_STASH_))
+-            endif
+-            $(error ^)
+-        endif
+-    endif
+-endif
+diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
+index 3a9c2778bb..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.prf
++++ b/mkspecs/features/mac/sdk.prf
+@@ -1,61 +0,0 @@
+-
+-isEmpty(QMAKE_MAC_SDK): \
+-    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
+-
+-contains(QMAKE_MAC_SDK, .*/.*): \
+-    error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
+-
+-defineReplace(xcodeSDKInfo) {
+-    info = $$1
+-    equals(info, "Path"): \
+-        infoarg = --show-sdk-path
+-    equals(info, "PlatformPath"): \
+-        infoarg = --show-sdk-platform-path
+-    equals(info, "SDKVersion"): \
+-        infoarg = --show-sdk-version
+-    sdk = $$2
+-    isEmpty(sdk): \
+-        sdk = $$QMAKE_MAC_SDK
+-
+-    isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
+-        QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null")
+-        # --show-sdk-platform-path won't work for Command Line Tools; this is fine
+-        # only used by the XCTest backend to testlib
+-        isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \
+-            error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
+-        cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
+-    }
+-
+-    return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
+-}
+-
+-QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
+-QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
+-QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
+-
+-isEmpty(QMAKE_EXPORT_INCDIR_OPENGL) {
+-    QMAKE_EXPORT_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL
+-    sysrootified =
+-    for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
+-    QMAKE_INCDIR_OPENGL = $$sysrootified
+-}
+-
+-QMAKESPEC_NAME = $$basename(QMAKESPEC)
+-
+-# Resolve SDK version of various tools
+-for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL QMAKE_LINK_C QMAKE_LINK_C_SHLIB)) {
+-    tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
+-    !isEmpty($$tool_variable) {
+-        $$tool = $$eval($$tool_variable)
+-        next()
+-    }
+-
+-    value = $$eval($$tool)
+-    isEmpty(value): next()
+-
+-    sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
+-    isEmpty(sysrooted): next()
+-
+-    $$tool = $$sysrooted $$member(value, 1, -1)
+-    cache($$tool_variable, set stash, $$tool)
+-}
+diff --git a/mkspecs/features/mac/toolchain.prf b/mkspecs/features/mac/toolchain.prf
+index df191eb13c..e69de29bb2 100644
+--- a/mkspecs/features/mac/toolchain.prf
++++ b/mkspecs/features/mac/toolchain.prf
+@@ -1,5 +0,0 @@
+-# Ensure that we process sdk.prf first, as it will update QMAKE_CXX,
+-# which the default path determination uses.
+-sdk: load(sdk)
+-
+-load(toolchain)
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch
new file mode 100644
index 000000000000..53f226254a19
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch
@@ -0,0 +1,26 @@
+From 6088085d3074316dd74639fc6c1233e5862aff11 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Fri, 14 Apr 2023 09:34:46 +0800
+Subject: [PATCH 03/11] qtbase: qmake: fix includedir in generated pkg-config
+
+---
+ qmake/generators/makefile.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
+index 11d2f0ff7df..c78ed0d3485 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -3412,8 +3412,7 @@ MakefileGenerator::writePkgConfigFile()
+       << varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
+         //      << varGlue("DEFINES","-D"," -D"," ")
+          ;
+-    if (!project->values("QMAKE_DEFAULT_INCDIRS").contains(includeDir))
+-        t << "-I${includedir}";
++    t << "-I${includedir}";
+     if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")
+         && libDir != QLatin1String("/Library/Frameworks")) {
+             t << " -F${libdir}";
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
new file mode 100644
index 000000000000..ccd0fb02fcd8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
@@ -0,0 +1,26 @@
+From 82e243f326aea40e7f3da935d8166979b11e8063 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 21 Mar 2023 15:48:49 +0800
+Subject: [PATCH 04/11] qtbase: deal with a font face at index 0 as Regular for
+ Variable fonts
+
+Reference: https://bugreports.qt.io/browse/QTBUG-111994
+---
+ src/gui/text/unix/qfontconfigdatabase.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gui/text/unix/qfontconfigdatabase.cpp b/src/gui/text/unix/qfontconfigdatabase.cpp
+index 474644b871f..c7a117fd134 100644
+--- a/src/gui/text/unix/qfontconfigdatabase.cpp
++++ b/src/gui/text/unix/qfontconfigdatabase.cpp
+@@ -556,6 +556,7 @@ void QFontconfigDatabase::populateFontDatabase()
+             FcObjectSetAdd(os, *p);
+             ++p;
+         }
++        FcPatternAddBool(pattern, FC_VARIABLE, FcFalse);
+         fonts = FcFontList(nullptr, pattern, os);
+         FcObjectSetDestroy(os);
+         FcPatternDestroy(pattern);
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch
new file mode 100644
index 000000000000..ad30ebc71413
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch
@@ -0,0 +1,32 @@
+From b480022b364b262d5ff63738c02318da925f5c79 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Wed, 12 Apr 2023 10:13:50 +0800
+Subject: [PATCH 05/11] qtbase: qt-cmake: always use cmake from path
+
+The generated qt-cmake scripts embeds the absolute path of cmake used
+during the build of qtbase, bloating the runtime closure of qtbase.
+---
+ bin/qt-cmake.in | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in
+index f719257f602..571ffe788fa 100755
+--- a/bin/qt-cmake.in
++++ b/bin/qt-cmake.in
+@@ -4,12 +4,7 @@
+ script_dir_path=`dirname $0`
+ script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
+ 
+-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
+-original_cmake_path="@CMAKE_COMMAND@"
+-cmake_path=$original_cmake_path
+-if ! test -f "$cmake_path"; then
+-    cmake_path="cmake"
+-fi
++cmake_path="cmake"
+ 
+ toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"
+ 
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch
new file mode 100644
index 000000000000..1d60684e0700
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch
@@ -0,0 +1,45 @@
+From a8b9fae710a2bd5e743f5e16364eaa8c38dbd784 Mon Sep 17 00:00:00 2001
+From: rewine <luhongxu@deepin.org>
+Date: Wed, 29 Mar 2023 11:51:33 +0800
+Subject: [PATCH 06/11] qtbase-find-tools-in-PATH
+
+1. find qt's tools in `QTTOOLSPATH` env
+   qt assumes that all components use the same install prefix
+   we can't get the real prefix for qttools when build qtbase
+   we will add /libexec to `QTTOOLSPATH` in qtToolsHook
+   find_path will also search in 'PATH' by default
+   see `CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`
+
+2. disable tool_dependencies_enabled
+   We can guarantee the build order of qt components in nixpkgs
+   tools in qttools always build before qtdoc
+   qdoc_bin is not a build target now, since we find it in `QTTOOLSPATH`
+---
+ cmake/QtDocsHelpers.cmake | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
+index 48ed5a324bf..91d8d41fb1f 100644
+--- a/cmake/QtDocsHelpers.cmake
++++ b/cmake/QtDocsHelpers.cmake
+@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
+         set(doc_tools_libexec "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}")
+     endif()
+ 
+-    set(qdoc_bin "${doc_tools_bin}/qdoc${CMAKE_EXECUTABLE_SUFFIX}")
+-    set(qtattributionsscanner_bin "${doc_tools_libexec}/qtattributionsscanner${CMAKE_EXECUTABLE_SUFFIX}")
+-    set(qhelpgenerator_bin "${doc_tools_libexec}/qhelpgenerator${CMAKE_EXECUTABLE_SUFFIX}")
++    set(tool_dependencies_enabled FALSE)
++
++    find_path(qdoc_path name qdoc PATHS ENV QTTOOLSPATH)
++    find_path(qtattributionsscanner_path name qtattributionsscanner PATHS ENV QTTOOLSPATH)
++    find_path(qhelpgenerator_path name qhelpgenerator PATHS ENV QTTOOLSPATH)
++    set(qdoc_bin "${qdoc_path}/qdoc${CMAKE_EXECUTABLE_SUFFIX}")
++    set(qtattributionsscanner_bin "${qtattributionsscanner_path}/qtattributionsscanner${CMAKE_EXECUTABLE_SUFFIX}")
++    set(qhelpgenerator_bin "${qhelpgenerator_path}/qhelpgenerator${CMAKE_EXECUTABLE_SUFFIX}")
+ 
+     get_target_property(target_type ${target} TYPE)
+     if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
new file mode 100644
index 000000000000..7bf2193bc208
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
@@ -0,0 +1,30 @@
+From d7a9a3b0ecdbb1b5829f25954d763d767f1c8794 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 10:12:56 -0400
+Subject: [PATCH 07/11] qtbase: pass to qmlimportscanner the QML2_IMPORT_PATH
+
+---
+ src/tools/macdeployqt/shared/shared.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
+index 2ae4f998944..ba10ae02bcd 100644
+--- a/src/tools/macdeployqt/shared/shared.cpp
++++ b/src/tools/macdeployqt/shared/shared.cpp
+@@ -1297,6 +1297,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
+     argumentList.append( "-importPath");
+     argumentList.append(qmlImportsPath);
+ 
++    // In a modularized installation of qt as we have in Nix, instead, we will
++    // read the paths from the environment, as they are spread in multiple
++    // locations and normally set in the environment like this
++    auto envQmlImportPaths = ::qgetenv("QML2_IMPORT_PATH").split(':');
++    for (const QString &importPath : envQmlImportPaths)
++        argumentList << "-importPath" << importPath;
++
+     // run qmlimportscanner
+     QProcess qmlImportScanner;
+     qmlImportScanner.start(qmlImportScannerPath, argumentList);
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch
new file mode 100644
index 000000000000..07f1973d7607
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch
@@ -0,0 +1,22 @@
+From 79da6bb6ff075e8cf972be8a462630f1ec86bf0a Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 10:14:40 -0400
+Subject: [PATCH 08/11] qtbase: allow translations outside prefix
+
+---
+ cmake/QtBuild.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/QtBuildPathsHelpers.cmake b/cmake/QtBuildPathsHelpers.cmake
+index edc43f2f14..78fa219515 100644
+--- a/cmake/QtBuildPathsHelpers.cmake
++++ b/cmake/QtBuildPathsHelpers.cmake
+@@ -134,7 +134,7 @@ function(qt_configure_process_path name default docstring)
+             set(rel_path ".")
+         elseif(rel_path MATCHES "^\.\./")
+             # INSTALL_SYSCONFDIR is allowed to be outside the prefix.
+-            if(NOT name STREQUAL "INSTALL_SYSCONFDIR")
++            if(NOT (name STREQUAL "INSTALL_SYSCONFDIR" OR name STREQUAL "INSTALL_TRANSLATIONSDIR"))
+                 message(FATAL_ERROR
+                     "Path component '${name}' is outside computed install prefix: ${rel_path} ")
+                 return()
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
new file mode 100644
index 000000000000..fb17a539f053
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
@@ -0,0 +1,36 @@
+From d503be89320f0b89b80acb19769971e855be6ae1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
+Date: Wed, 9 Aug 2023 16:16:21 +0200
+Subject: [PATCH 09/11] qtbase: find qmlimportscanner in macdeployqt via
+ environment
+
+The qmlimportscanner tool is provided by qtdeclarative. Because of the
+modularized installation in Nix, it can not be found via the usual
+mechanisms.  Also, hard-coding it like we do for Qt5 would also not
+work, as it would require making qtbase depend on qtdeclarative.
+
+Here we add an option to provide its location via the environment.
+While this means macdeployqt does not work out of the box, it provides
+a workaround for users.
+---
+ src/tools/macdeployqt/shared/shared.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
+index ba10ae02bcd..320095a972d 100644
+--- a/src/tools/macdeployqt/shared/shared.cpp
++++ b/src/tools/macdeployqt/shared/shared.cpp
+@@ -1277,6 +1277,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
+     if (!QFile::exists(qmlImportScannerPath))
+         qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+ 
++    // Fallback: Pass qml import scanner via environment variable
++    if (!QFile::exists(qmlImportScannerPath))
++        qmlImportScannerPath = ::qgetenv("NIX_QMLIMPORTSCANNER");
++
+     // Verify that we found a qmlimportscanner binary
+     if (!QFile::exists(qmlImportScannerPath)) {
+         LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
new file mode 100644
index 000000000000..ed749cb238a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
@@ -0,0 +1,35 @@
+From c00e310092d9aeb48adf21dd22f1ee4dbdbf5ebb Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 10:17:00 -0400
+Subject: [PATCH 10/11] qtbase: check in the QML folder of this library does
+ actually exist
+
+In a modularized installation, this folder will be the location where
+`qtbase` itself is installed, but `qtbase` does not have any QML
+code, and `qmlimportscanner` will complain that it does not exist.
+---
+ src/tools/macdeployqt/shared/shared.cpp | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
+index 320095a972d..87ba0d4e24b 100644
+--- a/src/tools/macdeployqt/shared/shared.cpp
++++ b/src/tools/macdeployqt/shared/shared.cpp
+@@ -1297,9 +1297,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
+     }
+     for (const QString &importPath : qmlImportPaths)
+         argumentList << "-importPath" << importPath;
++
+     QString qmlImportsPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath);
+-    argumentList.append( "-importPath");
+-    argumentList.append(qmlImportsPath);
++    if (QFile::exists(qmlImportsPath)) {
++        argumentList.append( "-importPath");
++        argumentList.append(qmlImportsPath);
++    }
+ 
+     // In a modularized installation of qt as we have in Nix, instead, we will
+     // read the paths from the environment, as they are spread in multiple
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch
new file mode 100644
index 000000000000..22530f453536
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch
@@ -0,0 +1,33 @@
+From f0c4d3860b75cb064d066045907622d536044096 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Sun, 10 May 2020 12:47:28 +0200
+Subject: [PATCH 11/11] qtbase: derive plugin load path from PATH
+
+---
+ src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
+index a80efbb5622..8cf9e85da43 100644
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2991,6 +2991,16 @@ QStringList QCoreApplication::libraryPathsLocked()
+         QStringList *app_libpaths = new QStringList;
+         coreappdata()->app_libpaths.reset(app_libpaths);
+ 
++        // Add library paths derived from PATH
++        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":"));
++        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
++        for (const QString &path: paths) {
++            if (!path.isEmpty()) {
++                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
++            }
++        }
++
++
+         auto setPathsFromEnv = [&](QString libPathEnv) {
+             if (!libPathEnv.isEmpty()) {
+                 QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts);
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch
new file mode 100644
index 000000000000..a204d52c9f0c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-default-disable-qmlcache.patch
@@ -0,0 +1,29 @@
+From 2d561e0a80f2d123a7348187975ee845f9dcd9e0 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 11:12:27 -0400
+Subject: [PATCH] qtdeclarative: disable qml disk cache
+
+---
+ src/qml/jsruntime/qv4engine.cpp | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
+index d1b4c4fff6..50f8a07420 100644
+--- a/src/qml/jsruntime/qv4engine.cpp
++++ b/src/qml/jsruntime/qv4engine.cpp
+@@ -2232,11 +2232,7 @@ ExecutionEngine::DiskCacheOptions ExecutionEngine::diskCacheOptions() const
+ {
+     if (forceDiskCache())
+         return DiskCache::Enabled;
+-    if (disableDiskCache() || debugger())
+-        return DiskCache::Disabled;
+-    static const DiskCacheOptions options = qmlGetConfigOption<
+-            DiskCacheOptions, transFormDiskCache>("QML_DISK_CACHE");
+-    return options;
++    return DiskCache::Disabled;
+ }
+ 
+ void ExecutionEngine::callInContext(QV4::Function *function, QObject *self,
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch
new file mode 100644
index 000000000000..39b7a30892cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch
@@ -0,0 +1,12 @@
+diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
+index 2e482c220d..4873809bec 100644
+--- a/src/qml/qml/qqmlimport.cpp
++++ b/src/qml/qml/qqmlimport.cpp
+@@ -1517,6 +1517,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
+     // env import paths
+     addEnvImportPath("QML_IMPORT_PATH");
+     addEnvImportPath("QML2_IMPORT_PATH");
++    addEnvImportPath("NIXPKGS_QT6_QML_IMPORT_PATH");
+ 
+     addImportPath(QStringLiteral("qrc:/qt/qml"));
+     addImportPath(QStringLiteral("qrc:/qt-project.org/imports"));
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qttools-paths.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qttools-paths.patch
new file mode 100644
index 000000000000..6e7b8488fa54
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qttools-paths.patch
@@ -0,0 +1,27 @@
+diff --git a/src/linguist/shared/runqttool.cpp b/src/linguist/shared/runqttool.cpp
+index d355b9dc..94fef33f 100644
+--- a/src/linguist/shared/runqttool.cpp
++++ b/src/linguist/shared/runqttool.cpp
+@@ -20,9 +20,21 @@ class FMT {
+     Q_DECLARE_TR_FUNCTIONS(Linguist)
+ };
+
++static QString qtBasePath(QLibraryInfo::LibraryPath location)
++{
++  switch (location) {
++    case QLibraryInfo::BinariesPath:
++      return QLatin1String(NIX_OUTPUT_OUT) + QLatin1String("/bin");
++    case QLibraryInfo::LibraryExecutablesPath:
++      return QLatin1String(NIX_OUTPUT_OUT) + QLatin1String("/libexec");
++    default:
++      return QLibraryInfo::path(location);
++  }
++}
++
+ static QString qtToolFilePath(const QString &toolName, QLibraryInfo::LibraryPath location)
+ {
+-    QString filePath = QLibraryInfo::path(location) + QLatin1Char('/') + toolName;
++    QString filePath = qtBasePath(location) + QLatin1Char('/') + toolName;
+ #ifdef Q_OS_WIN
+     filePath.append(QLatin1String(".exe"));
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-copy-certificate-chain.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-copy-certificate-chain.patch
new file mode 100644
index 000000000000..c7e461945c04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-copy-certificate-chain.patch
@@ -0,0 +1,16 @@
+diff --git a/src/3rdparty/chromium/net/cert/x509_util_apple.cc b/src/3rdparty/chromium/net/cert/x509_util_apple.cc
+index ae69948dfca..7062a9a9b97 100644
+--- a/src/3rdparty/chromium/net/cert/x509_util_apple.cc
++++ b/src/3rdparty/chromium/net/cert/x509_util_apple.cc
+@@ -139,11 +139,6 @@ SHA256HashValue CalculateFingerprint256(SecCertificateRef cert) {
+ 
+ base::ScopedCFTypeRef<CFArrayRef> CertificateChainFromSecTrust(
+     SecTrustRef trust) {
+-  if (__builtin_available(macOS 12.0, iOS 15.0, *)) {
+-    return base::ScopedCFTypeRef<CFArrayRef>(
+-        SecTrustCopyCertificateChain(trust));
+-  }
+-
+   base::ScopedCFTypeRef<CFMutableArrayRef> chain(
+       CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
+   const CFIndex chain_length = SecTrustGetCertificateCount(trust);
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-low-latency-flag.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-low-latency-flag.patch
new file mode 100644
index 000000000000..3df917edf5cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-darwin-no-low-latency-flag.patch
@@ -0,0 +1,61 @@
+diff --git a/src/3rdparty/chromium/media/gpu/mac/vt_video_encode_accelerator_mac.cc b/src/3rdparty/chromium/media/gpu/mac/vt_video_encode_accelerator_mac.cc
+index d4b0161b2e..e5a0eb1967 100644
+--- a/src/3rdparty/chromium/media/gpu/mac/vt_video_encode_accelerator_mac.cc
++++ b/src/3rdparty/chromium/media/gpu/mac/vt_video_encode_accelerator_mac.cc
+@@ -29,12 +29,6 @@
+ #include "media/base/video_types.h"
+ #include "media/video/video_encode_accelerator.h"
+ 
+-// This is a min version of macOS where we want to support SVC encoding via
+-// EnableLowLatencyRateControl flag. The flag is actually supported since 11.3,
+-// but there we see frame drops even with ample bitrate budget. Excessive frame
+-// drops were fixed in 12.0.1.
+-#define LOW_LATENCY_FLAG_AVAILABLE_VER 12.0.1
+-
+ namespace media {
+ 
+ namespace {
+@@ -277,8 +271,6 @@ VTVideoEncodeAccelerator::GetSupportedH264Profiles() {
+   profile.rate_control_modes = VideoEncodeAccelerator::kConstantMode |
+                                VideoEncodeAccelerator::kVariableMode;
+   profile.scalability_modes.push_back(SVCScalabilityMode::kL1T1);
+-  if (__builtin_available(macOS LOW_LATENCY_FLAG_AVAILABLE_VER, *))
+-    profile.scalability_modes.push_back(SVCScalabilityMode::kL1T2);
+ 
+   for (const auto& supported_profile : kSupportedProfiles) {
+     if (VideoCodecProfileToVideoCodec(supported_profile) == VideoCodec::kH264) {
+@@ -814,14 +806,6 @@ bool VTVideoEncodeAccelerator::CreateCompressionSession(
+     encoder_values.push_back(kCFBooleanFalse);
+   }
+ 
+-  if (__builtin_available(macOS LOW_LATENCY_FLAG_AVAILABLE_VER, *)) {
+-    // Remove the validation once HEVC SVC mode is supported on macOS.
+-    if (require_low_delay_ && codec == VideoCodec::kH264) {
+-      encoder_keys.push_back(
+-          kVTVideoEncoderSpecification_EnableLowLatencyRateControl);
+-      encoder_values.push_back(kCFBooleanTrue);
+-    }
+-  }
+   base::ScopedCFTypeRef<CFDictionaryRef> encoder_spec =
+       video_toolbox::DictionaryWithKeysAndValues(
+           encoder_keys.data(), encoder_values.data(), encoder_keys.size());
+@@ -891,19 +875,8 @@ bool VTVideoEncodeAccelerator::ConfigureCompressionSession(VideoCodec codec) {
+ 
+   // Remove the validation once HEVC SVC mode is supported on macOS.
+   if (num_temporal_layers_ == 2 && codec_ == VideoCodec::kH264) {
+-    if (__builtin_available(macOS LOW_LATENCY_FLAG_AVAILABLE_VER, *)) {
+-      if (!session_property_setter.IsSupported(
+-              kVTCompressionPropertyKey_BaseLayerFrameRateFraction)) {
+-        DLOG(ERROR) << "BaseLayerFrameRateFraction is not supported";
+-        return false;
+-      }
+-      rv &= session_property_setter.Set(
+-          kVTCompressionPropertyKey_BaseLayerFrameRateFraction, 0.5);
+-      DLOG_IF(ERROR, !rv) << " Setting BaseLayerFrameRate property failed.";
+-    } else {
+       DLOG(ERROR) << "SVC encoding is not supported on this OS version.";
+       rv = false;
+-    }
+   }
+ 
+   return rv;
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch
new file mode 100644
index 000000000000..c4302113786e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-link-pulseaudio.patch
@@ -0,0 +1,24 @@
+From da66a74e8b8e57b4a60b2cd0d18ef3bebb15509c Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 11:45:24 -0400
+Subject: [PATCH 1/2] qtwebengine: link pulseaudio
+
+---
+ src/core/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
+index 4153ce180..e89f41798 100644
+--- a/src/core/CMakeLists.txt
++++ b/src/core/CMakeLists.txt
+@@ -340,6 +340,7 @@ foreach(arch ${archs})
+             use_static_angle=true
+             chrome_root_store_supported=false
+             trial_comparison_cert_verifier_supported=false
++            link_pulseaudio=true
+         )
+         extend_gn_list(gnArgArg
+             ARGS use_v8_context_snapshot v8_use_external_startup_data
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch
new file mode 100644
index 000000000000..fecdb93cd547
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch
@@ -0,0 +1,41 @@
+From 6f0068359f32d1e7ebaa32650c3b608c008a1127 Mon Sep 17 00:00:00 2001
+From: Nick Cao <nickcao@nichi.co>
+Date: Tue, 10 Oct 2023 11:46:28 -0400
+Subject: [PATCH 2/2] qtwebengine: fix path to locales
+
+---
+ src/core/api/CMakeLists.txt          | 3 ++-
+ src/core/web_engine_library_info.cpp | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
+index a3cb53e17..fcb6d70c5 100644
+--- a/src/core/api/CMakeLists.txt
++++ b/src/core/api/CMakeLists.txt
+@@ -190,7 +190,8 @@ if(QT_FEATURE_framework)
+ 
+ else()
+     install(FILES ${localeFiles}
+-        DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
++        # Nixpkgs: INSTALL_TRANSLATIONSDIR points to Qt base translations store path
++        DESTINATION ${INSTALL_DATADIR}/qtwebengine_locales
+         CONFIGURATIONS ${config}
+     )
+     install(FILES ${resourceFiles}
+diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
+index c03c9a3b2..430fdfab2 100644
+--- a/src/core/web_engine_library_info.cpp
++++ b/src/core/web_engine_library_info.cpp
+@@ -203,7 +203,8 @@ QString localesPath()
+             candidatePaths << getResourcesPath(frameworkBundle()) % QDir::separator()
+                             % QLatin1String("qtwebengine_locales");
+ #endif
+-            candidatePaths << QLibraryInfo::path(QLibraryInfo::TranslationsPath) % QDir::separator()
++            // Nixpkgs: match the changes made in CMakeLists.txt
++            candidatePaths << QLibraryInfo::path(QLibraryInfo::DataPath) % QDir::separator()
+                             % QLatin1String("qtwebengine_locales");
+             candidatePaths << fallbackDir();
+         }
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch
new file mode 100644
index 000000000000..5056550ccecd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/patches/qtwebengine-xkb-includes.patch
@@ -0,0 +1,12 @@
+--- a/src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc	2023-04-19 21:58:29.127258300 +0900
++++ b/src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc	2023-04-19 22:01:35.860196284 +0900
+@@ -637,8 +637,7 @@
+                           .variant = layout_variant.c_str(),
+                           .options = ""};
+   std::unique_ptr<xkb_context, XkbContextDeleter> context;
+-  context.reset(xkb_context_new(XKB_CONTEXT_NO_DEFAULT_INCLUDES));
+-  xkb_context_include_path_append(context.get(), "/usr/share/X11/xkb");
++  context.reset(xkb_context_new(XKB_CONTEXT_NO_FLAGS));
+   std::unique_ptr<xkb_keymap, XkbKeymapDeleter> keymap;
+   keymap.reset(xkb_keymap_new_from_names(context.get(), &names,
+                                          XKB_KEYMAP_COMPILE_NO_FLAGS));
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/qt-env.nix b/nixpkgs/pkgs/development/libraries/qt-6/qt-env.nix
new file mode 100644
index 000000000000..f0bf8721074f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/qt-env.nix
@@ -0,0 +1,22 @@
+{ buildEnv, qtbase }: name: paths:
+
+buildEnv {
+  inherit name;
+  paths = [ qtbase ] ++ paths;
+
+  pathsToLink = [ "/bin" "/mkspecs" "/include" "/lib" "/share" "/libexec" ];
+  extraOutputsToInstall = [ "out" "dev" ];
+
+  postBuild = ''
+    for f in qmake qmake6; do
+      rm "$out/bin/$f"
+      cp "${qtbase}/bin/$f" "$out/bin"
+    done
+    cat >"$out/bin/qt.conf" <<EOF
+    [Paths]
+    Prefix = $out
+    Plugins = ${qtbase.qtPluginPrefix}
+    Qml2Imports = ${qtbase.qtQmlPrefix}
+    EOF
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/qtModule.nix b/nixpkgs/pkgs/development/libraries/qt-6/qtModule.nix
new file mode 100644
index 000000000000..5434be84fa59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/qtModule.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, cmake
+, ninja
+, perl
+, moveBuildTree
+, srcs
+, patches ? [ ]
+}:
+
+args:
+
+let
+  inherit (args) pname;
+  version = args.version or srcs.${pname}.version;
+  src = args.src or srcs.${pname}.src;
+in
+stdenv.mkDerivation (args // {
+  inherit pname version src;
+  patches = args.patches or patches.${pname} or [ ];
+
+  buildInputs = args.buildInputs or [ ];
+  nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ]
+    ++ lib.optionals stdenv.isDarwin [ moveBuildTree ];
+  propagatedBuildInputs =
+    (lib.warnIf (args ? qtInputs) "qt6.qtModule's qtInputs argument is deprecated" args.qtInputs or []) ++
+    (args.propagatedBuildInputs or []);
+
+  moveToDev = false;
+
+  outputs = args.outputs or [ "out" "dev" ];
+
+  dontWrapQtApps = args.dontWrapQtApps or true;
+
+  meta = with lib; {
+    homepage = "https://www.qt.io/";
+    description = "A cross-platform application framework for C++";
+    license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
+    maintainers = with maintainers; [ milahu nickcao ];
+    platforms = platforms.unix;
+  } // (args.meta or { });
+})
diff --git a/nixpkgs/pkgs/development/libraries/qt-6/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-6/srcs.nix
new file mode 100644
index 000000000000..5fef072f3990
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-6/srcs.nix
@@ -0,0 +1,318 @@
+# DO NOT EDIT! This file is generated automatically.
+# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-6/fetch.sh
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qt3d-everywhere-src-6.6.2.tar.xz";
+      sha256 = "10l5ldw8g8m1ig3hh78pwg749xqf2gw9vsi8p67gbkanmipfqx4i";
+      name = "qt3d-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qt5compat = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qt5compat-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0rqr34lqf4mjdgjj09wzlvkxfknz8arjl9p30xpqbr2qfsmhhyz0";
+      name = "qt5compat-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtactiveqt-everywhere-src-6.6.2.tar.xz";
+      sha256 = "16vqb33s0dwxq1rrha81606fdwq1dz7az6mybgx18n7f081h3yl7";
+      name = "qtactiveqt-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtbase-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0yv78bwqzy975854h53rbiilsms62f3v02i3jqz7v8ajk1ml56xq";
+      name = "qtbase-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtcharts-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1x7m87lxbza4ynf6dq7yshann6003302a5fxih5l5d07xri64j5i";
+      name = "qtcharts-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtconnectivity-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1dzsvs0hngrz6b66r9zb4al5a4r6xxfd29i8g3jqmvw3b0452vx3";
+      name = "qtconnectivity-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtdatavis3d-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0iqw5afx8y29kjprn1hlz0zr0qwc9j0m7my75qf1av800hlnnjii";
+      name = "qtdatavis3d-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtdeclarative-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0k6qndjvkkx3g8lr7f64xx86b3cwxzkgpl6fr6cp73s6qjkyk763";
+      name = "qtdeclarative-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtdoc-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0hvv40y2h7xa7wj2cqz2rrsvy1xf2l95199vmgx4q27wgmn1xixg";
+      name = "qtdoc-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtgraphs = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtgraphs-everywhere-src-6.6.2.tar.xz";
+      sha256 = "19j9hdpxrclsdwqqblp4bk94zd2a5rvxnf548hm7r03npznjvb26";
+      name = "qtgraphs-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtgrpc = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtgrpc-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1flfm8j5vw2j6xzms1b470mbqyab1nrnj4z9s4mgwnbsp4m5p85w";
+      name = "qtgrpc-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qthttpserver = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qthttpserver-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1qzw96y20qr1kc9wmys61wm568jsknvlgvh09bbqjcmm6dm3lhd2";
+      name = "qthttpserver-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtimageformats-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1cvwm0hnspglydms6qhcp5g0ayz5pamigl52kz8km66l6s8lqn3i";
+      name = "qtimageformats-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtlanguageserver = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtlanguageserver-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1bgazi44mwac20biybhp21icgwa8k7jd295j8jsfgzxbw12lq7y3";
+      name = "qtlanguageserver-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtlocation-everywhere-src-6.6.2.tar.xz";
+      sha256 = "05glwmasg0rlhybzpb640iibcs6gyrqbs7h1ws4b5vgcmzzdq9cy";
+      name = "qtlocation-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtlottie = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtlottie-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1hqhp55jfasavk7p8xb0srbc6lnk70w2q0x4iwn28z5s5kd1cvi7";
+      name = "qtlottie-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtmultimedia-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1v0430jnv97ws6cizn9mi8zr9hcg7rixd0jg7smhdq8apacjb572";
+      name = "qtmultimedia-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtnetworkauth-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1lijsdwbj8gscfllmp358n5ysa8pvhx2msh7gpxvb4x81daxbg9j";
+      name = "qtnetworkauth-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtpositioning = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtpositioning-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1qn31vps9dj4g8m7d195qlsyj3p4dfqqszdc6yqq097dq5y5d9sd";
+      name = "qtpositioning-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtquick3d = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtquick3d-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0f1sp7d1jzdzaxqs2l2yjprp0axcqbg2w82dza7wl4paan4rzp7w";
+      name = "qtquick3d-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtquick3dphysics = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtquick3dphysics-everywhere-src-6.6.2.tar.xz";
+      sha256 = "10209x9hbr5bc4vlhhcvvfsmsn2h3dyb4rlg0f0gpllx68mr58ac";
+      name = "qtquick3dphysics-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtquickeffectmaker = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtquickeffectmaker-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0lywm71wp943dk3w8zkklyxfk97w48v670zs6pc4pj4ja0ns37q7";
+      name = "qtquickeffectmaker-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtquicktimeline = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtquicktimeline-everywhere-src-6.6.2.tar.xz";
+      sha256 = "06cr9p0hrq77ckqslxh0h3lpyw31fblyap1plcyyj8ssr1rm4klc";
+      name = "qtquicktimeline-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtremoteobjects-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0fbkjzykxpkz8myr6dy588gcmhyy3lar17v78zfam8kyxq7s5qxa";
+      name = "qtremoteobjects-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtscxml-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0gm4805570ds3jmkbwrjigbg93zc561bd5rc52r71042zzq84j89";
+      name = "qtscxml-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtsensors-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0a3w50bfnmxndyxnn9lsy1wxffhm2am0yjxqx3vx0gfjwv79yvsa";
+      name = "qtsensors-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtserialbus-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0g7sx81lrb5r2ipinnghq4iss6clkwbzjb0ck4ay6hmpw54smzww";
+      name = "qtserialbus-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtserialport-everywhere-src-6.6.2.tar.xz";
+      sha256 = "16j5fprmdzzc1snnj5184ihq5avg1s0jrqqcjk70dvmimsf0q7ms";
+      name = "qtserialport-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtshadertools = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtshadertools-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0bxrczs9nw6az2p4n8x0f660vsmxxynx4iqgj75l4zsfzzbym2v2";
+      name = "qtshadertools-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtspeech-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1qvf3p2p1pc5fw40d8zq0iawaaqkc0dp5yx85b1dnw1j809bn8y0";
+      name = "qtspeech-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtsvg-everywhere-src-6.6.2.tar.xz";
+      sha256 = "10c1dmbv5d39n1q4m67gf2h4n6wfkzrlyk8plnxbyhhvxxcis8ss";
+      name = "qtsvg-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qttools = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qttools-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0ij7djy06xi4v5v29fh31gqq5rnc12vviv3qg3vqf4hiaagrxm76";
+      name = "qttools-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qttranslations-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0xqcad8aa9lp6wzh1rs46id6r60zdw82qj3bq9k2b89sxy8c0fna";
+      name = "qttranslations-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtvirtualkeyboard-everywhere-src-6.6.2.tar.xz";
+      sha256 = "07nqds49g2x748jsk17cnd2ph81165xnzn70jwxd0gpbi3dzshk1";
+      name = "qtvirtualkeyboard-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtwayland-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0y6x84ckcc53ddclnrlzs08b1kvw6saw9nim0hz4wc5fyz7dbkcv";
+      name = "qtwayland-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtwebchannel-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1incvisc3j758b4k82vnwci8j1bba8zf6xgmgcrsm553k4wpsz1x";
+      name = "qtwebchannel-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtwebengine-everywhere-src-6.6.2.tar.xz";
+      sha256 = "15h3hniszfkxv2vnn3fnbgbar8wb41ypgn4b4iz4iy6csar8f7fn";
+      name = "qtwebengine-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtwebsockets-everywhere-src-6.6.2.tar.xz";
+      sha256 = "1y9q8jmspxbfxf07jdcg4n8zwmchccyzp0z68fxr0hnvr2dymrn0";
+      name = "qtwebsockets-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "6.6.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/6.6/6.6.2/submodules/qtwebview-everywhere-src-6.6.2.tar.xz";
+      sha256 = "0z3p1g26yg3dr3hhavwd5wz9b8yi838xj4s57068wykd80v145wb";
+      name = "qtwebview-everywhere-src-6.6.2.tar.xz";
+    };
+  };
+}