1--- a/src/corelib/kernel/qcoreapplication.cpp
2+++ b/src/corelib/kernel/qcoreapplication.cpp
3@@ -3038,6 +3038,15 @@ QStringList QCoreApplication::libraryPathsLocked()
4 app_libpaths->append(installPathPlugins);
5 }
6
7+ // Add library paths derived from PATH
8+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":"));
9+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
10+ for (const QString &path: paths) {
11+ if (!path.isEmpty()) {
12+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
13+ }
14+ }
15+
16 // If QCoreApplication is not yet instantiated,
17 // make sure we add the application path when we construct the QCoreApplication
18 if (self) self->d_func()->appendApplicationPathToLibraryPaths();