I have tried both libsForQt512 and libsForQt514 as well as libsForQt5.full but none of that helped.
I even know how this package is called on other distros:
Ubuntu: qml-module-org-kde-kirigami2
Arch: kde-sdk-meta
Does anyone know if this is even packaged on NixOS?
If so, what is the name of the package and how in general should I figure out Qt package names on Nix?
P.S. as I have mentioned above, all of the C++ and QML code is taken from the tutorial.
I believe the org.kde.kirigami qml module is part of libsForQt5.kirigami2 (You should be able to see the qml and related files in /nix/store/<hash>-kirigami2-<version>/lib/qt-5.12.2/qml/org/kde/kirigami.2). However, it seems Qt can’t find it. Is QML2_IMPORT_PATH set in the shell’s environment?
I believe you can get the qml prefix more easily by using qt5.qtbase.qtQmlPrefix[1].
In addition to that, I think there should be a way to have nix build a path which combines all the qml modules from all the relevant inputs, not just kirigami. As an example, for the currently running system, there should be a path, /run/current-system/sw/${pkgs.qt5.qtbase.qtQmlPrefix}. Obviously that’s not what we want, as there’s no guarantee that the system has the same Qt packages as the nix shell. I’m not sure what the correct answer is though.
[1] I believe any qt module should have the property and they should all be the same prefix, so you don’t have to use qtbase if it’s not in scope.
Coincidentally, I’m currently running into exactly the same issue with QML2_IMPORT_PATH in mkShell. I don’t think the user should be responsible for constructing and setting it manually. I know that Qt packaging in nixpkgs has its own version of mkDerivation which takes care of the necessary wrapping and environment variables, but it doesn’t appear to have a mkShell replacement.
Perhaps @ttuegel would know what the correct way to do this is.