From 1e759786e526a87a3c05beeff5db41743d763569 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 31 Aug 2025 12:49:01 -0500 Subject: [PATCH] qt: deprecate kde6 Give users a heads up that option is being removed. Signed-off-by: Austin Horstman --- modules/misc/qt.nix | 16 ++++++++++++++-- tests/modules/misc/qt/default.nix | 1 + .../misc/qt/qt-platform-theme-kde6-migration.nix | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tests/modules/misc/qt/qt-platform-theme-kde6-migration.nix diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index 91966d9aa..0fe00d777 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -215,6 +215,7 @@ in "lxqt" "qtct" "kde" + "kde6" ]) (lib.types.submodule { options = newOption; }) ); default = null; @@ -290,11 +291,22 @@ in config = let + deprecateKde6 = + name: optionPath: + if name == "kde6" then + lib.warn '' + The ${optionPath} value "kde6" has been deprecated and renamed to "kde". + Please update your configuration: + ${optionPath} = "kde"; + '' "kde" + else + name; + platformTheme = if (builtins.isString cfg.platformTheme) then { option = "qt.platformTheme"; - name = cfg.platformTheme; + name = deprecateKde6 cfg.platformTheme "qt.platformTheme"; package = null; } else if cfg.platformTheme == null then @@ -306,7 +318,7 @@ in else { option = "qt.platformTheme.name"; - name = cfg.platformTheme.name; + name = deprecateKde6 cfg.platformTheme.name "qt.platformTheme.name"; package = cfg.platformTheme.package; }; diff --git a/tests/modules/misc/qt/default.nix b/tests/modules/misc/qt/default.nix index da27bf31f..88ba03f43 100644 --- a/tests/modules/misc/qt/default.nix +++ b/tests/modules/misc/qt/default.nix @@ -3,4 +3,5 @@ qt-platform-theme-gtk = ./qt-platform-theme-gtk.nix; qt-platform-theme-gtk3 = ./qt-platform-theme-gtk3.nix; qt-platform-theme-gnome = ./qt-platform-theme-gnome.nix; + qt-platform-theme-kde6-migration = ./qt-platform-theme-kde6-migration.nix; } diff --git a/tests/modules/misc/qt/qt-platform-theme-kde6-migration.nix b/tests/modules/misc/qt/qt-platform-theme-kde6-migration.nix new file mode 100644 index 000000000..cdf54bd51 --- /dev/null +++ b/tests/modules/misc/qt/qt-platform-theme-kde6-migration.nix @@ -0,0 +1,16 @@ +{ + qt = { + enable = true; + platformTheme.name = "kde6"; # Should trigger warning and convert to "kde" + }; + + nmt.script = '' + # Verify that kde6 gets converted to kde in QT_QPA_PLATFORMTHEME + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_QPA_PLATFORMTHEME="kde"' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QT_PLUGIN_PATH' + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ + 'QML2_IMPORT_PATH' + ''; +}