From 1fa8213038ff1c729429e9f781aa3bd7670e4d22 Mon Sep 17 00:00:00 2001 From: Marius DAVID Date: Sun, 1 Feb 2026 21:25:30 +0100 Subject: [PATCH] nix: add a vulkan option and enable xcb QT platform by default --- flake.nix | 4 +++- nix/overte.nix | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 4e95ccfcffd..b0a31cd5e4c 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ ... }: { - packages = { + packages = rec { glad = pkgs.callPackage ./nix/glad.nix { }; etc2comp = pkgs.callPackage ./nix/etc2comp.nix { }; @@ -52,6 +52,8 @@ libv8 = pkgs.nodejs_22.libv8; }; + overte-full-vulkan = overte-full.override { renderingBackend = "Vulkan"; }; + # TODO: update/remove when overte updates to more modern version draco = pkgs.callPackage ./nix/draco.nix { }; diff --git a/nix/overte.nix b/nix/overte.nix index 7f8d4eff1af..60dc4199371 100644 --- a/nix/overte.nix +++ b/nix/overte.nix @@ -31,6 +31,9 @@ libopus, libsForQt5, libv8, + vulkan-loader, + vulkan-headers, + vulkan-memory-allocator, # tools for shader compilation scribe, @@ -43,9 +46,13 @@ buildClient ? true, buildServer ? true, buildTools ? false, + renderingBackend ? "OpenGL", }: + +assert renderingBackend == "OpenGL" || renderingBackend == "Vulkan"; + stdenv.mkDerivation { - pname = "overte"; + pname = "overte-${lib.toLower renderingBackend}"; version = "unstable"; src = let @@ -122,11 +129,16 @@ stdenv.mkDerivation { SDL2 libopus libv8 - ]; + ] ++ (lib.optionals (renderingBackend == "Vulkan") [ + vulkan-loader + vulkan-headers + vulkan-memory-allocator + ]); cmakeFlags = [ "-DOVERTE_USE_SYSTEM_LIBS=ON" "-DOVERTE_BUILD_TYPE=NIGHLTY" + "-DOVERTE_RENDERING_BACKEND=${renderingBackend}" ] ++ lib.optional (!buildClient) "-DOVERTE_BUILD_CLIENT=OFF" ++ lib.optional (!buildServer) "-DOVERTE_BUILD_SERVER=OFF" @@ -163,6 +175,7 @@ stdenv.mkDerivation { ln -s "$I"/interface $out/bin/overte-client makeWrapper "$I"/interface $out/bin/overte-client \ --unset QT_PLUGIN_PATH \ + --set-default QT_QPA_PLATFORM xcb \ "''${qtWrapperArgs[@]}" '' )