From dd8978e6e3c84a7d0c85ae1b50ca247218926288 Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Sun, 18 Jan 2026 23:14:34 -0500 Subject: [PATCH] google-chrome: add plasmaSupport option Chrome has an optional feature to introspect your QT theme and generate a Chrome theme from it. It does this by [dynamically linking QT (if present)](https://docs.google.com/document/d/1IO6NTtnJiEVps0WlUC_lDr1bBKO72zPNTe-4msoBYXk/edit?resourcekey=0-UbCM69FptaNMGX7JXGt-3Q). A previous PR #375279 added basic support for this (by including `qt6` as a derivation dependency), but it was broken. The title bar was always cyan regardless of what theme you had chosen in KDE. This PR adds `plasma-integration` to correctly deduce the user's chosen theme. It also moves the current `qt6` dependency behind the new `plasmaSupport` flag, ensuring that users who are not utilizing the QT theme aren't pulling in QT inadvertently. Only `google-chrome` is in scope for this PR (because it's what I use), but others are welcome to copy it to fulfill #228751 for Chromium derivatives. --- pkgs/by-name/go/google-chrome/package.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/go/google-chrome/package.nix b/pkgs/by-name/go/google-chrome/package.nix index 97a1d3fb0e79..419783472703 100644 --- a/pkgs/by-name/go/google-chrome/package.nix +++ b/pkgs/by-name/go/google-chrome/package.nix @@ -94,8 +94,10 @@ addDriverRunpath, undmg, - # For QT support + # Enables Chrome's "Use QT" appearance to introspect the user's Plasma theme + plasmaSupport ? false, qt6, + kdePackages, # Create a symlink at $out/bin/google-chrome withSymlink ? true, @@ -167,8 +169,12 @@ let ++ [ gtk3 gtk4 + ] + ++ lib.optionals plasmaSupport [ qt6.qtbase qt6.qtwayland + kdePackages.plasma-integration + kdePackages.breeze ]; linux = stdenvNoCC.mkDerivation (finalAttrs: { @@ -249,9 +255,13 @@ let # "--simulate-outdated-no-au" disables auto updates and browser outdated popup makeWrapper "$out/share/google/$appname/google-$appname" "$exe" \ - --prefix QT_PLUGIN_PATH : "${qt6.qtbase}/lib/qt-6/plugins" \ - --prefix QT_PLUGIN_PATH : "${qt6.qtwayland}/lib/qt-6/plugins" \ - --prefix NIXPKGS_QT6_QML_IMPORT_PATH : "${qt6.qtwayland}/lib/qt-6/qml" \ + ${lib.optionalString plasmaSupport '' + --prefix QT_PLUGIN_PATH : "${qt6.qtbase}/lib/qt-6/plugins" \ + --prefix QT_PLUGIN_PATH : "${qt6.qtwayland}/lib/qt-6/plugins" \ + --prefix QT_PLUGIN_PATH : "${kdePackages.plasma-integration}/lib/qt-6/plugins" \ + --prefix QT_PLUGIN_PATH : "${kdePackages.breeze}/lib/qt-6/plugins" \ + --prefix NIXPKGS_QT6_QML_IMPORT_PATH : "${qt6.qtwayland}/lib/qt-6/qml" \ + ''} \ --prefix LD_LIBRARY_PATH : "$rpath" \ --prefix PATH : "$binpath" \ --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \