This will only work (as-is) at the root of the same nixpkgs checkout from which you're trying to run a Qt app.
$ pwd
/my/checkout/nixpkgs
$ qt-run result/bin/that-qt-software
This will only work (as-is) at the root of the same nixpkgs checkout from which you're trying to run a Qt app.
$ pwd
/my/checkout/nixpkgs
$ qt-run result/bin/that-qt-software
#!/usr/bin/env bash | |
# THIS ONLY WORKS WHEN USED AT THE ROOT OF A NIXPKGS CHECKOUT | |
# OR IF YOU MANIPULATE YOUR NIX PATH. | |
set -e | |
set -u | |
_nb() { | |
nix-build --no-out-link -A "$@" | |
} | |
_qtlibs=( | |
qt5.qtbase.bin | |
qt5.qtdeclarative.bin | |
qt5.qtimageformats.out | |
qt5.qtlocation.bin | |
qt5.qtmultimedia.bin | |
qt5.qtsensors.bin | |
qt5.qtsvg.bin | |
) | |
for attrpath in "${_qtlibs[@]}"; do | |
_p=$(_nb $attrpath)/bin | |
PATH="$_p:$PATH" | |
unset _p | |
done | |
exec "$@" |
This (ab)uses the added behaviour from nixpkgs to Qt that uses
PATH
components to pre-seed the Qt plugin path. UsingQT_PLUGIN_PATH
would work as well. I, though, preferred using PATH as they are earlier in the selection.As for which libs, I used this:
And selected those under
qt5.*
.