Minor changes to reduce kde build deps

This commit is contained in:
outfoxxed 2024-01-23 05:12:40 -08:00
parent f1e50306f8
commit 97b759c92a
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
5 changed files with 69 additions and 7 deletions

33
shell.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cmake
wayland-scanner
libsForQt5.extra-cmake-modules
clang-tools_17
];
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtdeclarative
qt6.qtwayland
wayland
wayland-protocols
];
shellHook = ''
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")
makeWrapper "$(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
'';
}