1diff --git a/CMakeLists.txt b/CMakeLists.txt
2index e1298ba..1af7d0a 100644
3--- a/CMakeLists.txt
4+++ b/CMakeLists.txt
5@@ -9,6 +9,7 @@ set(KF_MIN_VERSION "5.68.0")
6 project("WallpaperEngineKde")
7
8
9+add_definitions(-DQML_LIB="${QML_LIB}")
10 set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
11 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
12 if(NOT OpenGL_GL_PREFERENCE)
13diff --git a/plugin/contents/pyext.py b/plugin/contents/pyext.py
14old mode 100644
15new mode 100755
16diff --git a/plugin/contents/ui/Pyext.qml b/plugin/contents/ui/Pyext.qml
17index 1a48f5e..7db2480 100644
18--- a/plugin/contents/ui/Pyext.qml
19+++ b/plugin/contents/ui/Pyext.qml
20@@ -15,7 +15,8 @@ Item {
21 "[ -f /usr/share/$EXT ] && WKD=/usr/share/$EXT",
22 "[ -f \"$HOME/.local/share/$EXT\" ] && WKD=\"$HOME/.local/share/$EXT\"",
23 "[ -f \"$XDG_DATA_HOME/$EXT\" ] && WKD=\"$XDG_DATA_HOME/$EXT\"",
24- `exec python3 "$WKD" "${ws_server.url}"`
25+ "[ -f \"NIX_STORE_PACKAGE_PATH/share/$EXT\" ] && WKD=\"NIX_STORE_PACKAGE_PATH/share/$EXT\"",
26+ `"$WKD" "${ws_server.url}"`
27 ].join("\n");
28 return sh;
29 }
30diff --git a/src/plugin.cpp b/src/plugin.cpp
31index 4bc817e..a98cb4a 100644
32--- a/src/plugin.cpp
33+++ b/src/plugin.cpp
34@@ -14,6 +14,18 @@ class Port : public QQmlExtensionPlugin {
35 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
36
37 public:
38+ void initializeEngine(QQmlEngine *engine, const char *uri) override {
39+ if (strcmp(uri, "com.github.catsout.wallpaperEngineKde") != 0) return;
40+ if (!engine) return;
41+
42+ QString pathList = QML_LIB;
43+ QStringList paths = pathList.split(':', Qt::SkipEmptyParts);
44+ for (const QString &path : paths) {
45+ engine->addImportPath(path);
46+ }
47+
48+ QQmlExtensionPlugin::initializeEngine(engine, uri);
49+ }
50 void registerTypes(const char* uri) override {
51 if (strcmp(uri, "com.github.catsout.wallpaperEngineKde") != 0) return;
52 qmlRegisterType<wekde::PluginInfo>(uri, WPVer[0], WPVer[1], "PluginInfo");