Restructure project
This commit is contained in:
19
flake.nix
19
flake.nix
@@ -17,15 +17,24 @@
|
||||
qt6.qttools
|
||||
|
||||
# this is for the shellhook portion
|
||||
qt6.wrapQtAppsHook
|
||||
makeWrapper
|
||||
bashInteractive
|
||||
# bashInteractive
|
||||
];
|
||||
# set the environment variables that unpatched Qt apps expect
|
||||
shellHook = ''
|
||||
bashdir=$(mktemp -d)
|
||||
makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}"
|
||||
exec "$bashdir/bash"
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
|
||||
|
||||
# Add Qt-related environment variables.
|
||||
# https://discourse.nixos.org/t/qt-development-environment-on-a-flake-system/23707/5
|
||||
setQtEnvironment=$(mktemp)
|
||||
random=$(openssl rand -base64 20 | sed "s/[^a-zA-Z0-9]//g")
|
||||
makeShellWrapper "$(type -p sh)" "$setQtEnvironment" "''${qtWrapperArgs[@]}" --argv0 "$random"
|
||||
sed "/$random/d" -i "$setQtEnvironment"
|
||||
source "$setQtEnvironment"
|
||||
|
||||
# qmlls does not account for the import path and bases its search off qtbase's path.
|
||||
# The actual imports come from qtdeclarative. This directs qmlls to the correct imports.
|
||||
export QMLLS_BUILD_DIRS=$(pwd)/build:$QML2_IMPORT_PATH
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user