1 diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
2 index 005db4248..685c5b1b2 100644
3 --- a/src/qml/qml/qqmlimport.cpp
4 +++ b/src/qml/qml/qqmlimport.cpp
5 @@ -1760,6 +1760,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
6 QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
7 addImportPath(installImportsPath);
9 + // Add import paths derived from PATH
10 + const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
11 + const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
12 + for (const QString &path: paths) {
13 + if (!path.isEmpty()) {
14 + addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
19 if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
20 const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
21 diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
22 index 537eaf62e..e21de58f6 100644
23 --- a/tools/qmlcachegen/qmlcache.prf
24 +++ b/tools/qmlcachegen/qmlcache.prf
25 @@ -26,7 +26,7 @@ defineReplace(qmlCacheOutputFileName) {
28 qmlcacheinst.base = $$QMLCACHE_DESTDIR
29 -qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH
30 +qmlcacheinst.path = $$NIX_OUTPUT_QML/$$TARGETPATH
31 qmlcacheinst.CONFIG = no_check_exist
33 qmlcachegen.input = CACHEGEN_FILES